Marked is a markdown editor for macOS and Windows. It allows you to write in simple, plain-text Markdown format and instantly see the rendered HTML output in a preview pane. This allows for a distraction-free writing experience while simultaneously providing a real-time view of your formatted document. Marked supports a wide range of Markdown extensions, offering flexibility and customization for your writing needs. It’s designed to be lightweight, fast, and easy to use, prioritizing both simplicity and powerful features.
Marked offers several advantages over other markdown editors:
Setting up Marked is straightforward:
Marked supports a wide range of Markdown syntax. Here’s a quick overview of the basics:
#
symbols at the beginning of a line to create headers (e.g., # Heading 1
, ## Heading 2
, etc.).*
or _
for italics (e.g., *italics*
or _italics_
) and **
or __
for bold (e.g., **bold**
or __bold__
).*
, -
, or +
(e.g., * Item 1
, - Item 2
, + Item 3
). Create ordered lists with numbers followed by a period (e.g., 1. Item 1
, 2. Item 2
).[Marked Website](https://marked.app)
).
).) to enclose inline code snippets (e.g., ``
code` ``) and triple backticks () to create code blocks (e.g.,
javascript console.log(“Hello, world!”); ). Specify the language after the opening triple backticks for syntax highlighting (e.g.,
python print(“Hello, world!”)* **Blockquotes:** Use `>` at the beginning of a line to create blockquotes (e.g., `> This is a blockquote.`).
* **Horizontal Rules:** Use three or more hyphens (`---`), asterisks (`***`), or underscores (`___`) on a line by themselves to create a horizontal rule.
### Rendering Markdown
Marked automatically renders your Markdown as you type. The preview pane displays the HTML output in real-time. Any changes you make to the Markdown source will immediately update the preview. The rendering engine used is based on a robust and highly compatible parser. If you encounter unexpected behavior, ensure that your Markdown syntax is correct and check the Marked application's settings to verify that the correct Markdown extensions are enabled.
### Options and Configuration
Marked provides a comprehensive set of options and configurations to customize your experience. Access these settings through the application's preferences menu. Key configurable aspects include:
* **Markdown Extensions:** Select which Markdown extensions to enable. This allows you to control support for features like tables, footnotes, and other extensions. Refer to the documentation for a complete list of supported extensions and their functionalities.
* **Custom CSS:** Apply custom CSS to style the rendered HTML output. This allows for complete control over the visual appearance of your documents, enabling you to create a unique look and feel.
* **Fonts:** Select the fonts used in both the editor and the preview pane.
* **Export Options:** Configure settings for exporting your documents in different formats (HTML, PDF, etc.), including specifying metadata, page margins, and other relevant export parameters.
* **Themes:** Choose from available themes (or create your own) to change the visual style of the application's interface.
* **General Settings:** Adjust various aspects of the application behavior, including line wrapping, auto-saving, and more.
By exploring the options available in the preferences menu, you can tailor Marked to perfectly fit your workflow and preferences. Remember to consult the application's help documentation for detailed descriptions of each setting and its impact.
## Advanced Usage
### Customizing Renderers
While Marked provides a robust default rendering engine, advanced users can customize the rendering process. This typically involves creating custom CSS stylesheets to modify the visual appearance of the rendered HTML. To achieve this:
1. **Create a CSS file:** Create a new CSS file containing your custom styles. This file should contain CSS rules targeting specific HTML elements generated by Marked's rendering engine. You might want to inspect the rendered HTML (using your browser's developer tools) to identify the appropriate selectors for your customizations.
2. **Apply the CSS:** In Marked's preferences, navigate to the section allowing you to specify custom CSS. Provide the path to your newly created CSS file. Marked will then incorporate your custom styles into the rendered output.
3. **Testing:** Thoroughly test your custom CSS to ensure it functions as intended and doesn't introduce any unintended styling conflicts.
Note: Direct modification of Marked's internal rendering engine is generally not supported and may break functionality. Custom CSS offers a safe and effective way to customize the visual presentation.
### Extending Marked with Plugins
Marked does not natively support plugins. Its functionality is primarily defined within the application itself. Any extensions to its core features would require modification of the application's source code, which is not publicly available.
### Handling Errors and Exceptions
If errors occur during the Markdown rendering process (e.g., due to invalid Markdown syntax), Marked will typically display an error message indicating the nature of the problem. This usually involves highlighting the problematic section of your Markdown source code in the editor. Refer to the error message for detailed information to help correct the issue. Common errors include:
* **Syntax Errors:** Incorrect use of Markdown syntax will lead to rendering errors. Carefully review the Markdown specification and ensure your syntax is correct.
* **File Errors:** Issues related to accessing or reading files, particularly those referenced within your Markdown (e.g., images), can result in errors. Check that the referenced files exist and are accessible to Marked.
### Performance Optimization
For optimal performance, consider these points:
* **Document Size:** Extremely large Markdown documents might impact rendering speed. For very large documents, consider breaking them down into smaller, more manageable files.
* **Complex Markdown:** Highly complex Markdown with numerous embedded elements, nested structures, and extensive use of extensions can increase rendering time. Strive for a balanced approach, avoiding unnecessary complexity where possible.
* **Custom CSS:** Overly complex or inefficient custom CSS can negatively impact rendering performance. Optimize your CSS to ensure it's concise and efficiently targets the elements it's intended to style.
* **System Resources:** Ensure your system has sufficient resources (RAM, CPU) to handle the rendering process. Closing unnecessary applications might free up resources for Marked.
If you consistently experience performance issues, consider contacting Marked support for assistance in troubleshooting potential problems.
## Markdown Syntax
Marked supports a comprehensive range of Markdown syntax elements. The following details the supported syntax and how it's rendered. Note that the exact rendering may vary slightly depending on enabled Markdown extensions.
### Headers
Headers are created using `#` symbols at the beginning of a line. The number of `#` symbols determines the header level (e.g., `#` is level 1, `##` is level 2, and so on, up to level 6).
```markdown
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
Use *
or _
for italics and **
or __
for bold text. You can combine them for bold italics.
*This is italics.*
_This is also italics._
**This is bold.**
__This is also bold.__
***This is bold italics.*** ___This is also bold italics.___
Unordered lists are created using *
, -
, or +
at the beginning of each list item. Ordered lists use numbers followed by a period.
* Item 1
* Item 2
- Item 3
+ Item 4
1. Item 1
2. Item 2
3. Item 3
Links are created using square brackets []
for the link text and parentheses ()
for the URL.
[Marked Website](https://marked.app)
Images are similar to links, but begin with an exclamation mark !
.

Inline code is enclosed in backticks `
. Code blocks are enclosed in triple backticks . You can specify the language after the opening triple backticks for syntax highlighting (e.g., ```
javascript
).
This is inline code: `` `var x = 10;` ``
This is a code block:```javascript
function myFunction() {
console.log("Hello, world!");
}
### Blockquotes
Blockquotes are created using `>` at the beginning of each line.
```markdown
> This is a blockquote.
> It can span multiple lines.
Horizontal rules are created using three or more hyphens (---
), asterisks (***
), or underscores (___
) on a line by themselves.
---
***
___
Tables are created using pipes |
to separate columns and hyphens -
to define the header row.
| Header 1 | Header 2 |
|---|---|
| Row 1, Cell 1 | Row 1, Cell 2 | | Row 2, Cell 1 | Row 2, Cell 2 |
Marked allows embedding raw HTML. Note that this is dependent on the enabled renderer and may not support all HTML elements.
<p>This is a paragraph using raw HTML.</p>
Footnotes are created using [^footnote-ref]
. The footnote definition is placed at the end of the document using [^footnote-ref]: footnote text
.
[^1]
This is a sentence with a footnote.
[^1]: This is the footnote text.
Definitions lists are created using terms followed by colons and definitions.
Term 1
: Definition 1
Term 2 : Definition 2
Note: This API reference describes the hypothetical API of a Marked-like Markdown renderer. The actual Marked application’s internal API is not publicly documented and may differ significantly. This section provides a conceptual overview of how such an API might be structured.
marked()
The primary function for rendering Markdown. It takes a Markdown string as input and returns the rendered HTML string.
const html = marked('This is *Markdown*!'); // html will contain "<p>This is <em>Markdown</em>!</p>"
Parameters:
markdown
(string): The Markdown string to render.Returns:
marked.setOptions()
Sets global options for the Markdown renderer. These options will affect all subsequent calls to marked()
.
.setOptions({
markedgfm: true, // Enable GitHub Flavored Markdown
breaks: true, // Enable line breaks
smartypants: true // Enable smart quotes
; })
Parameters:
options
(object): An object containing the options to set. Common options include gfm
, breaks
, smartypants
, highlight
, and langPrefix
.marked.Lexer()
Creates a new lexer instance. The lexer is responsible for breaking down the Markdown input into tokens.
const lexer = new marked.Lexer();
const tokens = lexer.lex('This is a #header.');
console.log(tokens); // Array of tokens representing the Markdown structure.
Parameters:
options
(object): Options for the lexer.Methods:
lex(markdown)
: Parses the Markdown input and returns an array of tokens.marked.Parser()
Creates a new parser instance. The parser takes the tokens generated by the lexer and constructs the HTML output.
const parser = new marked.Parser();
const html = parser.parse(tokens); // tokens from marked.Lexer().lex()
console.log(html); // Rendered HTML
Parameters:
options
(object): Options for the parser.Methods:
parse(tokens)
: Parses the array of tokens and returns the rendered HTML.marked.Renderer()
Creates a new renderer instance. The renderer is responsible for converting tokens into HTML. This allows for customization of the HTML output.
const renderer = new marked.Renderer();
.heading = function (text, level) {
rendererreturn `<h${level} id="${text.toLowerCase().replace(/\s+/g, '-')}">${text}</h${level}>`;
;
}
const html = marked('This is a #header.', { renderer: renderer }); // Custom header rendering
Parameters:
options
(object): Options for the renderer.Methods:
heading
, paragraph
, list
, image
, link
, etc.). These methods can be overridden to customize the HTML generation. Consult the renderer’s API documentation for a complete list of available methods.This section addresses frequently encountered issues when using Marked.
Rendering Errors: Incorrect Markdown syntax is a common source of rendering errors. Carefully review your Markdown code, paying close attention to syntax rules for elements like headers, lists, links, and code blocks. Use a Markdown linter (if available) to help identify syntax problems. Marked often provides helpful error messages highlighting the location of the problem in your Markdown source.
Unexpected Formatting: If the rendered output doesn’t match your expectations, ensure that the correct Markdown extensions are enabled in Marked’s preferences. Some formatting behaviors (like line breaks, smart quotes, etc.) are controlled by these settings.
Image Display Issues: Problems displaying images may stem from incorrect image paths, inaccessible image files, or missing image files. Double-check that the file paths in your Markdown are correct and the images are accessible to the application.
Custom CSS Conflicts: If you’re using custom CSS, conflicts with existing styles might cause unexpected visual results. Inspect the rendered HTML (using browser developer tools) to identify style conflicts and adjust your custom CSS accordingly.
Performance Issues: Extremely large Markdown files or complex documents with nested elements and many extensions can affect rendering performance. Consider breaking large files into smaller parts or simplifying complex Markdown structures.
Application Crashes: If Marked crashes unexpectedly, try restarting the application. If the crashes persist, check for application updates and consider contacting support.
If you encounter more complex issues, these debugging tips can assist you:
Simplify Your Markdown: Create a minimal, reproducible Markdown example to isolate the problem. This helps in identifying the root cause.
Check the Console: If Marked has a console or log output, check for any error messages or warnings that may provide clues about the issue.
Inspect Rendered HTML: Using your web browser’s developer tools (usually accessed by right-clicking and selecting “Inspect” or “Inspect Element”), examine the rendered HTML. This will help identify if the problem is in the Markdown or the HTML rendering process.
Test with Different Markdown Editors: Render your Markdown in another editor to see if the problem is specific to Marked or a broader Markdown rendering issue.
Review Marked’s Documentation: The official documentation should provide answers to many common questions and troubleshooting solutions.
Search for Similar Issues: If your problem isn’t documented, search online forums and community support channels to see if others have experienced the same or similar problems.
For assistance beyond this manual, consider these avenues:
Online Forums: Check if Marked has an official online forum or community where users can ask questions and share solutions.
Issue Trackers: If you suspect a bug or have encountered unexpected behavior, report it through Marked’s issue tracker (if one exists). Provide detailed information, including the steps to reproduce the issue and relevant screenshots or logs.
Contact Support: Many applications provide direct support channels (e.g., email or a help desk system). Contacting support is advisable for complex issues or critical problems. Provide as much detail as possible about your problem, including Marked’s version, operating system, and relevant screenshots or logs.
This section outlines how to contribute to the development of Marked (assuming it’s an open-source project). If Marked is not open-source, this section would be irrelevant and should be omitted.
We welcome contributions from the community! To contribute to Marked, please follow these guidelines:
Fork the Repository: Create a fork of the main Marked repository on the platform where it’s hosted (e.g., GitHub, GitLab).
Create a Branch: Create a new branch for your contribution. Use descriptive branch names that clearly indicate the purpose of your changes (e.g., fix-bug-123
, feature-new-theme
).
Make Your Changes: Implement your changes, following the code style guidelines detailed below. Ensure your changes are well-documented and thoroughly tested.
Write Tests: Add or update tests to cover your changes. Thorough testing is crucial to ensuring the quality and stability of the project.
Commit Your Changes: Commit your changes with clear and concise commit messages. Follow a consistent commit message style (e.g., using imperative mood).
Push Your Branch: Push your branch to your forked repository.
Create a Pull Request: Create a pull request to merge your branch into the main repository. Clearly describe the changes you’ve made and address any potential concerns or questions in your pull request description.
Respond to Feedback: Respond to any feedback provided by the maintainers or other contributors. Be prepared to make necessary revisions and address any outstanding concerns.
Maintain consistency in code style to improve readability and maintainability. Follow these guidelines:
Indentation: Use consistent indentation (typically 2 or 4 spaces). Avoid using tabs.
Naming Conventions: Adhere to consistent naming conventions for variables, functions, and classes. (Specify the conventions used in the project, e.g., camelCase, snake_case).
Comments: Write clear and concise comments to explain complex logic or non-obvious code sections.
Line Length: Keep lines of code to a reasonable length (e.g., under 80 characters) to enhance readability.
Formatting: Use a code formatter (if one is specified by the project) to ensure consistent formatting across the codebase.
Testing is a crucial part of the development process. Contribute to the existing test suite or add new tests to cover your changes. The project should specify its testing framework and practices. Follow these general guidelines:
Write Unit Tests: Create unit tests to test individual components or functions in isolation.
Write Integration Tests: Develop integration tests to verify the interactions between different parts of the system.
Test Coverage: Strive for high test coverage to ensure that a significant portion of the codebase is tested.
Continuous Integration (CI): Familiarize yourself with the project’s CI process. The CI pipeline should automatically run tests when code changes are pushed. Ensure that your changes pass all CI tests before submitting a pull request.