From 77dcb96986a5a6830bd2663f647d779e2c6ed614 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Mon, 16 Apr 2018 14:18:47 +0200 Subject: [PATCH] ditch the at-__NAME__ variable --- src/Examples.jl | 6 ------ test/example.jl | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 test/example.jl diff --git a/src/Examples.jl b/src/Examples.jl index 0dee683..55887da 100644 --- a/src/Examples.jl +++ b/src/Examples.jl @@ -121,13 +121,11 @@ function script(inputfile, outputdir; preprocess = identity, postprocess = ident ## - remove #md lines ## - remove #nb lines ## - remove leading and trailing #jl - ## - replace @__NAME__ for repl in Pair{Any,Any}[ r"^#md.*\n?"m => "", r"^#nb.*\n?"m => "", r"^#jl "m => "", r" #jl$"m => "", - "@__NAME__" => name, ] content = replace(content, repl) end @@ -203,13 +201,11 @@ function markdown(inputfile, outputdir; preprocess = identity, postprocess = ide ## - remove #nb lines ## - remove leading and trailing #jl lines ## - remove leading #md - ## - replace @__NAME__ for repl in Pair{Any,Any}[ r"^#nb.*\n?"m => "", r"^#jl.*\n?"m => "", r".*#jl$\n?"m => "", r"^#md "m => "", - "@__NAME__" => name, ] content = replace(content, repl) end @@ -306,14 +302,12 @@ function notebook(inputfile, outputdir; preprocess = identity, postprocess = ide ## - remove #md lines ## - remove leading and trailing #jl lines ## - remove leading #nb - ## - replace @__NAME__ ## - replace ```math ... ``` with \begin{equation} ... \end{equation} for repl in Pair{Any,Any}[ r"^#md.*\n?"m => "", r"^#jl.*\n?"m => "", r".*#jl$\n?"m => "", r"^#nb "m => "", - "@__NAME__" => name, ] content = replace(content, repl) end diff --git a/test/example.jl b/test/example.jl new file mode 100644 index 0000000..c427b43 --- /dev/null +++ b/test/example.jl @@ -0,0 +1,6 @@ +#' # Examples.jl +#' +#' This file is an example of how to write an input file for Examples.jl. +#' The file will be used to render a markdown file, a notebook +1 + 1 +