Skip to content
sinclairtargetPublic

About

A MyST document engine

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

646 Commits

Folders and files

Repository files navigation

Atrus

Reward? I'm sorry but all I have to offer you is... the library on the island of Myst. The books, that are contained there. Feel free to explore.

—Atrus, Myst (1993)

Atrus parses MyST Markdown into the MyST abstract syntax tree. It can render the AST as JSON or as HTML. Other renderers (such as for Typst) might be added in the future.

MyST is a superset of CommonMark, so Atrus is also a CommonMark-compliant Markdown parser and HTML renderer.

Atrus is written in Zig and can be consumed as a Zig package, but also exports a C API.

Disclaimer

Atrus implements the MyST Markdown specification but has no affiliation with the MyST specification authors, Jupyter Book, or Project Jupyter.

Usage

For an example of an application using Atrus as a Zig package, see here. For an example of an application using Atrus via the C API, see Michel and libatrus-go.

Roadmap

Atrus can currently parse the following Markdown document:

# Heading
This is a paragraph, containing `code`, *emphasis*, and **strong** text.

```python This is a regular code block.
def foo():
   pass
```

> This is a blockquote.
>
> > You can nest blockquotes!
> > 
> > Or even put code inside them:
> > 
> > ```zig
> > fn foo() u8 {
> >     return 'a';
> > }
> > ```

## Subheading
Checkout my cool [link][google].

[google]: https://google.com

## Roles
In {abbr}`MyST (Markedly Structured Text)`, you can create abbreviations using
roles.

## Directives
You can also use MyST directives, like this one creating a warning admonition:

```{warning}
This project is in development. It has bugs and is NOT secure!
```

This is exciting!

Much more work remains:

  • Get minimal parser working
  • Set up basic build
  • Set up MyST spec test suite
  • Get basic C API working
  • Expose AST via C API
  • Finish implementing commonmark spec
  • Finish implementing MyST extensions
  • Implement JSON AST parser
  • Add benchmarks
  • Add fuzzing tests
  • Make if faaast. Ditch recursive descent? Data-oriented design?

About

A MyST document engine

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages