Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DocumenterPluto.jl

Build Status Docs

A Documenter.jl plugin to embed Pluto.jl notebooks inside documenter pages. This package embeds the Pluto notebook directly, without iframe.

Requirements

Usage

# docs/make.jl
using Documenter
using DocumenterPluto      # `using DocumenterPluto` will set up Pluto support in pages

makedocs(sitename = "MyPackage.jl")

Then in any Markdown page:

Here is a **Pluto notebook**:

```@pluto
notebook = "notebooks/intro.jl"
```

You can also embed notebooks that are pre-rendered, if they are hosted somewhere else:

```@pluto
pluto_notebookfile = "https://bucket1.pluto.land/n/….jl"
pluto_statefile    = "https://bucket1.pluto.land/n/….plutostate"
```

See the documentation for the full option reference and a live demo.

How it works

DocumenterPluto hooks into Documenter's expansion and build pipelines:

  1. An @pluto code block is parsed into a PlutoBlock AST node.
  2. A build step finds all notebooks, runs them using Pluto (Pluto.SessionActions.open + Pluto.notebook_to_js + Pluto.pack), and copies the notebook + .plutostate into docs/build/pluto_notebooks/.
  3. Pluto's frontend <head> assets are injected globally via Documenter.HTMLWriter.RawHTMLHeadContent.
  4. Each PlutoBlock is rendered as a <script data-pluto-file="launch-parameters"> plus a <pluto-editor> placeholder that the frontend hydrates on load.

AI disclosure

The design for this package and the required Documenter.jl PRs were made by Fons. The implementation of this package and some of the documentation is generated using AI.

About

WIP Documenter extension for displaying Pluto notebooks

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages