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
write(iomd, "; continued = true") write(iomd, "; continued = true")
end end
write(iomd, '\n') write(iomd, '\n')
last_line = ""
for line in chunk.lines for line in chunk.lines
write(iomd, line, '\n') write(iomd, line, '\n')
last_line = line
end
if documenter && REPL.ends_with_semicolon(last_line)
write(iomd, "nothing #hide\n")
end end
write(iomd, codefence.second, '\n') write(iomd, codefence.second, '\n')
end end

12
test/runtests.jl

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

Loading…
Cancel
Save