Last active
May 19, 2017 10:04
-
-
Save mortenpi/4c4b50362bf22561524d884f5d9e5289 to your computer and use it in GitHub Desktop.
Work around the world counter issue in Documenter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Expanders.jl b/src/Expanders.jl | |
index 484622f..f7025f4 100644 | |
--- a/src/Expanders.jl | |
+++ b/src/Expanders.jl | |
@@ -471,11 +471,7 @@ function Selectors.runner(::Type{ExampleBlocks}, x, page, doc) | |
# Splice the input and output into the document. | |
content = [] | |
input = droplines(x.code) | |
- | |
- # Special-case support for displaying SVG graphics. TODO: make this more general. | |
- output = mimewritable(MIME"image/svg+xml"(), result) ? | |
- Documents.RawHTML(stringmime(MIME"image/svg+xml"(), result)) : | |
- Markdown.Code(Documenter.DocChecks.result_to_string(buffer, result)) | |
+ output = Base.invokelatest(get_output, result, buffer) | |
# Only add content when there's actually something to add. | |
isempty(input) || push!(content, Markdown.Code("julia", input)) | |
@@ -484,6 +480,15 @@ function Selectors.runner(::Type{ExampleBlocks}, x, page, doc) | |
page.mapping[x] = Markdown.MD(content) | |
end | |
+function get_output(result, buffer) | |
+ # Special-case support for displaying SVG graphics. TODO: make this more general. | |
+ if mimewritable(MIME"image/svg+xml"(), result) | |
+ Documents.RawHTML(stringmime(MIME"image/svg+xml"(), result)) | |
+ else | |
+ Markdown.Code(Documenter.DocChecks.result_to_string(buffer, result)) | |
+ end | |
+end | |
+ | |
# @repl | |
# ----- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment