Browse Source

add a little note at the bottom of the page

pull/5/head
Fredrik Ekre 8 years ago
parent
commit
7cea759377
  1. 13
      src/Literate.jl
  2. 10
      test/runtests.jl

13
src/Literate.jl

@ -121,6 +121,19 @@ function replace_default(content, sym; @@ -121,6 +121,19 @@ function replace_default(content, sym;
)
repls = Pair{Any,Any}[]
# add some shameless advertisement
if sym === :jl
content *= """
#-
# This file was generated using Literate.jl, https://github.com/fredrikekre/Literate.jl
"""
else
content *= """
#-
#' *This $(sym === :md ? "page" : "notebook") was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*
"""
end
push!(repls, "\r\n" => "\n") # normalize line endings
if sym === :md

10
test/runtests.jl

@ -209,6 +209,8 @@ content = """ @@ -209,6 +209,8 @@ content = """
# PLACEHOLDER3
# PLACEHOLDER4
# This file was generated using Literate.jl, https://github.com/fredrikekre/Literate.jl
"""
script = read(joinpath(outdir, "inputfile.jl"), String)
@test script == expected_script
@ -319,6 +321,8 @@ end @@ -319,6 +321,8 @@ end
\\int f(x) dx
```
*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*
"""
markdown = read(joinpath(outdir, "inputfile.md"), String)
@test markdown == expected_markdown
@ -465,6 +469,12 @@ end @@ -465,6 +469,12 @@ end
"\\\\int f(x) dx\\n",
"\\\\end{equation}"
]
""",
"""
"source": [
"*This notebook was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*"
]
"""))
notebook = read(joinpath(outdir, "inputfile.ipynb"), String)

Loading…
Cancel
Save