quarkdown

iamgioGPL-3.0活跃维护

把 Markdown 扩展成带脚本能力的标记语言,一份源文件可编译成论文、幻灯片、网站、书籍和知识库,省去多套工具切换。

🪐 Markdown with superpowers: from ideas to papers, presentations, websites, books, and knowledge bases.

v2.7.0发布于 2026-10-29 06:47 UTC16,366star +17 / 7 天523fork同步于 2026-11-10 11:25 UTC

怎么上手

由 README 提炼,执行前请确认
curl -fsSL https://raw.githubusercontent.com/quarkdown-labs/get-quarkdown/refs/heads/main/install.sh | sudo env "PATH=$PATH" bash
quarkdown c file.qd
硬件要求按 README 说明

README 未说明 CPU/内存/显存要求;仅 PDF 导出需要 Chromium 系浏览器(如 chrome-headless-shell),安装脚本会自动安装该浏览器。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

基于 Markdown 的排版系统,一份源文件可编译成论文、书籍、演示文稿和网站

把 Markdown 扩展成带脚本能力的标记语言,一份源文件可编译成论文、幻灯片、网站、书籍和知识库,省去多套工具切换。

核心能力

  • 在 CommonMark/GFM 基础上扩展出图灵完备的函数语法
  • 支持自定义函数与变量,可复用重复内容为一行调用
  • 单份源文件编译到多种目标格式,含 PDF 导出
  • 提供 -p 预览与 -w 监听实现低延迟实时预览
  • 通过一行代码导入社区包与模板,也可发布自己的

容易踩的坑

安装脚本需 root 权限,会装到 /opt/quarkdown 并把 wrapper 放到 /usr/local/bin;PDF 导出依赖 Chromium 系浏览器,手动安装时需自行准备;多文件项目编译时目标必须是包含其他文件的根文件。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.7.0
  1. v2.7.0最新正式版2026-10-29 · 2026-10-29 06:47 UTC

    This release marks one of Quarkdown's most significant milestones towards becoming a mature, community-driven project!

     

    Added

     

    Packages & package manager

    This release comes with Quarkdown's long-awaited package manager! You can browse the available packages in the new catalog.

    A package, called atom, can be easily included into your document the same way you .include any other local Quarkdown file, with the special syntax @scope/name:version.

    The officially maintained scope, @atoms, is a GitHub-hosted repository anyone can contribute to.

    .include {@atoms/cowsay:1.0.0}
    
    .cowsay {Hello, Quarkdown!}
    

    We can't wait to see your creations!

     

    Project templates from packages

    quarkdown create can now scaffold a project from a template package, via the new --template option:

    quarkdown create --template @atoms/simple-cv:1.0.0
    

     

    Linux-ARM support

    Quarkdown now runs on Linux-aarch64!

    Thanks @maximilianbarg!

     

    Styling options on .row, .column and .grid

    Stack functions now accept the same styling options as .container, such as background, foreground, border, padding, radius and the font options, along with width and height, without relying on container wrapping.

    .row gap:{1cm} width:{12cm} background:{teal} foreground:{white} padding:{12px} radius:{8px}
        A
    
        B
    

     

    Scoped page formatting in slides

    The pages and side parameters of .pageformat, previously available only in paged documents, now also work in slides documents. A scoped format applies its properties to the selected slides only.

    .pageformat pages:{2..3} background:{navy} alignment:{start}
    

     

    Page content padding

    .pageformat accepts a new padding parameter, which adds blank space inside the content area of each page, between its borders and the content.

    .pageformat padding:{1cm} bordercolor:{red}
    

     

    Color building and derivation

    The new .color function builds a color from its red, green, blue and alpha components, each optional, and a base color:

    .var {brand} {red}
    
    .container background:{.brand::color alpha:{0.25}}
    

     

    New boolean operations: and and or

    The new and and or functions combine two boolean values, complementing the existing not.

    .if {.x::islower than:{10}::and {.x::isgreater than:{0}}}
        x is between 0 and 10
    

     

    New collection operation: contains

    The new contains function checks whether a string contains some text, a collection contains an element, or a dictionary contains a key.

    .var {letters}
        - A
        - B
    
    .if {.letters::contains {B}}
        B is in the list
    

     

    New collection operation: withindices

    The new withindices function turns a collection into a dictionary that maps each element's position, starting at 1, to the element itself. This makes numbered iteration straightforward.

    .var {letters}
        - A
        - B
    
    .letters::withindices::foreach
        index letter:
        .index .letter
    

    Output: 1 A 2 B

     

    New collection operations: findfirst and findall

    The new findfirst function returns the first element of a collection that satisfies a condition, o

  2. v2.6.42026-10-09 · 2026-10-09 01:43 UTC
    查看更新说明

    Added

     

    SI units in TeX formulas

    The new built-in latex-siunitx library brings the commands of LaTeX's siunitx package to TeX formulae.

    .include {latex-siunitx}
    
    $ \qty{9.81}{\meter\per\second\squared} $
    

     

    Changed

     

    Faster paged document rendering

    Paged documents now render up to 6x faster in the browser, live preview, and PDF export.

     

    Avoid breaking page inside table rows

    Table rows now avoid page breaks by in paged documents, as long as they fit on one page.

    Thanks @Ethereal49!

     

    Fixed

     

    Documents with many block function calls compile in linear time

    Tokenization of a block-level function call was optimized to be linear rather than quadratic, and more memory-efficient.

     

    Faster loops and custom functions

    Loops like .repeat and .foreach, and custom functions defined via .function, run up to four times faster when their body calls other functions.

     

    Pre-compiled localization

    Every compilation is now a few milliseconds faster, as the built-in stdlib localization table is no longer processed from scratch each time.

     

    Positional page size

    .pageformat {A4} sets the page size again, as it did before page sides and ranges were introduced.


    Sponsors

    Thanks to our sponsors! 🎉

    @vitto4

  3. v2.6.32026-10-01 · 2026-10-01 06:53 UTC
    查看更新说明

    Changed

     

    Faster source tokenization

    Source tokenization is now implemented via scanner rather than regex, making the first stage of compilation up to 5x faster.

     

    Fixed

     

    .tablebyrows accepts dynamically typed rows

    Rows generated dynamically, such as the output of .repeat stored in a variable, can now be used as table rows. Previously, this failed with a type cast error.

    .var {rows}
        .repeat {3}
            index:
            - - Cell .index:A
              - Cell .index:B
    
    .tablebyrows rows:{.rows}
    

     

    CommonMark emphasis correctness

    ***bold italic** still italic* now renders correctly.

     

    Numbered lists past nine items

    A line such as 10. item now correctly starts a new item.

     

    A decorative heading interrupts paragraphs

    #! Heading now closes the preceding paragraph, like regular headings do.

     

    A bare ### line under a heading is its own heading

    A line of hashes with nothing after them used to be absorbed by the heading above it, so it disappeared.

     

    A line of tabs separates paragraphs

    A line containing only tabs now separates paragraphs, as a line containing only spaces always did.

     

    Deeply nested link destinations

    Parentheses in a link destination now balance correctly at any depth.

     

    Multi-line setext headings keep all their lines

    A heading underlined by === or --- that spans several lines used to keep only the last line. The whole text now becomes the heading.

     

    Flat stack usage for block tokenization

    Tokenization of Markdown paragraphs, lists, list items, blockquotes, tables, code, footnotes, and setext headings no longer grows the recursion stack linearly, optimizing resource usage and preventing crashes on small stacks.

     

    REPL prints to console

    Fixed a regression that caused quarkdown repl to write to file rather than to stdout.

     

    Preview runs no longer re-scan libraries

    Preview sessions no longer look for available libraries on each run, slightly improving performance.

     

    PDF export no longer fails when its port is busy

    Fixed a regression that caused PDF export to fail instead of moving on to the next free port, if the current one was busy.


    Sponsors

    Thanks to our sponsors! 🎉

    @vitto4

  4. v2.6.22026-09-22 · 2026-09-22 03:15 UTC
    查看更新说明

    Fixed

     

    Lines of trailing whitespace no longer produce empty code blocks

    A line consisting of 4 or more spaces, immediately after content, is no longer tokenized as an indented code block.

     

    Empty code blocks no longer error out on the browser

    Empty code blocks used to throw a runtime error, which also caused paged documents to break.

     

    [Security] Prevent path traversal (CWE-22)

    [!NOTE] The vulnerability was already unexploitable due to existing Ktor (Quarkdown's server library) security measures, and purely theoretical. This patch prevents any future regressions.

    Prevented path traversal vulnerabilities that could allow attackers to access files outside the intended directory from the live preview endpoint (/live/).

    Thanks to the GitLab Security team for reporting!


    Sponsors

    Thanks to our sponsors! 🎉

    @vitto4

  5. latestDevelopment buildpre-release2025-05-13 · 2025-05-13 22:31 UTC
    查看更新说明

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Table of contents

    1. About
    2. Demo
    3. Editor extensions
    4. Targets
    5. Comparison
    6. Getting started
      1. Installation
      2. Quickstart
      3. Creating a project
      4. Compiling
    7. Mock document
    8. Contributing
    9. Sponsors
    10. Concept
    11. License

     

    About

    Quarkdown is a modern Markdown-based typesetting system designed for versatility. It allows a single project to compile seamlessly into a print-ready book, academic paper, knowledge base, or interactive presentation. All through an incredibly powerful Turing-complete extension of Markdown, ensuring your ideas flow automatically into paper.

     

    Born as an extension of CommonMark and GFM, the Quarkdown Flavor brings functions to Markdown, along with many other syntax extensions.

    This is a function call:

    .somefunction {arg1} {arg2}
        Body argument
    

    Possibilities are unlimited thanks to an ever-expanding repository of packages and templates, and a solid standard library.

    Not enough? You can still define your own functions and variables, all within Markdown. You can even create awesome libraries for everyone to use.

    .function {greet}
        to from:
        **Hello, .to** from .from!
    
    .greet {world} from:{iamgio}
    

    Result: Hello, world from iamgio!

    This out-of-the-box scripting support opens doors to complex and dynamic content that would be otherwise impossible to achieve with vanilla Markdown.

    Combined with live preview, :zap: fast compilation speed and great editor support, Quarkdown simply gets the work done, whether it's an academic paper, book, knowledge base or interactive presentation.

     

     

    In a nutshell, Quarkdown is...

    • Familiar: built on the well-known Markdown syntax, for a flat learning curve
    • Elegant: produces output that matches the quality of industry-leading tools
    • Agent-friendly: comes with a built-in skill for idiomatic fluency of your coding agents (read the eval)
    • Customizable: full control over document layout, aesthetics, and properties
    • Community-driven: import packages and templates with a single line of code, or publish your own
    • Secure by default: a restrictive permission system limits access to system resources
    • Versatile: a single source compiles to multiple targets
    • Reactive: low-latency live previews for rapid iteration. The official wiki (100+ subdocuments) compiles in ~2 seconds
    • Reusable: repeated content can be turned into one-line function calls
    • Easily deployable: set a CD workflow up in under 3 minutes (example)

     



     

    As simple as you expect...

     

    Editor extensions

     

    Targets

    • HTML

      • Plain
        Continuous flow like Notion/Obsidian, perfect for static websites and knowledge management - check out the author's personal website.

      • Paged via paged.js
        Perfect for papers, articles and books - check out the demo document.

      • Slides via reveal.js
        Perfect for interactive presentations.

      • Docs
        Perfect for wikis, technical documentation and large knowledge bases - check out Quarkdown's wiki.

    • PDF

      • All document types and features supported by HTML are also supported when exporting to PDF.
    • Markdown

      • GFM export.
    • Plain text

    The desired document type can be set by calling the .doctype function within the source itself:

    • .doctype {plain} (default)
    • .doctype {paged}
    • .doctype {slides}
    • .doctype {docs}

     

    Comparison

    QuarkdownLaTeXTypstAsciiDocMDX
    Concise and readable:white_check_mark::x::white_check_mark::white_check_mark::white_check_mark:
    Full document control1:white_check_mark::white_check_mark::white_check_mark::x::x:
    Scripting:white_check_mark:Partial:white_check_mark::x::white_check_mark:
    Book/article export:white_check_mark::white_check_mark::white_check_mark::white_check_mark:Third-party
    Presentation export:white_check_mark::white_check_mark::white_check_mark::white_check_mark:Third-party
    Static site export:white_check_mark::x:Experimental:white_check_mark::white_check_mark:
    Docs/wiki export:white_check_mark::x::x::white_check_mark::white_check_mark:
    Learning curve:green_circle::red_circle::orange_circle::green_circle::green_circle:
    TargetsHTML, PDF, MD, TXTPDF, PostScriptHTML, PDFHTML, PDF, ePubHTML
    \tableofcontents
    
    \section{Section}
    
    \subsection{Subsection}
    
    \begin{enumerate}
        \item \textbf{First} item
        \item \textbf{Second} item
    \end{itemize}
    
    \begin{center}
        This text is \textit{centered}.
    \end{center}
    
    \begin{figure}[!h]
        \centering
        \begin{subfigure}[b]
            \includegraphics[width=0.3\linewidth]{img1.png}
        \end{subfigure}
        \begin{subfigure}[b]
            \includegraphics[width=0.3\linewidth]{img2.png}
        \end{subfigure}
        \begin{subfigure}[b]
            \includegraphics[width=0.3\linewidth]{img3.png}
        \end{subfigure}
    \end{figure}
    
    .tableofcontents
    
    # Section
    
    ## Subsection
    
    1. **First** item
    2. **Second** item
    
    .center
        This text is _centered_.
    
    .row alignment:{spacebetween}
        ![Image 1](https://github.com/iamgio/quarkdown/blob/HEAD/img1.png)
    
        ![Image 2](https://github.com/iamgio/quarkdown/blob/HEAD/img2.png)
        
        ![Image 3](https://github.com/iamgio/quarkdown/blob/HEAD/img3.png)
    

     

    Getting started

    Installation

    Install script (Linux/macOS)

    curl -fsSL https://raw.githubusercontent.com/quarkdown-labs/get-quarkdown/refs/heads/main/install.sh | sudo env "PATH=$PATH" bash
    

    Root privileges let the script install Quarkdown into /opt/quarkdown and its wrapper script into /usr/local/bin/quarkdown.
    The browser required for PDF export is installed automatically.

    For more installation options, check out get-quarkdown.

    Homebrew (Linux/macOS)

    brew install quarkdown-labs/quarkdown/quarkdown
    

    Install script (Windows)

    irm https://raw.githubusercontent.com/quarkdown-labs/get-quarkdown/refs/heads/main/install.ps1 | iex
    

    Scoop (Windows)

    scoop bucket add quarkdown https://github.com/quarkdown-labs/scoop-quarkdown; scoop install quarkdown
    

    GitHub Actions

    See setup-quarkdown to easily integrate Quarkdown into your GitHub Actions workflows.

    Manual installation

    Download quarkdown.zip from the latest stable release and unzip it, or build it with gradlew installDist.

    Optionally, adding <install_dir>/bin to your PATH allows you easier access Quarkdown.

    Requirements:

    • (Only for PDF export) A Chromium-family browser, such as chrome-headless-shell. See PDF export for details.

     

    Quickstart

    New user? You'll find everything you need in the Quickstart guide to bring your first document to life!

     

    Creating a project

    quarkdown create [directory] will launch the prompt-based project wizard, making it quicker than ever to set up a new Quarkdown project, with all metadata and initial content already present.

     

    Compiling

    Running quarkdown c file.qd will compile the given file and save the output to file.

    If the project is composed by multiple source files, the target file must be the root one, i.e. the one that includes the other files.

    If you would like to familiarize yourself with Quarkdown instead, quarkdown repl lets you play with an interactive REPL mode.

    Options

    The most commonly used options are:

    • -p or --preview: enables automatic content reloading after compiling.

    • -w or --watch: recompiles the source every time a file from the source directory is changed.

    [!TIP] Combine -p -w to achieve live preview!

    • --pdf: produces a PDF file. Learn more in the wiki's PDF export page.

    For the full list of options, check out the CLI options wiki page.

     


     

    Mock document

     

    Mock, written in Quarkdown, is a comprehensive collection of visual elements offered by the language, making it ideal for exploring and understanding its key features — all while playing and experimenting hands-on with a concrete outcome in the form of pages or slides.

    • The document's source files are available in the mock directory, and can be compiled via quarkdown c mock/main.qd -p.
    • The PDF artifacts generated for all possible theme combinations are available and can be viewed in the generated repo.

    Contributing

    Contributions are welcome! Please check CONTRIBUTING.md to know how contribute via issues or pull requests.

    Sponsors

    A special thanks to all the sponsors who supported this project!

    Concept

    The logo resembles the original Markdown icon, with focus on Quarkdown's completeness, richness of features and customization options, emphasized by the revolving arrow all around the sphere.

    What could be mistaken for a planet is actually a quark or, more specifically, a down quark, an elementary particle that is a major constituent of matter: they give life to every complex structure we know of, while also being one of the lightest objects in existence.

    This is, indeed, the concept Quarkdown is built upon.

    License

    By default, Quarkdown and its modules are licensed under GNU GPLv3, except for modules that include their own LICENSE file: the CLI (quarkdown-cli) and Language Server (quarkdown-lsp) modules and binaries are licensed under GNU AGPLv3.

    Footnotes

    Footnotes

    1. The ability to customize the properties of the document and of its output artifact through the language itself. ↩