-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexport_md.jl
More file actions
26 lines (24 loc) · 808 Bytes
/
export_md.jl
File metadata and controls
26 lines (24 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using Pluto
notebook_path = joinpath(@__DIR__, "scenes.jl")
isfile(notebook_path)
options = Pluto.Configuration.from_flat_kwargs(; project=@__DIR__)
s = Pluto.ServerSession()
nb = Pluto.SessionActions.open(s, notebook_path; run_async=false)
open(joinpath(@__DIR__, "tutorials", "scenes.md"), "w") do io
for (i, c) in enumerate(nb.cells)
if startswith(c.code, "md\"\"\"")
md = join(split(c.code, "\n")[2:end-1], "\n")
println(io, md)
else
println(io, """
\\begin{examplefigure}{}
```julia
""")
println(io, c.code)
println(io, """
```
\\end{examplefigure}
""")
end
end
end