diff --git a/dev/fileformat/index.html b/dev/fileformat/index.html index 9906e6e..3ff502e 100644 --- a/dev/fileformat/index.html +++ b/dev/fileformat/index.html @@ -4,6 +4,7 @@ # In julia rational numbers can be constructed with the `//` operator. # Lets define two rational numbers, `x` and `y`: +## Define variable x and y x = 1//3 y = 2//5 @@ -14,4 +15,4 @@ z = x + y
In the lines starting with # we can use re
#md # Literate.notebook
#md # Literate.markdown
#md # ```
The lines in the example above would be filtered out in the preprocessing step, unless we are generating a markdown file. When generating a markdown file we would simple remove the leading #md from the lines. Beware that the space after the tag is also removed.
The #src token can also be placed at the end of a line. This is to make it possible to have code lines exclusive to the source code, and not just comment lines. For example, if the source file is included in the test suite we might want to add a @test at the end without this showing up in the outputs:
using Test #src
-@test result == expected_result #srcThe following convenience "macros" are always expanded:
@__NAME__
expands to the name keyword argument to Literate.markdown, Literate.notebook and Literate.script (defaults to the filename of the input file).
@__REPO__ROOT_URL__
expands to https://github.com/$(ENV["TRAVIS_REPO_SLUG"])/blob/master/ and is a convenient way to use when you want to link to files outside the doc-build directory. For example @__REPO__ROOT_URL__src/Literate.jl would link to the source of the Literate module.
@__NBVIEWER_ROOT_URL__
expands to https://nbviewer.jupyter.org/github/$(ENV["TRAVIS_REPO_SLUG"])/blob/gh-pages/$(folder)/ where folder is the folder that Documenter.deploydocs deploys too. This can be used if you want a link that opens the generated notebook in http://nbviewer.jupyter.org/.
@__BINDER_ROOT_URL__
expands to https://mybinder.org/v2/gh/$(ENV["TRAVIS_REPO_SLUG"])/$(branch)?filepath=$(folder)/ where branch/folder is the branch and folder where Documenter.deploydocs deploys too. This can be used if you want a link that opens the generated notebook in https://mybinder.org/. To add a binder-badge in e.g. the HTML output you can use:
[](@__BINDER_ROOT_URL__path/to/notebook.inpynb)