Skip to content

Commit

Permalink
[new] Support literate Djot files
Browse files Browse the repository at this point in the history
Djot is a markup format that is derived from CommonMark, it's code block
syntax is identical to CommonMark's, so we can support it as a
CommonMark style literate formate by just adding the file extension.
  • Loading branch information
nmccarty committed Feb 21, 2025
1 parent 4e8847b commit 3e9396c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG_NEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ This CHANGELOG describes the merged but unreleased changes. Please see [CHANGELO
with `_builtin.<TAG>` (eg `_builtin.CONS`). This allows the identity optimisation
to optimise conversions between list-shaped things.

* [Djot](https://djot.net/) files can now be compiled as CommonMark style
Literate Idris files.

### Backend changes

#### RefC Backend
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Michael Morgan
Milan Kral
Molly Miller
Mounir Boudia
Nathan McCarty
Nick Drozd
Nicolas Biri
Niklas Larsson
Expand Down
2 changes: 1 addition & 1 deletion docs/source/reference/literate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Each of the following markup is recognised regardless of case:
CommonMark
**********

We treat files with an extension of ``.md`` and ``.markdown`` as CommonMark style literate files.
We treat Markdown files with an extension of ``.md`` or ``.markdown`` and Djot files with an extension of ``.dj`` as CommonMark style literate files.

+ CommonMark source blocks for idris sans options are recognised as visible code blocks::

Expand Down
2 changes: 1 addition & 1 deletion src/Parser/Unlit.idr
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ styleCMark : LiterateStyle
styleCMark = MkLitStyle
[("```idris", "```"), ("~~~idris", "~~~"), ("<!-- idris", "-->")]
Nil
[".md", ".markdown"]
[".md", ".markdown", ".dj"]

export
styleTeX : LiterateStyle
Expand Down

0 comments on commit 3e9396c

Please sign in to comment.