#parser #markdown

concisemark

A simplified markdown parsing library

6 releases

0.3.1 Dec 14, 2022
0.3.0 Dec 11, 2022
0.2.2 Dec 6, 2022
0.1.1 Nov 27, 2022

#851 in Parser implementations

MIT license

78KB
1.5K SLoC

ConciseMark (documentation)

ConciseMark is a simplified markdown parsing library written in Rust with customization, math supporting in mind. The simplified here means it only supports some common markdown syntax but not full.

Features

  • Latex PDF Generation

    ConciseMark supports you to convert your markdown into xelatex source file, then you can compile it with xelatex command to generate a pretty PDF document.

    Note that to make the generated xelatex source compilable, you have to install the following fonts onto your system

  • markdown meta

    You can put an optional html comment (whose body is in toml format) in the front of your markdown file

      <!---
      title = "Your title"
      subtitle = "Your subtitle"
      date = "2021-10-13 00:00:00"
      authors = ["name <example@gmail.com>"]
      tags = ["demo", "example"]
      -->
    

    This content will be parsed as your page meta, you can use it when rendering latex or html page.

  • codeblock and inline codeblock

  • heading

  • list

  • link

  • image

  • math (Math in HTML is supported by katex)

    Use one syntax such as $a^2 + b^2$ to write inline or display mode math equation.

  • extension

    This is a ConciseMark extension, the format is

      @KEY{VALUE}
    

    It supports the following KEY

    • emoji

      @emoji{smile} will render to 😄.

    • kbd

      @kbd{cmd + f} will render to +f.

    This feature will be exposed to library user in future.

Dependencies

~6–9MB
~209K SLoC