Literate programming via CLI

In this blog post we demonstrate how to do “Literate programming” in Raku via (short) pipelines of Command Line Interface (CLI) scripts.

An alternative of this CLI-based process is to use Mathematica or Jupyter notebooks.

Presentation’s GitHub directory

Video recording

Steps and components

Here is a narration of the diagram above:

  1. Write some text and code in a Markdown file
  2. Weave the Markdown file (i.e. “run it”)
  3. If the woven file the does not have D3.js graphics go to 5
  4. Convert the woven Markdown file into HTML
  5. Examine results
  6. Go to 1
    • Or finish “fiddling with it”

The conversions

The we use the document “” (with Raku code over cryptocurrencies data.)

If no D3.js graphics are specified then we can use the shell command:


If D3.js graphics are specified then we can use the shell command:

file-code-chunks-eval && 
  from-markdown -t html -o out.html && 
  open out.html

Remark: It is instructive to examine “” and compare it with “”.

Remark The code chunks with graphics (using “JavaScript::D3”) have to have the chunk option setting results=asis.

Remark The “JavaScript::D3” commands have to have the option settings format => 'html' and div-id => ....



[AA1] Anton Antonov “Raku Text::CodeProcessing”, (2021), RakuForPrediction at WordPress.

[AA2] Anton Antonov “JavaScript::D3”, (2022), RakuForPrediction at WordPress.

[AA3] Anton Antonov “Further work on the Raku-D3.js translation”, (2022), RakuForPrediction at WordPress.


[AAp1] Anton Antonov, Data::Cryptocurrencies Raku package, (2023). GitHub/antononcube.

[AAp2] Anton Antonov, JavaScript::D3 Raku package, (2022). GitHub/antononcube.

[AAp3] Anton Antonov, Text::CodeProcessing Raku package, (2021). GitHub/antononcube.

[AAp4] Anton Antonov, Markdown::Grammar, (2022). GitHub/antononcube.


One thought on “Literate programming via CLI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s