Include markdown files as Julia source code.
Author MichaelHatherly
0 Stars
Updated Last
2 Years Ago
Started In
September 2020


include your markdown files as if they were Julia source files. This package was inspired by the similar package for Jupyter notebooks called NBInclude.jl.


pkg> add


Why not turn your README into the package source! What could go wrong...

module MyPackage

using MDInclude



More seriously though, you can use the macro @mdinclude as you would include from Base or @nbinclude from NBInclude.jl to write your package, or just for writing a once-off script.

Additionally, a mdinclude function is provided so that you can set the Module into which you want to evaluate the code in your markdown file.

mdinclude(MyModule, "")

Custom Evaluation

The parsing and evaluation of markdown files can be customised by providing a "configuration" object as the final argument to either @mdinclude or mdinclude. This can be used to change what is done during each step of parsing and evaluating the file. The following functions provide access points within the parsing and evaluation steps for customisation:

  • markdown(config, path)
  • isvalid(config, node)
  • source(config, node)
  • expression(config, ex)
  • setmodule(config, node, default)
  • capture(f, config)

Read the docstrings for details regarding their use.

Used By Packages

No packages found.