From 6db69f97ddf8d48c7b78d049f1e678887ae3748f Mon Sep 17 00:00:00 2001 From: Sogari Date: Sat, 25 Mar 2023 17:17:53 +0100 Subject: [PATCH] Remove empty cells after afmonitions --- src/Literate.jl | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Literate.jl b/src/Literate.jl index 6bdb82e..116d042 100644 --- a/src/Literate.jl +++ b/src/Literate.jl @@ -1036,8 +1036,15 @@ function create_notebook(flavor::PlutoFlavor, chunks, config) write(io, line.second, '\n') # Skip indent end write(io, "\"\"\"\n") + content = String(take!(io)) + uuid = uuid4(content, cellCounter) + cellCounter += 1 + push!(uuids, uuid) + push!(folds, fold) + print(ionb, "# ╔═╡ ", uuid, '\n') + write(ionb, content, '\n') end - content = String(take!(io)) + else # isa(chunk, CodeChunk) for line in chunk.lines write(io, line, '\n') @@ -1056,14 +1063,15 @@ function create_notebook(flavor::PlutoFlavor, chunks, config) foreach(l -> print(io, " ", l, '\n'), eachline(IOBuffer(content))) print(io, "end\n") content = String(take!(io)) + uuid = uuid4(content, cellCounter) + cellCounter += 1 + push!(uuids, uuid) + push!(folds, fold) + print(ionb, "# ╔═╡ ", uuid, '\n') + write(ionb, content, '\n') end end - uuid = uuid4(content, cellCounter) - cellCounter += 1 - push!(uuids, uuid) - push!(folds, fold) - print(ionb, "# ╔═╡ ", uuid, '\n') - write(ionb, content, '\n') + end for (i, uuid) in enumerate(singleChoiceUuids)