Throughout these notebooks you will notice special comments that start with # ::
, called Margo notes. These are what we call "margin notes," written using the Margo syntax. They provide extra information to applications that are reading and processing Jupyter Notebook files.
Most of the notes used in these notebooks are designed to tell margo_loader
how to handle each cell when importing a notebook.
This reference describes the meaning of each Margo note. To learn how you can make up your own Margo notes for use with margo-tool
or your own custom applications, read the Margo Syntax Primer.ipynb
notebook in this repo.
When the notebook is being imported, this cell and any subsequent cell will be included until a # :: module-stop ::
is encountered or the end of the notebook is reached. This is not necessary before a # :: module-start ::
because all cells are included by default.
# :: start ::
All of the above Margo notes are Margo directives. That is, the have a name, but not associated value. This note is different; it's a Margo assignment. It associates a name with a value.
This one is used to define a notebook's dependencies in requirements.txt
format. The CLI tool margo-tool
is used to extract these values from each notebook and generate a single requirements.txt
file for the entire repository.
The keywords described in this chapter are not part of the core Margo syntax. They're only meaningful to the applications that interpret them. In the next lesson we'll learn about the Margo syntax, which is very minimal.
Check out Margo syntax primer.ipynb.