Skip to content

Commit 52bd3bc

Browse files
authored
Update pluto control.jl
1 parent 165ee8d commit 52bd3bc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/pluto control.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
### What this file does:
2+
# All the functionality of PlutoPages was implemented in a notebook! (The file notebook.jl in this directory.) Because it's fun and easy to develop the package this way, kind of.
3+
#
4+
# But when you import PlutoPages and run PlutoPages.generate(), you don't want to open Pluto in your browser, fill in a path in a TextField, etc. It needs to run that notebook "headless" (no browser), with different values inserted by the user.
5+
# The important value to insert is the "source directory"
6+
# This is what replace_definitions! does. It finds the cell that defines a variable (using PlutoDependencyExplorer.jl), and replaces its code by `const $(name) = $(repr(value))`, and does a reactive run.
7+
#
8+
# And why not just run the notebook.jl like a Julia file? For the one-off site generation that would be fine. But for PlutoPages.develop() this is very cool! Because we can use Pluto's reactivity to update the site when files update, in a fast way.
9+
10+
111
import Pluto: Pluto, PlutoDependencyExplorer
212

313

0 commit comments

Comments
 (0)