Skip to content

aarroyoc/djota

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 3, 2024
5c78c16 · Jan 3, 2024

History

31 Commits
Jan 3, 2024
Jan 5, 2023
Jan 5, 2023
Jan 21, 2023
Mar 17, 2023
Mar 17, 2023
Jan 5, 2023

Repository files navigation

Djota

A Djot implementation in Prolog. Djot is a markup language inspired by Markdown but different design goals. See Beyond Markdown and Design goals of Djot for more information. Learn more about the syntax of Djot here

This is a ISO Prolog implementation of Djot, useful to generate HTML fragments.

Usage

:- use_module(djota).

?- djota(+InputStr, -OutputHtml).

where InputStr is a string in Djot, and OutputHTML unifies with the output HTML corresponding to that file.

Example

Let's render this README with Djota!

:- use_module(djota).
:- use_module(library(dcgs)).
:- use_module(library(pio)).

? - phrase_from_file(seq(Input), "README.md"), djot(Input, HTML), phrase_to_file(seq(HTML), "README.html").

Runs on:

Supported stuff:

  • Paragraphs
  • Inline links
  • Inline images
  • Autolinks
  • Verbatim
  • Emphasis
  • Strong
  • Highlighted
  • Super/subscript
  • Insert/delete
  • Inline attributes
  • Headings
  • Blockquotes
  • Lists
  • Code blocks
  • Thematic breaks
  • Raw blocks
  • Divs
  • Tables