Browse Source

add docs example for compound filtering for markdown admonitions

pull/115/head
Louis Kaplan 6 years ago
parent
commit
f9c04800de
  1. 20
      docs/src/tips.md

20
docs/src/tips.md

@ -39,3 +39,23 @@ HTML formats. @@ -39,3 +39,23 @@ HTML formats.
img = plot(...)
img = DisplayAs.Text(DisplayAs.PNG(img))
```
### [Adding admonitions using compound line filtering](@id admonitions-md)
Admonitions are a useful feature for drawing attention to particular elements of
documentation. They are [documented in Documenter.jl](https://juliadocs.github.io/Documenter.jl/stable/showcase/#Basic-Markdown-1) and an example of their use can be seen above in the blue 'note' box.
They are parsed by Documenter.jl from markdown but their syntax is not parsed
by Julia scripts or notebooks so we need to use the `#md` line filter when
constructing admonitions from `.jl` source files sent to Literate.jl. For example:
```julia
#md # !!! note "Be aware!"
#md # This a note style admonition!
```
It is important to note that both `#md` and the second `#` are required. Literate.jl
interprets the first `#md` as a markdown exclusive line, and then strips it out. The
second `#` tells Literate.jl that the line should be parsed as markdown and not a
Julia code block. If you only include `#md` and not the second `#` then it will
be parsed into Julia example block in the final documentation and not an actual
admonition.
Loading…
Cancel
Save