Evaluate the code written in your documents with Pandoc and Lua
Go to file
perro tuerto e87d4b1f43 Repo ordering 2023-03-08 19:05:42 -08:00
dist Repo ordering 2023-03-08 19:05:42 -08:00
man Repo ordering 2023-03-08 19:05:42 -08:00
opt Repo ordering 2023-03-08 19:05:42 -08:00
scripts Repo ordering 2023-03-08 19:05:42 -08:00
src Repo ordering 2023-03-08 19:05:42 -08:00
tests Repo ordering 2023-03-08 19:05:42 -08:00
.gitmodules Repo ordering 2023-03-08 19:05:42 -08:00
LICENSE.txt Repo ordering 2023-03-08 19:05:42 -08:00
README.md Repo ordering 2023-03-08 19:05:42 -08:00

README.md

Literate Pandoc

Pandoc is a world famous "swiss-army" document converted. This is because Pandoc is also a document parser. Thanks to this capability, this repo is a Pandoc filter written in Lua for literate and natural programming (LNP), i.e.: "Programming [...] as the process of creating works of literature".

Requirements

Install

Just download this repo:

git clone https://git.cuates.net/perro/literate-pandoc.git

Usage

With Pandoc installed and this repo downloaded, do:

pandoc --lua-filter PATH/TO/literate-pandoc/src/literate.lua -t FORMAT DOC

For example, if DOC is source.md and the output FORMAT is HTML, do:

pandoc --lua-filter PATH/TO/literate-pandoc/src/literate.lua -t html source.md

Manual

Learn how to do LNP here.

Test

Inside this repo, do:

sh scripts/test.sh FORMAT1 FORMAT2

For example, if FORMAT1 is Markdwon and FORMAT2 is HTML, do:

sh tests/test.sh markdown html

For distribution tests, do:

sh scripts/test.sh --dist FORMAT1 FORMAT2

Acknowledgments

This wouldn't be possible without these projects and their collaborators:

  • Pandoc: universal document converter and parser; handles the requirements for LNP.
  • Lua: programming language; enables LNP.
  • Fennel: Lisp dialect with full Lua compatibility; allows to go from LNP to Lisp or Lua.

License

Literate Pandoc is under GPLv3.

Happy hacking :)