From e7550f3f512b8399e10be7aff60d2be18ccd22b1 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Sat, 10 Aug 2024 15:56:40 +0200 Subject: [PATCH] Use PlutoPages.jl package --- .github/workflows/generate.yml | 9 +- PlutoPages.jl | 1087 -------------------- develop.jl | 122 +-- generate.jl | 28 - pluto-deployment-environment/Manifest.toml | 144 +-- pluto-deployment-environment/Project.toml | 1 + 6 files changed, 81 insertions(+), 1310 deletions(-) delete mode 100644 PlutoPages.jl delete mode 100644 generate.jl diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 0ce0225..11d5b0f 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -40,10 +40,11 @@ jobs: - name: 🪴 Generate site run: julia --project=pluto-deployment-environment -e ' - import Pkg; - Pkg.instantiate(); - - include("./generate.jl") + import Pkg + Pkg.instantiate() + import PlutoPages + + PlutoPages.generate("."; html_report_path="generation_report.html") cp("./netlify.toml", "./_site/netlify.toml")' diff --git a/PlutoPages.jl b/PlutoPages.jl deleted file mode 100644 index 6d81ec5..0000000 --- a/PlutoPages.jl +++ /dev/null @@ -1,1087 +0,0 @@ -### A Pluto.jl notebook ### -# v0.19.41 - -using Markdown -using InteractiveUtils - -# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). -macro bind(def, element) - quote - local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end - local el = $(esc(element)) - global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el) - el - end -end - -# ╔═╡ b8024c95-6a63-4409-9c75-9bad6b301a92 -begin - import Pkg - Pkg.activate("./pluto-deployment-environment") - - import PlutoSliderServer - import Pluto - using MarkdownLiteral -end - -# ╔═╡ d4cfce05-bae4-49ae-b26d-ce27171a3853 -using PlutoUI - -# ╔═╡ ce840b47-8406-48e6-abfb-1b00daab28dd -using HypertextLiteral - -# ╔═╡ 7c53c1e3-6ccf-4804-8bc3-09126036608e -using PlutoHooks - -# ╔═╡ 725cb996-68ac-4736-95ee-0a9754867bf3 -using BetterFileWatching - -# ╔═╡ 9d996c55-0e37-4ae9-a6a2-8c8761e8c6db -using PlutoLinks - -# ╔═╡ c5a0b072-7f49-4c0c-855e-773cfc03d308 -TableOfContents(include_definitions=true) - -# ╔═╡ 644552c6-4e32-4caf-90ef-bee259977094 -import Logging - -# ╔═╡ 66c97351-2294-4ac2-a93a-f334aaee8f92 -import Gumbo - -# ╔═╡ bcbda2d2-90a5-43e6-8400-d5472578f86a -import ProgressLogging - -# ╔═╡ cd576da6-59ae-4d1b-b812-1a35023b6875 -import ThreadsX - -# ╔═╡ 86471faf-af03-4f35-8b95-c4011ceaf7c3 -function progressmap_generic(mapfn, f, itr; kwargs...) - l = length(itr) - id = gensym() - num_iterations = Threads.Atomic{Int}(0) - - function log(x) - Threads.atomic_add!(num_iterations, x) - Logging.@logmsg(ProgressLogging.ProgressLevel, "", progress=num_iterations[] / l, id=id) - end - - log(0) - - output = mapfn(enumerate(itr); kwargs...) do (i,x) - result = f(x) - log(1) - result - end - - log(0) - output -end - -# ╔═╡ e0ae20f5-ffe7-4f0e-90be-168924526e03 -"Like `Base.map`, but with ProgressLogging." -function progressmap(f, itr) - progressmap_generic(map, f, itr) -end - -# ╔═╡ d58f2a89-4631-4b19-9d60-5e590908b61f -"Like `Base.asyncmap`, but with ProgressLogging." -function progressmap_async(f, itr; kwargs...) - progressmap_generic(asyncmap, f, itr; kwargs...) -end - -# ╔═╡ 2221f133-e490-4e3a-82d4-bd1c6c979d1c -"Like `ThreadsX.map`, but with ProgressLogging." -function progressmap_threaded(f, itr; kwargs...) - progressmap_generic(ThreadsX.map, f, itr; kwargs...) -end - -# ╔═╡ 6c8e76ea-d648-449a-89de-cb6632cdd6b9 -md""" -# Template systems - -A **template** system is will turn an input file (markdown, julia, nunjucks, etc.) into an (HTML) output. This architecture is based on [eleventy](https://www.11ty.dev/docs/). - -To register a template handler for a file extension, you add a method to `template_handler`, e.g. - -```julia -function template_handler( - ::Val{Symbol(".md")}, - input::TemplateInput -)::TemplateOutput - - s = String(input.contents) - result = run_markdown(s) - - return TemplateOutput(; - contents=result.contents, - front_matter=result.front_matter, - ) -end -``` - -See `TemplateInput` and `TemplateOutput` for more info! -""" - -# ╔═╡ 4a2dc5a4-0bf2-4678-b984-4ecb7b397d72 -md""" -## `.jlhtml`: HypertextLiteral.jl -""" - -# ╔═╡ b3ce7742-fb47-4c17-bac2-e6a7710eb1a1 -md""" -## `.md` and `.jlmd`: MarkdownLiteral.jl -""" - -# ╔═╡ f4a4b741-8028-4626-9187-0b6a52f062b6 -import CommonMark - -# ╔═╡ 535efb29-73bd-4e65-8bbc-18b72ae8fe1f -import YAML - -# ╔═╡ 90f0c676-b33f-441c-8ea6-d59c44a11547 -s_example = raw""" ---- -title: "Hello worfdsld!" -description: "A longer description of the same thing" -authors: ["Fonsi"] ---- - -### Hello there! - -My name is fons - - - -Want to embed some cool HTML? *Easy!* Just type the HTML! **or markdown**, it's all the same!! 👀 - -```math -\\sqrt{\\frac{1}{2}} -```` - -$(begin -a = 1 -b = 2 -export b -end) - -""" - -# ╔═╡ 5381e8b3-d4f9-4e58-8da3-f1ee0a9b7a6d -@bind s TextField((70,20); default=s_example) - -# ╔═╡ 08b42df7-9120-4b42-80ee-8e438752b50c -# s_result.exported - -# ╔═╡ adb1ddac-d992-49ca-820f-e1ed8ca33bf8 -md""" -## `.jl`: PlutoSliderServer.jl -""" - -# ╔═╡ bb905046-59b7-4da6-97ad-dbb9055d823a -const pluto_deploy_settings = PlutoSliderServer.get_configuration(PlutoSliderServer.default_config_path()) - -# ╔═╡ b638df55-fd74-4ae8-bdbd-ec7b18214b40 -function prose_from_code(s::String)::String - replace(replace( - replace( - replace(s, - # remove embedded project/manifest - r"000000000001.+"s => ""), - # remove cell delimiters - r"^# [╔╟╠].*"m => ""), - # remove some code-only punctiation - r"[\!\#\$\*\+\-\/\:\;\<\>\=\(\)\[\]\{\}\:\@\_]" => " "), - # collapse repeated whitespace - r"\s+"s => " ") -end - -# ╔═╡ 87b4431b-438b-4da4-9d06-79e7f3a2fe05 -prose_from_code(""" -[xs for y in ab(d)] -fonsi -""") - -# ╔═╡ cd4e479c-deb7-4a44-9eb0-c3819b5c4067 -find(f::Function, xs) = for x in xs - if f(x) - return x - end -end - -# ╔═╡ 2e527d04-e4e7-4dc8-87e6-8b3dd3c7688a -const FrontMatter = Dict{String,Any} - -# ╔═╡ a166e8f3-542e-4068-a076-3f5fd4daa61c -Base.@kwdef struct TemplateInput - contents::Vector{UInt8} - relative_path::String - absolute_path::String - frontmatter::FrontMatter=FrontMatter() -end - -# ╔═╡ 6288f145-444b-41cb-b9e3-8f273f9517fb -begin - Base.@kwdef struct TemplateOutput - contents::Union{Vector{UInt8},String,Nothing} - file_extension::String="html" - frontmatter::FrontMatter=FrontMatter() - search_index_data::Union{Nothing,String}=nothing - end - TemplateOutput(t::TemplateOutput; kwargs...) = TemplateOutput(; - contents=t.contents, - file_extension=t.file_extension, - frontmatter=t.frontmatter, - search_index_data=t.search_index_data, - kwargs..., - ) -end - -# ╔═╡ ff55f7eb-a23d-4ca7-b428-ab05dcb8f090 -# fallback method -function template_handler(::Any, input::TemplateInput)::TemplateOutput - TemplateOutput(; - contents=nothing, - file_extension="nothing", - ) -end - -# ╔═╡ 692c1e0b-07e1-41b3-abcd-2156bda65b41 -""" -Turn a MarkdownLiteral.jl string into HTML contents and front matter. -""" -function run_mdx(s::String; - data::Dict{String,<:Any}=Dict{String,Any}(), - cm::Bool=true, - filename::AbstractString="unknown", - ) - # take a look at https://github.com/JuliaPluto/MarkdownLiteral.jl if you want to use it this too! - - # Just HTL, CommonMark parsing comes in a later step - code = "@htl(\"\"\"$(s)\"\"\")" - - m = Module() - Core.eval(m, :(var"@mdx" = var"@md" = $(MarkdownLiteral.var"@mdx"))) - Core.eval(m, :(var"@htl" = $(HypertextLiteral.var"@htl"))) - # Core.eval(m, :(setpage = $(setpage))) - Core.eval(m, :(using Markdown, InteractiveUtils)) - for (k,v) in data - Core.eval(m, :($(Symbol(k)) = $(v))) - end - - result = Base.include_string(m, code, filename) - - to_render, frontmatter = if !cm - result, FrontMatter() - else - - # we want to apply our own CM parser, so we do the MarkdownLiteral.jl trick manually: - result_str = repr(MIME"text/html"(), result) - cm_parser = CommonMark.Parser() - CommonMark.enable!(cm_parser, [ - CommonMark.AdmonitionRule(), - CommonMark.AttributeRule(), - CommonMark.AutoIdentifierRule(), - CommonMark.CitationRule(), - CommonMark.FootnoteRule(), - CommonMark.MathRule(), - CommonMark.RawContentRule(), - CommonMark.TableRule(), - CommonMark.TypographyRule(), - # TODO: allow Julia in front matter by using Meta.parse as the TOML parser? - # but you probably want to be able to use those variables inside the document, so they have to be evaluated *before* running the expr. - CommonMark.FrontMatterRule(yaml=YAML.load), - ]) - - ast = cm_parser(result_str) - - ast, CommonMark.frontmatter(ast) - end - - contents = repr(MIME"text/html"(), to_render) - - # TODO: might be nice: - # exported = filter(names(m; all=false, imported=false)) do s - # s_str = string(s) - # !(startswith(s_str, "#") || startswith(s_str, "anonymous")) - # end - - (; - contents, - frontmatter, - # exported, - ) -end - -# ╔═╡ 7717e24f-62ee-4852-9dec-d09b734d0693 -s_result = run_mdx(s; data=Dict("num" => 3)); - -# ╔═╡ 9f945292-ff9e-4f29-93ea-69b10fc4428d -s_result.contents |> HTML - -# ╔═╡ 83366d96-4cd3-4def-a0da-16a22b40124f -s_result.frontmatter - -# ╔═╡ 94bb6730-a4ad-42d2-aa58-41b70a15cd0e -md""" -## `.css`, `.html`, `.js`, `.png`, etc: passthrough - -""" - -# ╔═╡ e15cf987-3615-4e96-8ccd-04cad3bcd48e -function template_handler(::Union{ - Val{Symbol(".css")}, - Val{Symbol(".html")}, - Val{Symbol(".js")}, - Val{Symbol(".png")}, - Val{Symbol(".svg")}, - Val{Symbol(".gif")}, - Val{Symbol(".json")}, - }, input::TemplateInput)::TemplateOutput - - TemplateOutput(; - contents=input.contents, - file_extension=lstrip(isequal('.'), splitext(input.relative_path)[2]), - ) -end - -# ╔═╡ 940f3995-1739-4b30-b8cf-c27a671043e5 -md""" -## Generated assets -""" - -# ╔═╡ 5e91e7dc-82b6-486a-b745-34f97b6fb20c -struct RegisteredAsset - url::String - relative_path::String - absolute_path::String -end - -# ╔═╡ 8f6393a4-e945-4f06-90f6-0a71f874c8e9 -import SHA - -# ╔═╡ 4fcdd524-86a8-4033-bc7c-4a7c04224eeb -import Unicode - -# ╔═╡ 070c710d-3746-4706-bd03-b5b00a576007 -function myhash(data) - s = SHA.sha256(data) - string(reinterpret(UInt32, s)[1]; base=16, pad=8) -end - -# ╔═╡ a5c22f80-58c7-4c63-95b8-ecb30bc896d0 -myhash(rand(UInt8, 50)) - -# ╔═╡ 750782a1-3aeb-4816-8f6a-ec31055373c1 -legalize(filename) = replace( - Unicode.normalize( - replace(filename, " " => "_"); - stripmark=true) - , r"[^\w-]" => "") - -# ╔═╡ f6b89b8c-3750-4dd2-940e-579be953c1c2 -legalize(" ëasdfa sd23__--f//asd f?\$%^&*() .") - -# ╔═╡ 29a81ad7-3803-4b7a-98ca-6e5b1077e1c7 -md""" -# Input folder -""" - -# ╔═╡ c52c9786-a25f-11ec-1fdc-9b13922d7ccb -const dir = joinpath(@__DIR__, "src") - -# ╔═╡ cf27b3d3-1689-4b3a-a8fe-3ad639eb2f82 -md""" -## File watching -""" - -# ╔═╡ 7f7f1981-978d-4861-b840-71ab611faf74 -@bind manual_update_trigger Button("Read input files again") - -# ╔═╡ e1a87788-2eba-47c9-ab4c-74f3344dce1d -ignored_dirname(s; allow_special_dirs::Bool=false) = - startswith(s, "_") && (!allow_special_dirs || s != "_includes") - -# ╔═╡ 485b7956-0774-4b25-a897-3d9232ef8590 -const this_file = split(@__FILE__, "#==#")[1] - -# ╔═╡ d38dc2aa-d5ba-4cf7-9f9e-c4e4611a57ac -function ignore(abs_path; allow_special_dirs::Bool=false) - p = relpath(abs_path, dir) - - # (_cache, _site, _andmore) - any(x -> ignored_dirname(x; allow_special_dirs), splitpath(p)) || - startswith(p, ".git") || - startswith(p, ".vscode") || - abs_path == this_file -end - -# ╔═╡ 8da0c249-6094-49ab-9e59-d6e356818651 -dir_changed_time = let - valx, set_valx = @use_state(time()) - - @info "Starting watch task" - - @use_task([dir]) do - BetterFileWatching.watch_folder(dir) do e - @debug "File event" e - try - is_caused_by_me = all(x -> ignore(x; allow_special_dirs=true), e.paths) - - if !is_caused_by_me - @info "Reloading!" e - set_valx(time()) - end - catch e - @error "Failed to trigger" exception=(e,catch_backtrace()) - end - end - end - - valx -end - -# ╔═╡ 7d9cb939-da6b-4961-9584-a905ad453b5d -allfiles = filter(PlutoSliderServer.list_files_recursive(dir)) do p - # reference to retrigger when files change - dir_changed_time - manual_update_trigger - - !ignore(joinpath(dir, p)) -end - -# ╔═╡ d314ab46-b866-44c6-bfca-9a413bc06514 -md""" -# Output folder generation -""" - -# ╔═╡ e01ebbab-dc9a-4aaf-ae16-200d171fcbd9 -const output_dir = mkpath(joinpath(@__DIR__, "_site")) - -# ╔═╡ 37b2cecc-e4c7-4b80-b7d9-71c68f3c0339 - - -# ╔═╡ 7a95681a-df77-408f-919a-2bee5afd7777 -""" -This directory can be used to store cache files that are persisted between builds. Currently used as PlutoSliderServer.jl cache. -""" -const cache_dir = mkpath(joinpath(@__DIR__, "_cache")) - -# ╔═╡ f3d225b8-b9a5-4639-97eb-7785b1a78f5a -md""" -## Running a dev web server -""" - -# ╔═╡ c3a495c1-3e1f-42a1-ac08-8dc0b9175fe9 -# import Deno_jll - -# ╔═╡ 3b2d1919-41d9-4bba-9774-c8497bba5003 -# dev_server_port = 4507 - -# ╔═╡ 6f7f66e8-ed10-4cc4-8672-a06861111aec -# dev_server_url = "http://localhost:$(dev_server_port)/" - -# ╔═╡ d09ee809-33d8-44f8-aa7a-be4b3fdc21eb - - -# ╔═╡ a0a80dce-2199-45b6-b4e9-d4168f520c85 -# @htl("
Go to $(dev_server_url) to preview the site.
") - -# ╔═╡ 4e88cf07-8d85-4327-b310-6c71ba951bba -md""" -## Running the templates - -(This can take a while if you are running this for the first time with an empty cache.) -""" - -# ╔═╡ f700357f-e21c-4d23-b56c-be4f9c90465f -const NUM_PARALLEL_WORKERS = 4 - -# ╔═╡ aaad71bd-5425-4783-952c-82e4d4fa7bb8 -md""" -## URL generation -""" - -# ╔═╡ 76c2ac85-2e89-4396-a498-a4ceb1cc80bd -Base.@kwdef struct Page - url::String - full_url::String - input::TemplateInput - output::TemplateOutput -end - -# ╔═╡ a510857f-528b-43e8-be78-69e554d165a6 -function short_url(s::String) - a = replace(s, r"index.html$" => "") - isempty(a) ? "." : a -end - -# ╔═╡ 1c269e16-65c7-47ae-aeab-001f1b205e14 -ishtml(output::TemplateOutput) = output.file_extension == "html" - -# ╔═╡ 898eb093-444c-45cf-88d7-3dbe9708ae31 -function final_url(input::TemplateInput, output::TemplateOutput)::String - if ishtml(output) - # Examples: - # a/b.jl -> a/b/index.html - # a/index.jl -> a/index.html - - in_dir, in_filename = splitdir(input.relative_path) - in_name, in_ext = splitext(in_filename) - - if in_name == "index" - joinpath(in_dir, "index.html") - else - joinpath(in_dir, in_name, "index.html") - end - else - ext = lstrip(isequal('.'), output.file_extension) - join((splitext(input.relative_path)[1], ".", ext)) - end -end - -# ╔═╡ 76193b12-842c-4b82-a23e-fb7403274234 -md""" -## Collections from `tags` -""" - -# ╔═╡ 4f563136-fc7b-4322-92ba-78c0183c40cc -struct Collection - tag::String - pages::Vector{Page} -end - -# ╔═╡ 41ab51f9-0b33-4548-b08a-ad1ef7d38f1b -function sort_by(p::Page) - bn = basename(p.input.relative_path) - order_val = get(p.output.frontmatter, "order", nothing) - order = something(order_val isa String ? tryparse(Float64, order_val) : order_val, Inf) - - return ( - order, - splitext(bn)[1] != "index", - # TODO: sort based on dates if we ever need that - bn, - ) -end - -# ╔═╡ b0006e61-b037-41ed-a3e4-9962d15584c4 -md""" -## Layouts -""" - -# ╔═╡ f2fbcc70-a714-4eda-8786-7ee5692e3268 -with_doctype(p::Page) = Page(p.url, p.full_url, p.input, with_doctype(p.output)) - -# ╔═╡ 57fd383b-d791-4170-a353-f839356f9d7a -with_doctype(output::TemplateOutput) = if ishtml(output) && output.contents !== nothing - TemplateOutput(output; - contents="" * String(output.contents) - ) -else - output -end - -# ╔═╡ 05f735e0-01cc-4276-a3f9-8420296e68be -md""" -## Search index -""" - -# ╔═╡ 6460cf11-ae78-47e3-9ac1-649295e76ddc -md""" -## `pluto_export.json` -We generate a [ `pluto_export.json` just like PSS.jl](https://github.com/JuliaPluto/PlutoSliderServer.jl/pull/68). -""" - -# ╔═╡ 1a303aa4-bed5-4d9b-855c-23355f4a88fe -md""" -## Writing to the output directory -""" - -# ╔═╡ 834294ff-9441-4e71-b5c0-edaf32d860ee -import JSON - -# ╔═╡ eef54261-767a-4ce4-b549-0b1828379f7e -SafeString(x) = String(x) - -# ╔═╡ cda8689d-9ae5-42c4-8e7e-715cf44c33bb -SafeString(x::Vector{UInt8}) = String(copy(x)) - -# ╔═╡ 995c6810-8df2-483d-a87a-2277af0d43bd -function template_handler( - ::Union{Val{Symbol(".jlhtml")}}, - input::TemplateInput)::TemplateOutput - s = SafeString(input.contents) - result = run_mdx(s; - data=input.frontmatter, - cm=false, - filename=input.absolute_path, - ) - - return TemplateOutput(; - contents=result.contents, - search_index_data=Gumbo.text(Gumbo.parsehtml(result.contents).root), - frontmatter=result.frontmatter, - ) -end - -# ╔═╡ 7e86cfc7-5439-4c7a-9c3b-381c776d8371 -function template_handler( - ::Union{ - Val{Symbol(".jlmd")}, - Val{Symbol(".md")} - }, - input::TemplateInput)::TemplateOutput - s = SafeString(input.contents) - result = run_mdx(s; - data=input.frontmatter, - filename=input.absolute_path, - ) - - return TemplateOutput(; - contents=result.contents, - search_index_data=Gumbo.text(Gumbo.parsehtml(result.contents).root), - frontmatter=result.frontmatter, - ) -end - -# ╔═╡ 4013400c-acb4-40fa-a826-fd0cbae09e7e -reprhtml(x) = repr(MIME"text/html"(), x) - -# ╔═╡ 5b325b50-8984-44c6-8677-3c6bc5c2b0b1 -"A magic token that will turn into a relative URL pointing to the website root when used in output." -const root_url = "++magic#root#url~$(string(rand(UInt128),base=62))++" - -# ╔═╡ 0d2b7382-2ddf-48c3-90c8-bc22de454c97 -""" -```julia -register_asset(contents, original_name::String) -``` - -Place an asset in the `/generated_assets/` subfolder of the output directory and return a [`RegisteredAsset`](@ref) referencing it for later use. (The original filename will be sanitized, and a content hash will be appended.) - -To be used inside `process_file` methods which need to generate additional files. You can use `registered_asset.url` to get a location-independent href to the result. -""" -function register_asset(contents, original_name::String) - h = myhash(contents) - n, e = splitext(basename(original_name)) - - - mkpath(joinpath(output_dir, "generated_assets")) - newpath = joinpath(output_dir, "generated_assets", "$(legalize(n))_$(h)$(e)") - write(newpath, contents) - rel = relpath(newpath, output_dir) - return RegisteredAsset(joinpath(root_url, rel), rel, newpath) -end - -# ╔═╡ e2510a44-df48-4c05-9453-8822deadce24 -function template_handler( - ::Val{Symbol(".jl")}, - input::TemplateInput -)::TemplateOutput - - - if Pluto.is_pluto_notebook(input.absolute_path) - temp_out = mktempdir() - Logging.with_logger(Logging.NullLogger()) do - PlutoSliderServer.export_notebook( - input.absolute_path; - Export_create_index=false, - Export_cache_dir=cache_dir, - Export_baked_state=false, - Export_baked_notebookfile=false, - Export_output_dir=temp_out, - ) - end - d = readdir(temp_out) - - statefile = find(contains("state") ∘ last ∘ splitext, d) - notebookfile = find(!contains("html") ∘ last ∘ splitext, d) - - reg_s = register_asset(read(joinpath(temp_out, statefile)), statefile) - reg_n = register_asset(read(joinpath(temp_out, notebookfile)), notebookfile) - - # TODO these relative paths can't be right... - h = @htl """ - - """ - - frontmatter = Pluto.frontmatter(input.absolute_path) - frontmatter["plutopages_statefile_url"] = reg_s.url - frontmatter["plutopages_notebook_url"] = reg_n.url - - return TemplateOutput(; - contents = repr(MIME"text/html"(), h), - search_index_data=prose_from_code(SafeString(input.contents)), - frontmatter, - ) - else - - s = SafeString(input.contents) - - h = @htl """ -
$(s)
- """ - - return TemplateOutput(; - contents=repr(MIME"text/html"(), h), - search_index_data=prose_from_code(s), - ) - end -end - -# ╔═╡ 079a6399-50eb-4dee-a36d-b3dcb81c8456 -template_results = let - # delete any old files - for f in readdir(output_dir) - rm(joinpath(output_dir, f); recursive=true) - end - - # let's go! running all the template handlers - progressmap_async(allfiles; ntasks=NUM_PARALLEL_WORKERS) do f - absolute_path = joinpath(dir, f) - - input = TemplateInput(; - contents=read(absolute_path), - absolute_path, - relative_path=f, - frontmatter=FrontMatter( - "root_url" => root_url, - ), - ) - - output = try - template_handler(Val(Symbol(splitext(f)[2])), input) - catch e - @error "Template handler failed" f exception=(e,catch_backtrace()) - rethrow() - end - - input, output - end -end - -# ╔═╡ 318dc59e-15f6-4b25-bcf5-1ab6b0d87af7 -pages = Page[ - let - u = final_url(input, output) - Page( - short_url(u), u, input, output, - ) - end - for (input, output) in template_results if output.contents !== nothing -] - -# ╔═╡ f93da14a-e4c8-4c28-ab01-4a5ba1a3cf47 -collections = let - result = Dict{String,Set{Page}}() - - for page in pages - for t in get(page.output.frontmatter, "tags", String[]) - old = get!(result, t, Set{Page}()) - push!(old, page) - end - end - - - Dict{String,Collection}( - k => Collection(k, sort(collect(v); by=sort_by)) for (k,v) in result - ) -end - -# ╔═╡ c2ee20be-16f5-47a8-851a-67a361bb0316 -""" -```julia -process_layouts(page::Page)::Page -``` - -Recursively apply the layout specified in the frontmatter, returning a new `Page` with updated `output`. -""" -function process_layouts(page::Page)::Page - output = page.output - - if haskey(output.frontmatter, "layout") - @assert output.file_extension == "html" "Layout is not (yet) supported on non-HTML outputs." - - layoutname = output.frontmatter["layout"] - @assert layoutname isa String - layout_file = joinpath(dir, "_includes", layoutname) - @assert isfile(layout_file) "$layout_file is not a valid layout path" - - - content = if ishtml(output) - HTML(SafeString(output.contents)) - else - output.contents - end - - input = TemplateInput(; - contents=read(layout_file), - absolute_path=layout_file, - relative_path=relpath(layout_file, dir), - frontmatter=merge(output.frontmatter, - FrontMatter( - "content" => content, - "page" => page, - "collections" => collections, - "root_url" => root_url, - ), - ) - ) - - result = template_handler(Val(Symbol(splitext(layout_file)[2])), input) - - @assert result.file_extension == "html" "Non-HTML output from Layouts is not (yet) supported." - - - - old_frontmatter = copy(output.frontmatter) - delete!(old_frontmatter, "layout") - new_frontmatter = merge(old_frontmatter, result.frontmatter) - - process_layouts(Page( - page.url, - page.full_url, - page.input, - TemplateOutput( - result; - search_index_data=output.search_index_data, - frontmatter=new_frontmatter, - ), - )) - else - page - end -end - -# ╔═╡ 06edb2d7-325f-4f80-8c55-dc01c7783054 -rendered_results = progressmap(with_doctype ∘ process_layouts, pages) - -# ╔═╡ d8e9b950-6e71-40e2-bac1-c3ba85bc83ee -collected_search_index_data = [ - ( - url=page.url::String, - title=get( - page.output.frontmatter, "title", - splitext(basename(page.input.relative_path))[1] - )::String, - tags=get(page.output.frontmatter, "tags", String[]), - text=page.output.search_index_data, - ) - for page in rendered_results if page.output.search_index_data !== nothing -] - -# ╔═╡ 1be06e4b-6072-46c3-a63d-aa95e51c43b4 -write( - joinpath(output_dir, "pp_search_data.json"), - JSON.json(collected_search_index_data) -) - -# ╔═╡ 608ed895-3a62-4c11-8026-40120ab05af1 -config_json_data = let - page = find(p -> basename(p.url) == "pluto_export_configuration.json", rendered_results) - page === nothing ? Dict{String,Any}() : JSON.parse(SafeString(page.input.contents)) -end - -# ╔═╡ 52fc3e5e-21a6-4357-9e63-8a70a6e6deb8 -function index_json_data(page::Page) - r(s) = replace(s, root_url => ".") - - ( - id=page.url, - hash=PlutoSliderServer.plutohash(page.input.contents), - statefile_path=r(page.output.frontmatter["plutopages_statefile_url"]), - notebookfile_path=r(page.output.frontmatter["plutopages_notebook_url"]), - html_path=page.full_url, - frontmatter=page.output.frontmatter, - ) -end - -# ╔═╡ d7a01c06-7174-4e6d-b02d-79c953ecdb79 -index_json = let - nbz = filter(rendered_results) do page - haskey(page.output.frontmatter, "plutopages_statefile_url") - end - - ( - notebooks=Dict(page.url => index_json_data(page) for page in nbz), - pluto_version=lstrip(Pluto.PLUTO_VERSION_STR, 'v'), - julia_version=lstrip(string(VERSION), 'v'), - format_version="1", - - title=get(config_json_data, "title", nothing), - description=get(config_json_data, "description", nothing), - collections=get(config_json_data, "collections", nothing), - ) -end - -# ╔═╡ 7ed02eaa-9d88-4faa-a61f-bf1d1f748fce -write( - joinpath(output_dir, "pluto_export.json"), - JSON.json(index_json) -) - -# ╔═╡ 9845db00-149c-45be-9e4f-55d1157afc87 -process_results = map(rendered_results) do page - input = page.input - output = page.output - - if output !== nothing && output.contents !== nothing - - # TODO: use front matter for permalink - - output_path2 = joinpath(output_dir, page.full_url) - mkpath(output_path2 |> dirname) - # Our magic root url: - # in Julia, you can safely call `String` and `replace` on arbitrary, non-utf8 data :) - write(output_path2, - replace(SafeString(output.contents), root_url => relpath(output_dir, output_path2 |> dirname)) - ) - end -end - -# ╔═╡ 70fa9af8-31f9-4e47-b36b-828c88166b3d -md""" -# Verify output -""" - -# ╔═╡ d17c96fb-8459-4527-a139-05fdf74cdc39 -allfiles_output = let - process_results - PlutoSliderServer.list_files_recursive(output_dir) -end - -# ╔═╡ 9268f35e-1a4e-414e-a7ea-3f5796e0bbf3 -allfiles_output2 = filter(allfiles_output) do f - !startswith(f, "generated_assets") -end - -# ╔═╡ e0a25f24-a7de-4eac-9f88-cb7632de09eb -begin - @assert length(allfiles_output2) ≥ length(pages) - - @htl(""" - - """) -end - -# ╔═╡ Cell order: -# ╠═b8024c95-6a63-4409-9c75-9bad6b301a92 -# ╠═c5a0b072-7f49-4c0c-855e-773cfc03d308 -# ╠═d4cfce05-bae4-49ae-b26d-ce27171a3853 -# ╠═644552c6-4e32-4caf-90ef-bee259977094 -# ╠═66c97351-2294-4ac2-a93a-f334aaee8f92 -# ╠═bcbda2d2-90a5-43e6-8400-d5472578f86a -# ╠═cd576da6-59ae-4d1b-b812-1a35023b6875 -# ╟─e0ae20f5-ffe7-4f0e-90be-168924526e03 -# ╟─d58f2a89-4631-4b19-9d60-5e590908b61f -# ╟─2221f133-e490-4e3a-82d4-bd1c6c979d1c -# ╟─86471faf-af03-4f35-8b95-c4011ceaf7c3 -# ╟─6c8e76ea-d648-449a-89de-cb6632cdd6b9 -# ╠═a166e8f3-542e-4068-a076-3f5fd4daa61c -# ╠═6288f145-444b-41cb-b9e3-8f273f9517fb -# ╠═ff55f7eb-a23d-4ca7-b428-ab05dcb8f090 -# ╟─4a2dc5a4-0bf2-4678-b984-4ecb7b397d72 -# ╠═ce840b47-8406-48e6-abfb-1b00daab28dd -# ╠═995c6810-8df2-483d-a87a-2277af0d43bd -# ╟─b3ce7742-fb47-4c17-bac2-e6a7710eb1a1 -# ╠═f4a4b741-8028-4626-9187-0b6a52f062b6 -# ╠═535efb29-73bd-4e65-8bbc-18b72ae8fe1f -# ╠═7e86cfc7-5439-4c7a-9c3b-381c776d8371 -# ╠═90f0c676-b33f-441c-8ea6-d59c44a11547 -# ╠═5381e8b3-d4f9-4e58-8da3-f1ee0a9b7a6d -# ╠═9f945292-ff9e-4f29-93ea-69b10fc4428d -# ╠═83366d96-4cd3-4def-a0da-16a22b40124f -# ╠═08b42df7-9120-4b42-80ee-8e438752b50c -# ╠═7717e24f-62ee-4852-9dec-d09b734d0693 -# ╠═692c1e0b-07e1-41b3-abcd-2156bda65b41 -# ╟─adb1ddac-d992-49ca-820f-e1ed8ca33bf8 -# ╠═e2510a44-df48-4c05-9453-8822deadce24 -# ╠═bb905046-59b7-4da6-97ad-dbb9055d823a -# ╠═b638df55-fd74-4ae8-bdbd-ec7b18214b40 -# ╠═87b4431b-438b-4da4-9d06-79e7f3a2fe05 -# ╟─cd4e479c-deb7-4a44-9eb0-c3819b5c4067 -# ╠═2e527d04-e4e7-4dc8-87e6-8b3dd3c7688a -# ╟─94bb6730-a4ad-42d2-aa58-41b70a15cd0e -# ╠═e15cf987-3615-4e96-8ccd-04cad3bcd48e -# ╟─940f3995-1739-4b30-b8cf-c27a671043e5 -# ╠═0d2b7382-2ddf-48c3-90c8-bc22de454c97 -# ╠═5e91e7dc-82b6-486a-b745-34f97b6fb20c -# ╠═8f6393a4-e945-4f06-90f6-0a71f874c8e9 -# ╠═4fcdd524-86a8-4033-bc7c-4a7c04224eeb -# ╟─070c710d-3746-4706-bd03-b5b00a576007 -# ╟─a5c22f80-58c7-4c63-95b8-ecb30bc896d0 -# ╟─750782a1-3aeb-4816-8f6a-ec31055373c1 -# ╟─f6b89b8c-3750-4dd2-940e-579be953c1c2 -# ╟─29a81ad7-3803-4b7a-98ca-6e5b1077e1c7 -# ╠═c52c9786-a25f-11ec-1fdc-9b13922d7ccb -# ╠═7c53c1e3-6ccf-4804-8bc3-09126036608e -# ╠═725cb996-68ac-4736-95ee-0a9754867bf3 -# ╠═9d996c55-0e37-4ae9-a6a2-8c8761e8c6db -# ╟─cf27b3d3-1689-4b3a-a8fe-3ad639eb2f82 -# ╟─7f7f1981-978d-4861-b840-71ab611faf74 -# ╟─7d9cb939-da6b-4961-9584-a905ad453b5d -# ╠═e1a87788-2eba-47c9-ab4c-74f3344dce1d -# ╠═d38dc2aa-d5ba-4cf7-9f9e-c4e4611a57ac -# ╠═485b7956-0774-4b25-a897-3d9232ef8590 -# ╠═8da0c249-6094-49ab-9e59-d6e356818651 -# ╟─d314ab46-b866-44c6-bfca-9a413bc06514 -# ╠═e01ebbab-dc9a-4aaf-ae16-200d171fcbd9 -# ╠═37b2cecc-e4c7-4b80-b7d9-71c68f3c0339 -# ╟─7a95681a-df77-408f-919a-2bee5afd7777 -# ╟─f3d225b8-b9a5-4639-97eb-7785b1a78f5a -# ╠═c3a495c1-3e1f-42a1-ac08-8dc0b9175fe9 -# ╠═3b2d1919-41d9-4bba-9774-c8497bba5003 -# ╠═6f7f66e8-ed10-4cc4-8672-a06861111aec -# ╠═d09ee809-33d8-44f8-aa7a-be4b3fdc21eb -# ╟─a0a80dce-2199-45b6-b4e9-d4168f520c85 -# ╟─4e88cf07-8d85-4327-b310-6c71ba951bba -# ╠═f700357f-e21c-4d23-b56c-be4f9c90465f -# ╠═079a6399-50eb-4dee-a36d-b3dcb81c8456 -# ╟─aaad71bd-5425-4783-952c-82e4d4fa7bb8 -# ╠═76c2ac85-2e89-4396-a498-a4ceb1cc80bd -# ╠═898eb093-444c-45cf-88d7-3dbe9708ae31 -# ╟─a510857f-528b-43e8-be78-69e554d165a6 -# ╟─1c269e16-65c7-47ae-aeab-001f1b205e14 -# ╟─318dc59e-15f6-4b25-bcf5-1ab6b0d87af7 -# ╟─76193b12-842c-4b82-a23e-fb7403274234 -# ╠═4f563136-fc7b-4322-92ba-78c0183c40cc -# ╠═f93da14a-e4c8-4c28-ab01-4a5ba1a3cf47 -# ╠═41ab51f9-0b33-4548-b08a-ad1ef7d38f1b -# ╟─b0006e61-b037-41ed-a3e4-9962d15584c4 -# ╠═c2ee20be-16f5-47a8-851a-67a361bb0316 -# ╠═06edb2d7-325f-4f80-8c55-dc01c7783054 -# ╟─f2fbcc70-a714-4eda-8786-7ee5692e3268 -# ╟─57fd383b-d791-4170-a353-f839356f9d7a -# ╟─05f735e0-01cc-4276-a3f9-8420296e68be -# ╠═d8e9b950-6e71-40e2-bac1-c3ba85bc83ee -# ╟─6460cf11-ae78-47e3-9ac1-649295e76ddc -# ╟─52fc3e5e-21a6-4357-9e63-8a70a6e6deb8 -# ╟─608ed895-3a62-4c11-8026-40120ab05af1 -# ╟─d7a01c06-7174-4e6d-b02d-79c953ecdb79 -# ╠═7ed02eaa-9d88-4faa-a61f-bf1d1f748fce -# ╟─1a303aa4-bed5-4d9b-855c-23355f4a88fe -# ╠═834294ff-9441-4e71-b5c0-edaf32d860ee -# ╠═1be06e4b-6072-46c3-a63d-aa95e51c43b4 -# ╠═9845db00-149c-45be-9e4f-55d1157afc87 -# ╟─eef54261-767a-4ce4-b549-0b1828379f7e -# ╟─cda8689d-9ae5-42c4-8e7e-715cf44c33bb -# ╟─4013400c-acb4-40fa-a826-fd0cbae09e7e -# ╟─5b325b50-8984-44c6-8677-3c6bc5c2b0b1 -# ╟─70fa9af8-31f9-4e47-b36b-828c88166b3d -# ╠═d17c96fb-8459-4527-a139-05fdf74cdc39 -# ╠═9268f35e-1a4e-414e-a7ea-3f5796e0bbf3 -# ╠═e0a25f24-a7de-4eac-9f88-cb7632de09eb diff --git a/develop.jl b/develop.jl index 9060037..9def729 100644 --- a/develop.jl +++ b/develop.jl @@ -1,128 +1,10 @@ cd(@__DIR__) -notebook_path = joinpath(@__DIR__, "PlutoPages.jl") @assert VERSION >= v"1.10.0" -begin - begin - begin - # copy paste from pluto source code - function detectwsl() - Sys.islinux() && - isfile("/proc/sys/kernel/osrelease") && - occursin(r"Microsoft|WSL"i, read("/proc/sys/kernel/osrelease", String)) - end - - function open_in_default_browser(url::AbstractString)::Bool - try - if Sys.isapple() - Base.run(`open $url`) - true - elseif Sys.iswindows() || detectwsl() - Base.run(`powershell.exe Start "'$url'"`) - true - elseif Sys.islinux() - Base.run(`xdg-open $url`) - true - else - false - end - catch ex - false - end - end - end - end -end - - - import Pkg Pkg.activate("./pluto-deployment-environment") Pkg.instantiate() -import Pluto -import Deno_jll - - -pluto_port_channel = Channel{UInt16}(1) -function on_event(e::Pluto.ServerStartEvent) - put!(pluto_port_channel, e.port) -end -function on_event(e) - # ignore -end - -req_s = false - -# We create a session: -sesh = Pluto.ServerSession(options=Pluto.Configuration.from_flat_kwargs(; - # workspace_use_distributed=false, - # disable_writing_notebook_files=true, - auto_reload_from_file=true, - launch_browser=false, - port_hint=7090, - on_event, - require_secret_for_access=req_s, - require_secret_for_open_links=req_s -)) - -notebook_launch_task = @async Pluto.SessionActions.open(sesh, notebook_path; run_async=true) - -@info "Pluto app: Starting server..." - -println("Ignore the message \"Go to ... in your browser\":") -pluto_server_task = @async Pluto.run(sesh) - -pluto_port = take!(pluto_port_channel) # This waits for the server to get ready -@info "Pluto app: waiting for notebook to launch..." -notebook = fetch(notebook_launch_task) # This waits for the notebook to finish - -output_dir = joinpath(@__DIR__, "_site") - -dev_server_port = rand(40507:40999) - - -dev_server_task = @async run(`$(Deno_jll.deno()) run --allow-read --allow-net https://deno.land/std@0.102.0/http/file_server.ts --cors --port $(dev_server_port) $(output_dir)`) # <=v"0.102.0" because of https://github.com/denoland/deno_std/issues/2251 - -sleep(.5) - -ccall(:jl_exit_on_sigint, Cvoid, (Cint,), 0) -@info "Press Ctrl+C multiple times to exit" - -isolated_cell_ids = [ - "cf27b3d3-1689-4b3a-a8fe-3ad639eb2f82" - "7f7f1981-978d-4861-b840-71ab611faf74" - "7d9cb939-da6b-4961-9584-a905ad453b5d" - "4e88cf07-8d85-4327-b310-6c71ba951bba" - "079a6399-50eb-4dee-a36d-b3dcb81c8456" - "b0006e61-b037-41ed-a3e4-9962d15584c4" - "06edb2d7-325f-4f80-8c55-dc01c7783054" - "e0a25f24-a7de-4eac-9f88-cb7632de09eb" -] - -isolated_cell_query = join("&isolated_cell_id=$(i)" for i in isolated_cell_ids) - -dev_server_url = "http://localhost:$(dev_server_port)/" -pluto_server_url = "http://localhost:$(pluto_port)/edit?id=$(notebook.notebook_id)$(isolated_cell_query)" - -@info """ - -✅✅✅ - -Ready! To see the website, visit: -➡️ $(dev_server_url) - -To inspect the generation process, go to: -➡️ $(pluto_server_url) - -✅✅✅ - -""" - - - -open_in_default_browser(dev_server_url) -open_in_default_browser(pluto_server_url) +import PlutoPages -wait(dev_server_task) -wait(pluto_server_task) \ No newline at end of file +PlutoPages.develop(@__DIR__) diff --git a/generate.jl b/generate.jl deleted file mode 100644 index a870f89..0000000 --- a/generate.jl +++ /dev/null @@ -1,28 +0,0 @@ -import Pluto - -s = Pluto.ServerSession() - -# s.options.server.disable_writing_notebook_files = true -s.options.server.launch_browser = false - -@info "PlutoPages: Starting..." -nb = Pluto.SessionActions.open(s, joinpath(@__DIR__, "PlutoPages.jl"); run_async=false) -@info "PlutoPages: Finished. Analyzing result..." - -write("generation_report.html", Pluto.generate_html(nb)) - -failed = filter(c -> c.errored, nb.cells) - -for c in failed - println(stderr, "Cell errored: ", c.cell_id) - println(stderr) - show(stderr, MIME"text/plain"(), c.output.body) - println(stderr) - println(stderr) -end - -Pluto.SessionActions.shutdown(s, nb) - -if !isempty(failed) - exit(1) -end diff --git a/pluto-deployment-environment/Manifest.toml b/pluto-deployment-environment/Manifest.toml index c274ac1..2cdbf1a 100644 --- a/pluto-deployment-environment/Manifest.toml +++ b/pluto-deployment-environment/Manifest.toml @@ -1,14 +1,14 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.10.0" +julia_version = "1.10.3" manifest_format = "2.0" -project_hash = "0b0ae4ebf7afeaf070e2eacf1b90bd8eb69cba53" +project_hash = "4d4beacaca6adcbb997186dde4e4366aca350472" [[deps.AbstractPlutoDingetjes]] deps = ["Pkg"] -git-tree-sha1 = "297b6b41b66ac7cbbebb4a740844310db9fd7b8c" +git-tree-sha1 = "6e1d2a35f2f90a4bc7c2ed98079b2ba09c35b83a" uuid = "6e696c72-6542-2067-7265-42206c756150" -version = "1.3.1" +version = "1.3.2" [[deps.AbstractTrees]] git-tree-sha1 = "2d9c9a55f9c93e8887ad391fbae72f8ef55e1177" @@ -17,9 +17,9 @@ version = "0.4.5" [[deps.Accessors]] deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "MacroTools", "Markdown", "Test"] -git-tree-sha1 = "c0d491ef0b135fd7d63cbc6404286bc633329425" +git-tree-sha1 = "f61b15be1d76846c0ce31d3fcfac5380ae53db6a" uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" -version = "0.1.36" +version = "0.1.37" [deps.Accessors.extensions] AccessorsAxisKeysExt = "AxisKeys" @@ -61,10 +61,10 @@ version = "1.1.1" uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [[deps.BangBang]] -deps = ["Accessors", "Compat", "ConstructionBase", "InitialValues", "LinearAlgebra", "Requires"] -git-tree-sha1 = "490e739172eb18f762e68dc3b928cad2a077983a" +deps = ["Accessors", "ConstructionBase", "InitialValues", "LinearAlgebra", "Requires"] +git-tree-sha1 = "e2144b631226d9eeab2d746ca8880b7ccff504ae" uuid = "198e06fe-97b7-11e9-32a5-e1d131e6ad66" -version = "0.4.1" +version = "0.4.3" [deps.BangBang.extensions] BangBangChainRulesCoreExt = "ChainRulesCore" @@ -97,21 +97,21 @@ uuid = "c9fd44ac-77b5-486c-9482-9798bd063cc6" version = "0.1.5" [[deps.BitFlags]] -git-tree-sha1 = "2dc09997850d68179b69dafb58ae806167a32b1b" +git-tree-sha1 = "0691e34b3bb8be9307330f88d1a3c3f25466c24d" uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" -version = "0.1.8" +version = "0.1.9" [[deps.CodeTracking]] deps = ["InteractiveUtils", "UUIDs"] -git-tree-sha1 = "c0216e792f518b39b22212127d4a84dc31e4e386" +git-tree-sha1 = "7eee164f122511d3e4e1ebadb7956939ea7e1c77" uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" -version = "1.3.5" +version = "1.3.6" [[deps.CodecZlib]] deps = ["TranscodingStreams", "Zlib_jll"] -git-tree-sha1 = "59939d8a997469ee05c4b4944560a820f9ba0d73" +git-tree-sha1 = "b8fe8546d52ca154ac556809e10c75e6e7430ac8" uuid = "944b1d66-785c-5afd-91f1-9de20f533193" -version = "0.7.4" +version = "0.7.5" [[deps.ColorTypes]] deps = ["FixedPointNumbers", "Random"] @@ -125,20 +125,10 @@ git-tree-sha1 = "532c4185d3c9037c0237546d817858b23cf9e071" uuid = "a80b9123-70ca-4bc0-993e-6e3bcb318db6" version = "0.8.12" -[[deps.Compat]] -deps = ["TOML", "UUIDs"] -git-tree-sha1 = "c955881e3c981181362ae4088b35995446298b80" -uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.14.0" -weakdeps = ["Dates", "LinearAlgebra"] - - [deps.Compat.extensions] - CompatLinearAlgebraExt = "LinearAlgebra" - [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.0.5+1" +version = "1.1.1+0" [[deps.CompositionsBase]] git-tree-sha1 = "802bb88cd69dfd1509f6670416bd4434015693ad" @@ -151,9 +141,9 @@ weakdeps = ["InverseFunctions"] [[deps.ConcurrentUtilities]] deps = ["Serialization", "Sockets"] -git-tree-sha1 = "6cbbd4d241d7e6579ab354737f4dd95ca43946e1" +git-tree-sha1 = "ea32b83ca4fefa1768dc84e504cc0a94fb1ab8d1" uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb" -version = "2.4.1" +version = "2.4.2" [[deps.Configurations]] deps = ["ExproniconLite", "OrderedCollections", "TOML"] @@ -163,9 +153,9 @@ version = "0.17.6" [[deps.ConstructionBase]] deps = ["LinearAlgebra"] -git-tree-sha1 = "260fd2400ed2dab602a7c15cf10c1933c59930a2" +git-tree-sha1 = "d8a9c0b6ac2d9081bf76324b39c78ca3ce4f0c98" uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" -version = "1.5.5" +version = "1.5.6" [deps.ConstructionBase.extensions] ConstructionBaseIntervalSetsExt = "IntervalSets" @@ -222,9 +212,9 @@ version = "0.1.10" [[deps.Expat_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "4558ab818dcceaab612d1bb8c19cee87eda2b83c" +git-tree-sha1 = "1c6317308b9dc757616f0b5cb379db10494443a7" uuid = "2e619515-83b5-522b-bb60-26c02a35a201" -version = "2.5.0+0" +version = "2.6.2+0" [[deps.ExpressionExplorer]] git-tree-sha1 = "0da78bef32ca71276337442389a3d1962a1ee0da" @@ -232,18 +222,18 @@ uuid = "21656369-7473-754a-2065-74616d696c43" version = "1.0.2" [[deps.ExproniconLite]] -git-tree-sha1 = "5552cf384e4577c5dd2db57d7086a4a41747dbb9" +git-tree-sha1 = "4c9ed87a6b3cd90acf24c556f2119533435ded38" uuid = "55351af7-c7e9-48d6-89ff-24e801d99491" -version = "0.10.6" +version = "0.10.13" [[deps.FileWatching]] uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" [[deps.FixedPointNumbers]] deps = ["Statistics"] -git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc" +git-tree-sha1 = "05882d6995ae5c12bb5f36dd2ed3f61c98cbb172" uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" -version = "0.8.4" +version = "0.8.5" [[deps.FromFile]] deps = ["Downloads", "Requires"] @@ -298,9 +288,9 @@ version = "0.10.2+0" [[deps.HTTP]] deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] -git-tree-sha1 = "8e59b47b9dc525b70550ca082ce85bcd7f5477cd" +git-tree-sha1 = "d1d712be3164d61d1fb98e7ce9bcbc6cc06b45ed" uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "1.10.5" +version = "1.10.8" [[deps.Hyperscript]] deps = ["Test"] @@ -316,9 +306,9 @@ version = "0.9.5" [[deps.IOCapture]] deps = ["Logging", "Random"] -git-tree-sha1 = "8b72179abc660bfab5e28472e019392b97d0985c" +git-tree-sha1 = "b6d6bfdd7ce25b0f9b2f6b3dd56b2673a66c8770" uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89" -version = "0.2.4" +version = "0.2.5" [[deps.InitialValues]] git-tree-sha1 = "4da0f88e9a39111c2fa3add390ab15f3a44f3ca3" @@ -331,9 +321,9 @@ uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[deps.InverseFunctions]] deps = ["Test"] -git-tree-sha1 = "896385798a8d49a255c398bd49162062e4a4c435" +git-tree-sha1 = "18c59411ece4838b18cd7f537e56cf5e41ce5bfd" uuid = "3587e190-3f89-42d0-90ee-14403ec27112" -version = "0.1.13" +version = "0.1.15" weakdeps = ["Dates"] [deps.InverseFunctions.extensions] @@ -358,9 +348,9 @@ version = "0.21.4" [[deps.JuliaInterpreter]] deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"] -git-tree-sha1 = "e9648d90370e2d0317f9518c9c6e0841db54a90b" +git-tree-sha1 = "7ae67d8567853d367e3463719356b8989e236069" uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a" -version = "0.9.31" +version = "0.9.34" [[deps.LazilyInitializedFields]] git-tree-sha1 = "8f7f3cabab0fd1800699663533b6d5cb3fc0e612" @@ -410,6 +400,12 @@ version = "1.17.0+0" deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +[[deps.LiveServer]] +deps = ["HTTP", "LoggingExtras", "MIMEs", "Pkg", "Sockets", "Test"] +git-tree-sha1 = "1e46b873b8ef176e23ee43f96e72cd45c20bafb4" +uuid = "16fef848-5104-11e9-1b77-fb7a48bbb589" +version = "1.3.1" + [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" @@ -421,9 +417,9 @@ version = "1.0.3" [[deps.LoweredCodeUtils]] deps = ["JuliaInterpreter"] -git-tree-sha1 = "31e27f0b0bf0df3e3e951bfcc43fe8c730a219f6" +git-tree-sha1 = "1ce1834f9644a8f7c011eb0592b7fd6c42c90653" uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b" -version = "2.4.5" +version = "3.0.1" [[deps.MIMEs]] git-tree-sha1 = "65f28ad4b594aebe22157d6fac869786a255b7eb" @@ -489,7 +485,7 @@ version = "1.2.0" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.23+2" +version = "0.3.23+4" [[deps.OpenSSL]] deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] @@ -499,9 +495,9 @@ version = "1.4.3" [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "3da7367955dcc5c54c1ba4d402ccdc09a1a3e046" +git-tree-sha1 = "a028ee3cb5641cccc4c24e90c36b0a4f7707bdf5" uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "3.0.13+1" +version = "3.0.14+0" [[deps.OrderedCollections]] git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5" @@ -526,9 +522,9 @@ version = "1.10.0" [[deps.Pluto]] deps = ["Base64", "Configurations", "Dates", "Downloads", "ExpressionExplorer", "FileWatching", "FuzzyCompletions", "HTTP", "HypertextLiteral", "InteractiveUtils", "Logging", "LoggingExtras", "MIMEs", "Malt", "Markdown", "MsgPack", "Pkg", "PlutoDependencyExplorer", "PrecompileSignatures", "PrecompileTools", "REPL", "RegistryInstances", "RelocatableFolders", "Scratch", "Sockets", "TOML", "Tables", "URIs", "UUIDs"] -git-tree-sha1 = "5e88cea5e54cb10216ad64eedd6897f9597a85b4" +git-tree-sha1 = "daa8d3f95b43a2e18c63f7bdbabab4f45f332bac" uuid = "c3e4b0f8-55cb-11ea-2926-15256bba5781" -version = "0.19.41" +version = "0.19.45" [[deps.PlutoDependencyExplorer]] deps = ["ExpressionExplorer", "InteractiveUtils", "Markdown"] @@ -548,17 +544,23 @@ git-tree-sha1 = "8f5fa7056e6dcfb23ac5211de38e6c03f6367794" uuid = "0ff47ea0-7a50-410d-8455-4348d5de0420" version = "0.1.6" +[[deps.PlutoPages]] +deps = ["BetterFileWatching", "CommonMark", "Gumbo", "HypertextLiteral", "InteractiveUtils", "JSON", "LiveServer", "Logging", "Malt", "Markdown", "MarkdownLiteral", "Pkg", "Pluto", "PlutoHooks", "PlutoLinks", "PlutoSliderServer", "PlutoUI", "ProgressLogging", "RelocatableFolders", "SHA", "ThreadsX", "Unicode", "YAML"] +git-tree-sha1 = "89c19eaca339e71f8cae3b6a1940883a6cb058e8" +uuid = "d5dc3dd1-4774-47c7-8860-0a1ad9e34b8c" +version = "0.1.4" + [[deps.PlutoSliderServer]] deps = ["AbstractPlutoDingetjes", "Base64", "BetterFileWatching", "Configurations", "Distributed", "FromFile", "Git", "GitHubActions", "Glob", "HTTP", "JSON", "Logging", "Pkg", "Pluto", "SHA", "Sockets", "TOML", "TerminalLoggers", "UUIDs"] -git-tree-sha1 = "bebd149349757df4ef8f1f62b78408b68114e133" +git-tree-sha1 = "96f804d8963e33862f23ce67d42e9ae9fd2df04f" uuid = "2fc8631c-6f24-4c5b-bca7-cbb509c42db4" -version = "0.3.29" +version = "0.3.31" [[deps.PlutoUI]] deps = ["AbstractPlutoDingetjes", "Base64", "ColorTypes", "Dates", "FixedPointNumbers", "Hyperscript", "HypertextLiteral", "IOCapture", "InteractiveUtils", "JSON", "Logging", "MIMEs", "Markdown", "Random", "Reexport", "URIs", "UUIDs"] -git-tree-sha1 = "71a22244e352aa8c5f0f2adde4150f62368a3f2e" +git-tree-sha1 = "ab55ee1510ad2af0ff674dbcced5e94921f867a9" uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8" -version = "0.7.58" +version = "0.7.59" [[deps.PrecompileSignatures]] git-tree-sha1 = "18ef344185f25ee9d51d80e179f8dad33dc48eb1" @@ -625,10 +627,10 @@ uuid = "ae029012-a4dd-5104-9daa-d747884805df" version = "1.3.0" [[deps.Revise]] -deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Pkg", "REPL", "Requires", "UUIDs", "Unicode"] -git-tree-sha1 = "12aa2d7593df490c407a3bbd8b86b8b515017f3e" +deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "REPL", "Requires", "UUIDs", "Unicode"] +git-tree-sha1 = "7b7850bb94f75762d567834d7e9802fc22d62f9c" uuid = "295af30f-e4ad-537b-8983-00126c2a3abe" -version = "3.5.14" +version = "3.5.18" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" @@ -669,9 +671,9 @@ uuid = "171d559e-b47b-412a-8079-5efa626c420e" version = "0.1.15" [[deps.StaticArraysCore]] -git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" +git-tree-sha1 = "192954ef1208c7019899fbf8049e717f92959682" uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.4.2" +version = "1.4.3" [[deps.Statistics]] deps = ["LinearAlgebra", "SparseArrays"] @@ -701,10 +703,10 @@ uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" version = "1.0.1" [[deps.Tables]] -deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits"] -git-tree-sha1 = "cb76cf677714c095e535e3501ac7954732aeea2d" +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "OrderedCollections", "TableTraits"] +git-tree-sha1 = "598cd7c1f68d1e205689b1c2fe65a9f85846f297" uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.11.1" +version = "1.12.0" [[deps.Tar]] deps = ["ArgTools", "SHA"] @@ -728,9 +730,9 @@ uuid = "ac1d9e8a-700a-412c-b207-f0111f4b6c0d" version = "0.1.12" [[deps.TranscodingStreams]] -git-tree-sha1 = "71509f04d045ec714c4748c785a59045c3736349" +git-tree-sha1 = "96612ac5365777520c3c5396314c8cf7408f436a" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.10.7" +version = "0.11.1" weakdeps = ["Random", "Test"] [deps.TranscodingStreams.extensions] @@ -738,9 +740,9 @@ weakdeps = ["Random", "Test"] [[deps.Transducers]] deps = ["Accessors", "Adapt", "ArgCheck", "BangBang", "Baselet", "CompositionsBase", "ConstructionBase", "DefineSingletons", "Distributed", "InitialValues", "Logging", "Markdown", "MicroCollections", "Requires", "SplittablesBase", "Tables"] -git-tree-sha1 = "47e516e2eabd0cf1304cd67839d9a85d52dd659d" +git-tree-sha1 = "5215a069867476fc8e3469602006b9670e68da23" uuid = "28d57a85-8fef-5791-bfe6-a80928e7c999" -version = "0.4.81" +version = "0.4.82" [deps.Transducers.extensions] TransducersBlockArraysExt = "BlockArrays" @@ -757,9 +759,9 @@ version = "0.4.81" Referenceables = "42d2dcc6-99eb-4e98-b66c-637b7d73030e" [[deps.Tricks]] -git-tree-sha1 = "eae1bb484cd63b36999ee58be2de6c178105112f" +git-tree-sha1 = "7822b97e99a1672bfb1b49b668a6d46d58d8cbcb" uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775" -version = "0.1.8" +version = "0.1.9" [[deps.URIs]] git-tree-sha1 = "67db6cc7b3821e19ebe75791a9dd19c9b1188f2b" @@ -775,9 +777,9 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.YAML]] deps = ["Base64", "Dates", "Printf", "StringEncodings"] -git-tree-sha1 = "e6330e4b731a6af7959673621e91645eb1356884" +git-tree-sha1 = "dea63ff72079443240fbd013ba006bcbc8a9ac00" uuid = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6" -version = "0.4.9" +version = "0.4.12" [[deps.Zlib_jll]] deps = ["Libdl"] diff --git a/pluto-deployment-environment/Project.toml b/pluto-deployment-environment/Project.toml index e91cc03..f0d46ca 100644 --- a/pluto-deployment-environment/Project.toml +++ b/pluto-deployment-environment/Project.toml @@ -11,6 +11,7 @@ Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Pluto = "c3e4b0f8-55cb-11ea-2926-15256bba5781" PlutoHooks = "0ff47ea0-7a50-410d-8455-4348d5de0774" PlutoLinks = "0ff47ea0-7a50-410d-8455-4348d5de0420" +PlutoPages = "d5dc3dd1-4774-47c7-8860-0a1ad9e34b8c" PlutoSliderServer = "2fc8631c-6f24-4c5b-bca7-cbb509c42db4" PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8" ProgressLogging = "33c8b6b6-d38a-422a-b730-caa89a2f386c"