ParsedownExtended Documentation

website·Indexed 30 days ago

https://benjaminhoegh.github.io/ParsedownExtended

Documentation for ParsedownExtended, featuring configuration guides for Markdown extensions including tables, LaTeX math support, diagrams, definition lists, footnotes, and GitHub Flavored Markdown alerts. Covers versions 1.2.x, 1.3.x, and 2.2.x.

Tokens
17.8K
Snippets
140
Records
165
Agent score
69%

What's inside ParsedownExtended

  1. Overview of ParsedownExtended features

    ParsedownExtended is an extension for the Parsedown library that adds advanced Markdown parsing capabilities. Key features include:

    • Task Lists: Support for creating task lists.
    • Smartypants: Automatic conversion of straight quotes to curly quotes and dashes to en-dash/em-dash.
    • Emojis: Rendering support for emojis.
    • Heading Permalinks: Automatic generation of permalinks for headings.
    • Table of Contents: Automatic generation of a TOC based on document headings.
    • Keystrokes: Rendering of keystroke combinations.
    • Marking: Text marking for emphasis or distinction.
    • Superscript and Subscript: Support for rendering superscript and subscript text.
    • Diagrams Syntax: Recognition of diagram syntax for use with libraries such as mermaid.js and chart.js.
    • LaTeX Syntax: Detection of LaTeX syntax for mathematical expressions, intended for use with libraries like KaTeX.js.
    • Predefined Abbreviations: Ability to define and use abbreviations.
    • Customizable Options: Extensive configuration options for Markdown elements.
  2. Overview of ParsedownExtended features

    ParsedownExtended is an extension for the Parsedown library that adds advanced Markdown parsing capabilities. Key features include:

    • Task Lists: Support for Markdown task lists.
    • Smartypants: Automatic conversion of straight quotes to curly quotes and dashes to en-dash/em-dash.
    • Emojis: Rendering support for emojis.
    • Heading Permalinks: Automatic generation of permalinks for headings.
    • Table of Contents: Automatic generation of a TOC based on document headings.
    • Keystrokes: Rendering of keyboard shortcut combinations.
    • Marking: Text marking for emphasis or distinction.
    • Superscript and Subscript: Support for rendering superscript and subscript text.
    • Diagrams Syntax: Recognition of diagram syntax for use with libraries like mermaid.js and chart.js.
    • LaTeX Syntax: Detection of LaTeX mathematical expressions for rendering with libraries like KaTeX.js.
    • Predefined Abbreviations: Ability to define and use abbreviations.
    • GFM Alerts: Support for GitHub Flavored Markdown Alert syntax, which can be customized or extended.
    • Customizable Options: Extensive configuration options for individual Markdown elements.
  3. Overview of ParsedownExtended features

    ParsedownExtended is an extension for the Parsedown library that adds advanced Markdown parsing capabilities. Key features include:

    • Task Lists: Support for creating checklist-style task lists.
    • Smartypants: Automatic conversion of straight quotes to curly quotes and dashes to en-dash/em-dash.
    • Emojis: Rendering support for emojis.
    • Heading Permalinks: Automatic generation of permalinks for headings.
    • Table of Contents: Automatic generation of a TOC based on document headings.
    • Keystrokes: Specialized rendering for keyboard input combinations.
    • Marking: Ability to mark text for emphasis or distinction.
    • Superscript and Subscript: Support for rendering text in super/subscript formats.
    • Diagrams Syntax: Recognition of diagram syntax for use with external libraries like mermaid.js and chart.js.
    • LaTeX Syntax: Detection of LaTeX mathematical expressions for rendering with libraries like KaTeX.js.
    • Predefined Abbreviations: Support for defining and using abbreviations throughout the document.
    • Customizable Options: Extensive configuration options for individual Markdown elements.
  4. Integrate ChartJS and Mermaid diagrams in ParsedownExtended

    ParsedownExtended supports incorporating diagrams from ChartJS and Mermaid directly into Markdown documents. The library ensures that diagram code is preserved and unaltered during parsing so that it can be rendered on the client side. To make these diagrams work, you must include the corresponding ChartJS and Mermaid JavaScript libraries in your project's frontend.
  5. Use GitHub Flavored Markdown alerts in ParsedownExtended

    ParsedownExtended supports GFM alert syntax, which creates block-quote-style callouts. Each alert is wrapped in a <div> with a base CSS class and a specific type class (e.g., markdown-alert markdown-alert-note).

    Supported default alert types include:

    • [!NOTE]
    • [!TIP]
    • [!IMPORTANT]
    • [!WARNING]
    • [!CAUTION]
    > [!NOTE]
    > Highlights information that users should take into account.
    
    > [!TIP]
    > Optional information to help a user be more successful.
    
    > [!IMPORTANT]
    > Crucial information necessary for users to succeed.
    
    > [!WARNING]
    > Critical content demanding immediate user attention due to potential risks.
    
    > [!CAUTION]
    > Negative potential consequences of an action.
  6. Install ParsedownExtended using Composer

    Install ParsedownExtended via the command line using Composer. This method automatically manages the required Parsedown and ParsedownExtra dependencies.
    composer require benjaminhoegh/parsedown-extended
    require 'vendor/autoload.php';
    
    use BenjaminHoegh
    ParsedownExtended
    ParsedownExtended;
    
    $ParsedownExtended = new ParsedownExtended();
    
    // Parse full markdown text
    echo $ParsedownExtended->text('Hello _Parsedown_!'); // prints: <p>Hello <em>Parsedown</em>!</p>
    
    // Parse inline markdown only
    echo $ParsedownExtended->line('Hello _Parsedown_!'); // prints: Hello <em>Parsedown</em>!
  7. Install ParsedownExtended manually

    For manual installation, download the source code from the latest release and include the required library files in your project. Note that Parsedown.php is required, while ParsedownExtra.php is optional depending on the features you need.
    require 'Parsedown.php';
    require 'ParsedownExtra.php'; // optional
    require 'ParsedownExtended.php';
    
    $ParsedownExtended = new ParsedownExtended();
    
    echo $ParsedownExtended->text('Hello _Parsedown_!'); // prints: <p>Hello <em>Parsedown</em>!</p>
    // Parse inline markdown only
    echo $ParsedownExtended->line('Hello _Parsedown_!'); // prints: Hello <em>Parsedown</em>!
  8. Install ParsedownExtended using Composer

    Install ParsedownExtended via the command line using Composer. This method automatically manages the required Parsedown and ParsedownExtra dependencies.
    composer require benjaminhoegh/parsedown-extended
    require 'vendor/autoload.php';
    
    $ParsedownExtended = new ParsedownExtended();
    
    echo $ParsedownExtended->text('Hello _Parsedown_!'); // prints: <p>Hello <em>Parsedown</em>!</p>
    // Parse inline markdown only
    echo $ParsedownExtended->line('Hello _Parsedown_!'); // prints: Hello <em>Parsedown</em>!
  9. Install ParsedownExtended using Composer

    Install ParsedownExtended via the command line using Composer. This method automatically manages the required Parsedown and ParsedownExtra dependencies.
    composer require benjaminhoegh/parsedown-extended
    require 'vendor/autoload.php';
    
    $ParsedownExtended = new ParsedownExtended();
    
    // Parse full markdown text
    echo $ParsedownExtended->text('Hello _Parsedown_!'); // prints: <p>Hello <em>Parsedown</em>!</p>
    
    // Parse inline markdown only
    echo $ParsedownExtended->line('Hello _Parsedown_!'); // prints: Hello <em>Parsedown</em>!
  10. Install ParsedownExtended manually

    For manual installation, download the source code from the latest release and include the library files directly in your project. Note that you must manually provide the Parsedown and ParsedownExtra files.
    require 'Parsedown.php';
    require 'ParsedownExtra.php'; // optional
    require 'ParsedownExtended.php';
    
    use BenjaminHoegh
    ParsedownExtended
    ParsedownExtended;
    
    $ParsedownExtended = new ParsedownExtended();
    
    // Parse full markdown text
    echo $ParsedownExtended->text('Hello _Parsedown_!'); // prints: <p>Hello <em>Parsedown</em>!</p>
    
    // Parse inline markdown only
    echo $ParsedownExtended->line('Hello _Parsedown_!'); // prints: Hello <em>Parsedown</em>!