improve type definition of CodeChunk

pull/353/head
Shuhei Kadowaki 2020-05-25 00:29:02 +09:00
parent 3d4f04902c
commit dd0c51b6e5
1 changed files with 18 additions and 17 deletions

View File

@ -25,30 +25,31 @@ struct ChunkOutput
end
mutable struct CodeChunk <: WeaveChunk
content::AbstractString
content::String
number::Int
result_no::Int
start_line::Int
optionstring::AbstractString
optionstring::String
options::Dict{Symbol,Any}
output::AbstractString
rich_output::AbstractString
figures::Vector{AbstractString}
figures::Vector{String}
result::Vector{ChunkOutput}
function CodeChunk(content, number, start_line, optionstring, options)
new(
string(rstrip(content), '\n'), # normalize end of chunk
number,
0,
start_line,
optionstring,
options,
"",
"",
AbstractString[],
ChunkOutput[],
)
end
end
function CodeChunk(content, number, start_line, optionstring, options)
return CodeChunk(
string(rstrip(content), '\n'), # normalize end of chunk)
number,
0,
start_line,
optionstring,
options,
"",
"",
AbstractStringString[],
ChunkOutput[]
)
end
mutable struct DocChunk <: WeaveChunk