From 056db5141a73ca6fd8c3b42d388fb6e6d90c038b Mon Sep 17 00:00:00 2001 From: Matti Pastell Date: Wed, 27 Feb 2019 10:15:56 +0200 Subject: [PATCH] Add option to skip chunks in notebook --- src/config.jl | 1 + src/writers.jl | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/config.jl b/src/config.jl index aeb87a6..7182903 100644 --- a/src/config.jl +++ b/src/config.jl @@ -34,6 +34,7 @@ const defaultParams = :fig_env=> nothing, :out_width=> nothing, :out_height=> nothing, + :skip=>false ) ) #This one can be changed at runtime, initially a copy of defaults diff --git a/src/writers.jl b/src/writers.jl index 956c32c..2b215a1 100644 --- a/src/writers.jl +++ b/src/writers.jl @@ -89,12 +89,15 @@ function convert_doc(doc::WeaveDoc, format::NotebookOutput) end for chunk in doc.chunks + if isa(chunk, DocChunk) push!(cells, Dict("cell_type" => "markdown", "metadata" => Dict(), "source" => [strip(join([repr(c) for c in chunk.content], ""))]) ) + elseif haskey(chunk.options, :skip) && chunk.options[:skip] == "notebook" + continue else push!(cells, Dict("cell_type" => "code",