Skip to content

Instantly share code, notes, and snippets.

@asyncanup
Created October 7, 2020 04:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asyncanup/b3a216adca411750596942e325a8f589 to your computer and use it in GitHub Desktop.
Save asyncanup/b3a216adca411750596942e325a8f589 to your computer and use it in GitHub Desktop.
literate programming example. run.sh to see it in action
@s
--- dir/bla/yo.py
print("yo")
---
--- dir/blado.py
print("bla")
---
--- lol karo
print("lol")
---
@title Just a Test
@compiler lit -t main.lit && python -m py_compile dir/hello.py
@s Introduction
Hello there
--- dir/hello.py
@{lol karo}
print("hello world")
---
@include another.lit
watch -c -d -n 1 'rm -rf out; mkdir -p out/dir/bla; lit -t --out-dir out main.lit; tree -C out; bat --color=always --style=full out/*.* out/**/*.* 2>/dev/null'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment