rename writer.jl -> converter.jl

pull/330/head
Shuhei Kadowaki 2020-05-16 00:38:18 +09:00
parent 094ebea6cf
commit 42115e7d52
4 changed files with 8 additions and 18 deletions

View File

@ -305,7 +305,7 @@ include("cache.jl")
include("formatters.jl") include("formatters.jl")
include("format.jl") include("format.jl")
include("pandoc.jl") include("pandoc.jl")
include("writers.jl") include("converter.jl")
export weave, export weave,
list_out_formats, list_out_formats,

View File

@ -1,6 +1,5 @@
using Weave using Weave, Test
using Weave: run_doc using Weave: run_doc
using Test
# TODO: add test for header processsing # TODO: add test for header processsing
@ -27,8 +26,8 @@ mock_doc(str, chunk_parser = Weave.parse_markdown) = Weave.WeaveDoc("dummy", chu
include("test_error_rendering.jl") include("test_error_rendering.jl")
end end
@testset "Conversions" begin @testset "convertions" begin
include("convert_test.jl") include("test_converter.jl")
end end
@testset "Formatters" begin @testset "Formatters" begin

View File

@ -1,5 +1,4 @@
using Weave # TODO: refactor
using Test
function convert_test(outfile, infile="documents/chunk_options.noweb") function convert_test(outfile, infile="documents/chunk_options.noweb")
outfile = joinpath("documents/convert", outfile) outfile = joinpath("documents/convert", outfile)
@ -16,17 +15,9 @@ convert_test("chunk_options.mdw")
convert_test("chunk_options_nb.mdw", "documents/chunk_options.ipynb") convert_test("chunk_options_nb.mdw", "documents/chunk_options.ipynb")
# Separate test for notebook (output depends on julia version) # Separate test for notebook (output depends on julia version)
function contents(chunk::Weave.DocChunk) contents(chunk::Weave.DocChunk) = join([strip(c.content) for c in chunk.content], "")
return join([strip(c.content) for c in chunk.content], "") contents(chunk::Weave.CodeChunk) = chunk.content
end contents(doc::Weave.WeaveDoc) = join([contents(chunk) for chunk in doc.chunks], "")
function contents(chunk::Weave.CodeChunk)
return chunk.content
end
function contents(doc::Weave.WeaveDoc)
return join([contents(chunk) for chunk in doc.chunks], "")
end
outfile = "documents/convert/chunk_options.ipynb" outfile = "documents/convert/chunk_options.ipynb"
infile = "documents/chunk_options.noweb" infile = "documents/chunk_options.noweb"