GitXplorerGitXplorer
M

MDInclude.jl

public
0 stars
1 forks
1 issues

Commits

List of commits on branch master.
Verified
d7c0a914564937525a104ddd4e95a18fae8b3509

Merge pull request #9 from MichaelHatherly/dependabot/github_actions/codecov/codecov-action-5

MMichaelHatherly committed 2 months ago
Verified
fa5551a0e51dc7c4852c33b2a2c0dcb95b3f2a14

Bump codecov/codecov-action from 4 to 5

ddependabot[bot] committed 2 months ago
Verified
f9f72910b74e618f64aecc9ca6b2acf613fb3d24

Merge pull request #8 from MichaelHatherly/dependabot/github_actions/julia-actions/setup-julia-2

MMichaelHatherly committed 10 months ago
Verified
e000ba7af165d91237bcf56be23ffc37afc5c49e

Bump julia-actions/setup-julia from 1 to 2

ddependabot[bot] committed 10 months ago
Verified
7803556a73c7ab5098ed57e82ae90846682df0c0

Merge pull request #7 from MichaelHatherly/dependabot/github_actions/codecov/codecov-action-4

MMichaelHatherly committed a year ago
Verified
c24829311195b151851fae306d842c18b07cdbb6

Bump codecov/codecov-action from 3 to 4

ddependabot[bot] 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.