|
|
|
@ -312,6 +312,7 @@ function notebook(inputfile, outputdir; preprocess = identity, postprocess = ide |
|
|
|
r"^#jl.*\n?"m => "", |
|
|
|
r"^#jl.*\n?"m => "", |
|
|
|
r".*#jl$\n?"m => "", |
|
|
|
r".*#jl$\n?"m => "", |
|
|
|
r"^#nb "m => "", |
|
|
|
r"^#nb "m => "", |
|
|
|
|
|
|
|
r"```math(.*?)```"s => s"\\begin{equation}\1\\end{equation}", |
|
|
|
] |
|
|
|
] |
|
|
|
content = replace(content, repl) |
|
|
|
content = replace(content, repl) |
|
|
|
end |
|
|
|
end |
|
|
|
@ -321,12 +322,10 @@ function notebook(inputfile, outputdir; preprocess = identity, postprocess = ide |
|
|
|
|
|
|
|
|
|
|
|
# run some Documenter specific things |
|
|
|
# run some Documenter specific things |
|
|
|
if documenter # TODO: safe to do this always? |
|
|
|
if documenter # TODO: safe to do this always? |
|
|
|
## - replace ```math ... ``` with \begin{equation} ... \end{equation} |
|
|
|
|
|
|
|
## - remove documenter style `@ref`s and `@id`s |
|
|
|
## - remove documenter style `@ref`s and `@id`s |
|
|
|
# TODO: remove @docs, @setup etc? Probably not, since these are complete blocks |
|
|
|
# TODO: remove @docs, @setup etc? Probably not, since these are complete blocks |
|
|
|
# and the user can just mark those lines with #md |
|
|
|
# and the user can just mark those lines with #md |
|
|
|
for repl in Pair{Any,Any}[ |
|
|
|
for repl in Pair{Any,Any}[ |
|
|
|
r"```math(.*?)```"s => s"\\begin{equation}\1\\end{equation}", |
|
|
|
|
|
|
|
r"\[(.*?)\]\(@ref\)" => s"\1", |
|
|
|
r"\[(.*?)\]\(@ref\)" => s"\1", |
|
|
|
r"\[(.*?)\]\(@ref .*?\)" => s"\1", |
|
|
|
r"\[(.*?)\]\(@ref .*?\)" => s"\1", |
|
|
|
r"\[(.*?)\]\(@id .*?\)" => s"\1", |
|
|
|
r"\[(.*?)\]\(@id .*?\)" => s"\1", |
|
|
|
|