PlutoPages.jl in Windows

Hello there,

I’m trying to make a some interactive notebooks with Pluto, and I want an index similar to Computational Thinking Course, and have found PlutoPages.jl but it doesn’t work on Windows locally.

julia> output_dir = PlutoPages.generate(my_site_source)
[ Info: PlutoPages: Starting Pluto notebook...
[ Info: Pluto app: waiting for notebook to finish...
[ Info: Notebook: 0/97 done...
[ Info: Notebook: 1/97 done...
[ Info: Notebook: 2/97 done...
[ Info: Notebook: 3/97 done...
[ Info: Notebook: 4/97 done...
[ Info: Notebook: 5/97 done...
[ Info: Notebook: 7/97 done...
[ Info: Notebook: 14/97 done...
[ Info: Notebook: 17/97 done...
[ Info: Notebook: 20/97 done...
[ Info: Notebook: 26/97 done...
[ Info: Notebook: 28/97 done...
[ Info: Notebook: 41/97 done...
[ Info: Notebook: 44/97 done...
[ Info: Notebook: 45/97 done...
[ Info: Notebook: 61/97 done...
[ Info: Notebook: 78/97 done...
[ Info: Notebook: 80/97 done...
[ Info: Notebook: 96/97 done...
[ Info: Pluto app: notebook finished!
┌ Error: Cell errored
│   c.code = "template_results = let\n\tif isdir(joinpath(output_dir, \"generated_assets\"))\n\t\trm(joinpath(output_dir, \"generated_assets\"); recursive=true)\n\tend\n\t\n\t# let's go! running all the template handlers\n\tprogressmap_async(allfiles; ntasks=NUM_PARALLEL_WORKERS) do f\n\t\tabsolute_path = joinpath(input_dir, f)\n\t\t\n\t\tinput = TemplateInput(;\n\t\t\tcontents=read(absolute_path),\n\t\t\tabsolute_path,\n\t\t\trelative_path=f,\n\t\t\tfrontmatter=FrontMatter(\n\t\t\t\t\"root_url\" => root_url,\n\t\t\t),\n\t\t)\n\t\t\n\t\toutput = try\n\t\t\ttemplate_handler(Val(Symbol(splitext(f)[2])), input)\n\t\tcatch e\n\t\t\t@error \"Template handler failed\" f exception=(e,catch_backtrace())\n\t\t\trethrow()\n\t\tend\n\n\t\tinput, output\n\tend\nend"
│   c.cell_id = Base.UUID("079a6399-50eb-4dee-a36d-b3dcb81c8456")
│   Text(c.output.body) = Dict{Symbol, Any}(:msg => "AssertionError: PlutoSliderServer does not work on Windows yet! Feel free to open a PR to add support.\nStacktrace:\n  [1] 
# ...

Is there any other alternative to do something similar? nothing complicated.

Thanks,
Eduardo

The reason given for Windows not working (/ vs \ in paths) seems a pretty simple thing, so maybe you can take a look and see how much work it would be to fix it. Even if not a “proper” fix that solves the issue, maybe just deving the package locally and doing a hacky fix or workaround might be enough to get your generate done.

Another option is WSL, maybe with just a tiny Linux distro that’s quick to install and get going, if you don’t plan to use WSL long term.

Another thing worth trying (although I don’t know how well this will actually work) is using Google Colab for this. Colab has Julia support now, and runs on Linux afaik, so uploading your notebooks and running the generate there will be a no-frills hack if it works.

Hi! The issue is that PlutoSliderServer.jl (a dependency of PlutoPages) does not yet work on Windows, only on MacOS and Linux. @digital_carver gave some good options for getting a Linux development setup.

It shouldn’t be too hard to add Windows support to PlutoSliderServer and PlutoPages – there are a couple of places where / from URIs are directly mapped to / for paths, and this needs special handling in Windows. Make a fork, try fixing it, and just keep running test PlutoSliderServer while working on a fix.

I wrote a bit more info in the issue PlutoSliderServer on Windows · Issue #102 · JuliaPluto/PlutoSliderServer.jl · GitHub, this is a good first issue to get started if people are interested in contributing to open source Pluto/Julia!

1 Like