Browse Source

respect semicolon output supression when exporting to Documenter

pull/82/head
KristofferC 6 years ago
parent
commit
cca2c12e52
  1. 5
      src/Literate.jl
  2. 12
      test/runtests.jl

5
src/Literate.jl

@ -408,8 +408,13 @@ function markdown(inputfile, outputdir; preprocess = identity, postprocess = ide @@ -408,8 +408,13 @@ function markdown(inputfile, outputdir; preprocess = identity, postprocess = ide
write(iomd, "; continued = true")
end
write(iomd, '\n')
last_line = ""
for line in chunk.lines
write(iomd, line, '\n')
last_line = line
end
if documenter && REPL.ends_with_semicolon(last_line)
write(iomd, "nothing #hide\n")
end
write(iomd, codefence.second, '\n')
end

12
test/runtests.jl

@ -221,6 +221,9 @@ content = """ @@ -221,6 +221,9 @@ content = """
## Indented comment
end
# Semicolon output supression
1 + 1;
#nb # A notebook cell with special metadata
#nb %% Meta1 {"meta": "data"}
#nb 1+1
@ -279,6 +282,8 @@ const expansion_warning = get(ENV, "HAS_JOSH_K_SEAL_OF_APPROVAL", "") == "true" @@ -279,6 +282,8 @@ const expansion_warning = get(ENV, "HAS_JOSH_K_SEAL_OF_APPROVAL", "") == "true"
# Indented comment
end
1 + 1;
# This file was generated using Literate.jl, https://github.com/fredrikekre/Literate.jl
"""
@ -458,6 +463,13 @@ end @@ -458,6 +463,13 @@ end
end
```
Semicolon output supression
```@example inputfile
1 + 1;
nothing #hide
```
*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*
"""

Loading…
Cancel
Save