GitXplorerGitXplorer
M

MDInclude.jl

public
0 stars
1 forks
1 issues

Commits

List of commits on branch master.
Verified
a9fbefdfb89f398802fa955736f95a242399bc55

Merge pull request #6 from MichaelHatherly/license/copyright-to-2024

MMichaelHatherly committed a year ago
Unverified
e37a4376b866fc9711dad2d0ae3be1fb6eb7e69b

docs(license): update copyright year(s)

iinvalid-email-address committed a year ago
Verified
07115c0dbc6926bf10ec3321e735857e0334b62b

Add license date updater action

MMichaelHatherly committed a year ago
Verified
c2f49848ca380ea802a4ba4f645a59e2d9ad4f97

Merge pull request #5 from MichaelHatherly/MichaelHatherly-patch-1

MMichaelHatherly committed a year ago
Verified
60f3913ace208352f06966fc2120563e66e2b8fd

Use Julia `1.10` in CI

MMichaelHatherly committed a year ago
Verified
05a7abce63c59e5d6136c5687426e088639adfe2

Merge pull request #4 from MichaelHatherly/dependabot/github_actions/actions/checkout-4

MMichaelHatherly committed a year ago

README

The README file for this repository.

MDInclude

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.

Installation

pkg> add https://github.com/MichaelHatherly/MDInclude.jl

Usage

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

module MyPackage

using MDInclude

@mdinclude("../README.md")

end

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, "file.md")

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.