mystmd

repository·main·Indexed 11 days ago

https://github.com/jupyter-book/mystmd

A command-line interface and authoring framework for scientific communication. It enables writing in MyST Markdown and rendering content into HTML, React, PDF (via LaTeX), and Microsoft Word. The ecosystem includes myst-parser for converting markdown to mdast, MyST Execute for Jupyter kernel execution, and various extensions for directives like tabs, cards, and proofs.

Tokens
162.8K
Snippets
678
Records
868
Agent score
54%

What's inside mystmd

  1. What is myst-to-tex?

    main

    myst-to-tex is a serialization library designed to convert MyST Markdown documents (specifically myst-spec AST documents) into $\LaTeX$ markup.

    Key Characteristics:

    • Serialization Only: It is designed to write $\LaTeX$ from an AST; it does not read or parse existing $\LaTeX$ files.
    • Templating: It works with jtex to template documents.
    • Ecosystem Integration: It functions as a unifiedjs plugin and is part of the mystmd ecosystem.
  2. Overview of MyST packages

    main

    The mystmd repository contains several specialized packages. All packages are ESM modules written in TypeScript.

    Command Line Tools

    • mystmd: Provides the CLI functionality for myst start.
    • mystmd-py: A Python wrapper for easy installation in Python environments (not intended for development).

    Core Packages

    • myst-cli: Provides the underlying CLI functionality for mystmd.
    • jtex: A templating library.
    • myst-frontmatter: Validation for scientific authorship/affiliation frontmatter.
    • myst-config: Validation and reading of configuration files.
    • myst-templates: Types and validation for LaTeX, web, and word templates.

    Markdown Parsing & AST

    MyST uses markdown-it for standard syntax and markdown-it-myst for MyST-specific syntax (roles/directives). The engine converts tokens into a MyST AST using mdast.

    • markdown-it-myst: Plugin for tokenizing roles and directives.
    • myst-directives: Core directives.
    • myst-roles: Core roles.
    • myst-parser: Converts token streams to MyST AST.

    Readers & Transformers

    • Readers: tex-to-myst (LaTeX to AST) and jats-to-myst (JATS XML to AST).
    • Transformers: myst-transforms (transforms AST elements like links, citations, and admonitions).

    Export Tools

    • myst-to-docx: MyST to MS Word.
    • myst-to-jats: MyST to JATS.
    • myst-to-tex: MyST to LaTeX (using jtex).
    • myst-to-html: MyST to HTML.

    Extensions

    • myst-ext-card, myst-ext-grid, myst-ext-tabs, myst-ext-reactive.
  3. Overview of MyST Markdown Tools

    main

    MyST (Markedly Structured Text) is an ecosystem of open-source tools designed for scientific communication. It allows authors to create publication-quality documents, including blogs, online books, scientific papers, reports, and journal articles, using an extended version of Markdown.

    Key capabilities include:

    • Interactive Content: Support for live graphs via Jupyter or JupyterLite, inline computations, and ipywidgets.
    • Scientific Features: Support for equations, cross-references, citations, and structured links.
    • Multi-format Export: Render MyST into modern interactive websites (React), PDFs/LaTeX (with templates for 400+ journals), Microsoft Word, and JATS XML.
    • Jupyter Integration: Native support for Jupyter Notebooks and integration with JupyterLab via jupyterlab-myst.
  4. Overview of MyST Markdown CLI capabilities

    main

    The mystmd CLI is a toolset for scientific communication designed to handle blogs, books, papers, and reports. Key features include:

    • Scientific Features: Support for cross-referencing, external structured links, and scientific citations.
    • Multi-format Rendering:
      • HTML/React: Generates static websites or modern React-based interactive websites.
      • PDF/LaTeX: Produces PDFs and LaTeX documents, including templates for over 400 journals.
      • Microsoft Word: Supports exporting content to Word format.
    • Standardized Parsing: Parses MyST Markdown into a standardized AST that follows the MyST Markdown Spec.
  5. What is the MyST Specification?

    main

    MyST (Markedly Structured Text) is a superset of CommonMark designed for creating publication-quality, computational documents. It is the foundation for JupyterBook, enabling the creation of educational textbooks and tutorials using Jupyter Notebooks and narrative content.

    The specification formalizes three core components:

    1. MyST Markup Language: A Markdown superset that uses directives (block-level extensions like callout panels, tabs, or figures) and roles (inline extensions like citations or inline math).
    2. MyST Abstract Syntax Tree (AST): A structured data representation of a document after parsing, used for transforming and rendering content.
    3. MyST Test Cases: A suite of unit tests used to validate MyST implementations across different languages (e.g., Python and JavaScript).
  6. What is the myst-parser Javascript package?

    main

    The myst-parser package is a Javascript implementation of the MyST (Markedly Structured Text) parser. It is designed to provide a flexible parser and renderer for MyST-flavored markdown, which is inspired by the Sphinx ecosystem and reStructuredText (RST). It is primarily used for rendering books, papers, and reports and is associated with JupyterBook.

    Key Capabilities:

    • Parses MyST-flavored markdown, including directives, roles, and block elements.
    • Exports a Markdown Abstract Syntax Tree (mdast) compliant with the MyST specification.
    • Provides a serializer that converts roles and directives into standard HTML (note: CSS styling is not provided).
    • Supports CommonMark markdown natively.
    • Provides extension points for adding custom directives, roles, and cross-referencing between multiple documents.