Skip to content

Commit 4a06f62

Browse files
committed
whitespace
1 parent 97d5382 commit 4a06f62

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

frontend/editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const from_attribute = (element, name) => {
4242
}
4343
}
4444

45-
const preamble_html_comes_from_url_params = url_params.has("preamble_url")
45+
const preamble_html_comes_from_url_params = url_params.has("preamble_html")
4646

4747
/**
4848
*

src/analysis/is_just_text.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ const md_and_friends = [
55
:getindex,
66
]
77

8-
"""Does the cell only contain md"..." and html"..."?
8+
"""
9+
Does the cell only contain md"..." and html"..."?
910
10-
This is used to run these cells first."""
11+
This means that these cells can run:
12+
- in "Safe Preview" mode
13+
- server-side (while waiting for the notebook process to start)
14+
"""
1115
function is_just_text(topology::NotebookTopology, cell::Cell)::Bool
1216
# https://github.com/fonsp/Pluto.jl/issues/209
1317
node = topology.nodes[cell]

src/evaluation/WorkspaceManager.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function precompile_nbpkg((session, notebook)::SN; io=stdout)::Bool
196196
print(io, "Waiting for notebook process to start... ")
197197
end
198198
workspace = fetch(workspace_task)
199-
not_ready_yet && println(io, "")
199+
not_ready_yet && println(io, "Done. Starting precompilation...")
200200
Malt.isrunning(workspace.worker) || return false
201201

202202
io_writes_channel = Malt.worker_channel(workspace.worker, :(__precomp_io_writes_channel = Channel(10)))

src/notebook/Notebook.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ Base.@kwdef mutable struct Notebook
3232
"Cells are ordered in a `Notebook`, and this order can be changed by the user. Cells will always have a constant UUID."
3333
cells_dict::Dict{UUID,Cell}
3434
cell_order::Vector{UUID}
35+
# cells::Vector{Cell} – you can also use the `.cells` property to get all cells as a vector. This is defined later using a `Base.getproperty` method.
3536

3637
path::String
3738
notebook_id::UUID=uuid1()
39+
# the reactivity information of this notebook
3840
topology::NotebookTopology
41+
42+
# caches used to speed up some operations
3943
_cached_topological_order::TopologicalOrder
4044
_cached_cell_dependencies::Dict{UUID,Dict{String,Any}}=Dict{UUID,Dict{String,Any}}()
4145
_cached_cell_dependencies_source::Union{Nothing,NotebookTopology}=nothing
@@ -50,8 +54,9 @@ Base.@kwdef mutable struct Notebook
5054
# per notebook compiler options
5155
# nothing means to use global session compiler options
5256
compiler_options::Union{Nothing,Configuration.CompilerOptions}=nothing
53-
nbpkg_ctx::Union{Nothing,PkgContext}=nothing
54-
# nbpkg_ctx::Union{Nothing,PkgContext}=PkgCompat.create_empty_ctx()
57+
58+
# package environment management
59+
nbpkg_ctx::Union{Nothing,PkgContext}=nothing # nothing means that the notebook is not (yet) using Pluto's automatic package manager.
5560
nbpkg_ctx_instantiated::Bool=false
5661
nbpkg_restart_recommended_msg::Union{Nothing,String}=nothing
5762
nbpkg_restart_required_msg::Union{Nothing,String}=nothing

src/packages/IOListener.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ Base.@kwdef struct IOListener
1313
end
1414

1515
function trigger(listener::IOListener)
16+
# if there is data...
1617
if !eof(listener.buffer) && isreadable(listener.buffer)
18+
# ...process it and...
1719
newdata = readavailable(listener.buffer)
1820
isempty(newdata) && return
1921
s = String(newdata)
@@ -23,6 +25,7 @@ function trigger(listener::IOListener)
2325
)
2426
new_contents = ANSIEmulation.build_str(listener.ansi_state)
2527

28+
# ...trigger the callback.
2629
listener.callback(new_contents)
2730
end
2831
end
@@ -50,12 +53,14 @@ function stoplistening(listener::IOListener)
5053
end
5154
end
5255

56+
# replace all pkg loading spinner states by the same character. the pluto frontend will make that character spin using CSS magic.
5357
freeze_loading_spinners(s::AbstractString) = replace(s, '' => '', '' => '', '' => '')
5458

55-
phasemessage(iolistener, phase::String) = phasemessage(iolistener.buffer, phase)
59+
"write a text with bold formatting"
5660
function phasemessage(io::IO, phase::String)
5761
ioc = IOContext(io, :color=>true)
5862
printstyled(ioc, "\n$phase...\n"; bold=true)
5963
printstyled(ioc, "===\n"; color=:light_black)
6064
end
65+
phasemessage(iolistener, phase::String) = phasemessage(iolistener.buffer, phase)
6166

0 commit comments

Comments
 (0)