Browse Source

Unescape HTML blocks for notebooks

pull/223/head
Kipton Barros 2 years ago
parent
commit
ea3ff7aeca
  1. 10
      docs/src/documenter.md
  2. 2
      src/Literate.jl

10
docs/src/documenter.md

@ -45,6 +45,16 @@ if we set `documenter = true`: @@ -45,6 +45,16 @@ if we set `documenter = true`:
\int f dx
$$
```
- Whereas Documenter requires HTML blocks to be escaped
````
```@raw html
<tag>...</tag>
```
````
the output to a notebook markdown cell will be raw HTML
```
<tag>...</tag>
```
### [`Literate.script`](@ref):
- Documenter style `@ref`s and `@id` will be removed. This means that you can use

2
src/Literate.jl

@ -184,6 +184,8 @@ function replace_default(content, sym; @@ -184,6 +184,8 @@ function replace_default(content, sym;
# Replace Markdown stdlib math environments
push!(repls, r"```math(.*?)```"s => s"$$\1$$")
push!(repls, r"(?<!`)``([^`]+?)``(?!`)" => s"$\1$")
# Remove Documenter escape sequence around HTML
push!(repls, r"```@raw(\h+)html(.*?)```"s => s"\2")
else # sym === :jl
push!(repls, r"^#(!md|!nb|jl) "m => "") # remove leading #!md, #!nb, and #jl
push!(repls, r" #(!md|!nb|jl)$"m => "") # remove trailing #!md, #!nb, and #jl

Loading…
Cancel
Save