Back to Docs

Creating Documents

Learn how to create and edit markdown documents in MerDoc with live preview and formatting options.

Getting Started

Creating a markdown document in MerDoc is simple. Click "New Document" from the documents page and select "Document" as the type. You can choose from built-in templates or start with a blank document.

  1. Navigate to the Documents page
  2. Click "New Document" button
  3. Select "Document" from the document type options
  4. Choose a template (optional) or start from scratch
  5. Enter a title for your document
  6. Start writing markdown content

Markdown Basics

MerDoc supports standard markdown syntax. Here are the most common formatting options:

  • Headings: Use `#` for H1, `##` for H2, etc.
  • Bold: Wrap text in `**bold**`
  • Italic: Wrap text in `*italic*`
  • Lists: Use `-` for unordered lists, numbers for ordered lists
  • Code: Use backticks for `inline code` or triple backticks for code blocks
  • Links: `[text](url)` for links
  • Images: `![alt](url)` for images

Live Preview

The markdown editor features a split-view with live preview. As you type, you'll see your formatted content update in real-time on the right side. This makes it easy to perfect your formatting as you write.

Code Blocks

Code blocks support syntax highlighting. Specify the language after the opening triple backticks:

```javascript
function hello() {
  console.log("Hello, World!");
}
```

Runnable Code Blocks

MerDoc supports executable code blocks, similar to Jupyter notebooks! You can run code directly in your documents. Supported languages:

  • JavaScript: Execute JavaScript code with console output
  • TypeScript: TypeScript code is automatically transpiled to JavaScript
  • Python: Run Python code in the browser using Pyodide
  • HTML: Render HTML with live preview in an iframe

To make a code block executable, simply use the standard code block syntax. When viewing the document, you'll see a play button on executable code blocks. Click it to run the code and see the output, console logs, and any errors.

Example:

```javascript
// This code can be executed!
const x = 10;
const y = 20;
console.log(`Sum: ${x + y}`);
```

Templates

Save time by using templates when creating new documents. MerDoc includes built-in templates for common use cases like meeting notes, technical specs, blog posts, and more.

  • Built-in Templates: Choose from pre-made templates when creating a new document
  • Save as Template: Save any document as a template for future use
  • Template Library: Access your saved templates from the template picker

To save a document as a template, open the document and click "Save as Template" in the document actions menu. Your template will be available when creating new documents of the same type.

Tags

Organize your documents with tags. Add multiple tags to categorize and filter your documents for easy discovery.

  • Add tags using the tag input field in the document header
  • Filter documents by tags from the documents list
  • Tags help organize content without complex folder hierarchies

Math Support

MerDoc supports mathematical equations using KaTeX. You can render both inline and block equations:

  • Inline Math: Use $...$ for inline equations, like $E = mc^2$
  • Block Math: Use $$...$$ for displayed equations on their own line

Example:

Inline: $\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}$

Block:
$$\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}$$

Embedding Content

You can embed various types of content in your markdown documents:

  • Images: Upload images using the toolbar button or use markdown syntax
  • Mermaid Diagrams: Embed diagrams using mermaid code blocks
  • Links: Add links to other documents or external resources
  • Math Equations: Use KaTeX syntax for mathematical notation

Editor Features

The markdown editor includes several powerful features for efficient editing:

  • Vim Mode: Toggle Vim keybindings for modal editing. Click the "VIM" button in the toolbar
  • Split View: View your markdown source and preview side-by-side
  • Syntax Highlighting: Code blocks are highlighted based on the specified language
  • Live Preview: See formatted output update in real-time as you type
  • Toolbar Actions: Quick formatting buttons for bold, italic, lists, links, and more

Exporting Documents

Export any document as a markdown file for offline use or version control:

  1. Open the document you want to export
  2. Click the document actions menu (three dots)
  3. Select "Export"
  4. The document will download as a .md file

Exported files preserve all markdown formatting and can be opened in any markdown editor or version control system.

Saving Your Document

Click "Create" (for new documents) or "Save Changes" (when editing) to save your work. Documents are automatically saved to your account and can be accessed anytime.