Fix extra whitespace in convert_doc

pull/86/head
Matti Pastell 2017-03-13 15:12:59 +02:00
parent 888b732f86
commit 70c850e79e
5 changed files with 32 additions and 4 deletions

View File

@ -115,7 +115,7 @@ function convert_doc(doc::WeaveDoc, format::MarkdownOutput)
output *= "\n" * "```julia"
isempty(chunk.optionstring) || (output *= ";" * chunk.optionstring)
output *= "\n" * lstrip(chunk.content)
output *= "\n```\n"
output *= "```\n"
end
end
@ -133,7 +133,7 @@ function convert_doc(doc::WeaveDoc, format::NowebOutput)
isempty(chunk.optionstring) || (output *= strip(chunk.optionstring))
output *= ">>="
output *= "\n" * lstrip(chunk.content)
output *= "\n@\n"
output *= "@\n"
end
end
@ -151,7 +151,7 @@ function convert_doc(doc::WeaveDoc, format::ScriptOutput)
output *= "\n#+ "
isempty(chunk.optionstring) || (output *= strip(chunk.optionstring))
output *= "\n\n" * lstrip(chunk.content)
output *= "\n\n"
output *= "\n"
end
end
@ -164,4 +164,4 @@ end
function Base.repr(c::InlineCode)
return "`j $(c.content)`"
end
end

View File

@ -9,6 +9,15 @@
"metadata": {},
"execution_count": null
},
{
"outputs": [],
"cell_type": "code",
"source": [
"x = 1:10\nd = Dict(\"Weave\" => \"testing\")\ny = [2, 4 ,8]"
],
"metadata": {},
"execution_count": null
},
{
"outputs": [],
"cell_type": "code",

View File

@ -4,6 +4,13 @@
y= [2, 5, 12]
#+ term=true
x = 1:10
d = Dict("Weave" => "testing")
y = [2, 4 ,8]
#+
x = [12, 10]

View File

@ -3,6 +3,12 @@
y= [2, 5, 12]
```
```julia;term=true
x = 1:10
d = Dict("Weave" => "testing")
y = [2, 4 ,8]
```
```julia
x = [12, 10]
println(y)

View File

@ -3,6 +3,12 @@
y= [2, 5, 12]
@
<<term=true>>=
x = 1:10
d = Dict("Weave" => "testing")
y = [2, 4 ,8]
@
<<>>=
x = [12, 10]
println(y)