/aa-jl:documenting-julia-packagefrom aa-jl
Sets up Documenter.jl documentation for a Julia package: docs/ layout, Project.toml workspace, make.jl with makedocs/deploydocs, docstring blocks, doctests, and GitHub Pages CI deployment.
Ships in aa-jl. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Documenter.jl builds a single,
cross-linked HTML site from Markdown files plus the package's docstrings, and
publishes it to GitHub Pages. This skill sets up the standard docs/ layout,
wires doctests so examples cannot go stale, and deploys on CI.
Assume the package is named MyPkg and lives at the repository root (see
[[generating-julia-package]] for the package layout). Write docstrings as
described in [[developing-julia-package]].
docs/ layoutMyPkg/
├── docs/
│ ├── Project.toml # doc-build environment
│ ├── make.jl # build script
│ └── src/
│ └── index.md # landing page (the name is mandatory for HTML output)
├── src/
│ └── MyPkg.jl
└── Project.toml
DocumenterTools.generate can create this skeleton, but hand-writing it is
simple enough for the default layout.
Julia 1.13 development baseline: add docs to the package's [workspace]
so the documentation environment resolves together with the package. Include
other development projects such as test and benchmark in the same list when
they exist:
[workspace]
projects = ["docs"] # Include "test" or "benchmark" too when those projects exist.
Declare Documenter and the local package in docs/Project.toml. Workspace
projects do not inherit the root package's dependencies:
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
MyPkg = "<UUID from the root Project.toml>"
[sources]
MyPkg = {path = ".."}
[compat]
Documenter = "1"
Resolve the doc environment from the repository root:
julia --project=docs -e 'using Pkg; Pkg.instantiate(; workspace=true)'
Do not add Documenter to the package's own [deps] — it is a doc-build
dependency, not a runtime one.
docs/make.jlusing Documenter, MyPkg
makedocs(;
sitename = "MyPkg.jl",
modules = [MyPkg],
authors = "Your Name",
pages = [
"Home" => "index.md",
"API reference" => "api.md",
],
)
deploydocs(; repo = "github.com/USER_NAME/MyPkg.jl.git")
modules = [MyPkg] tells Documenter which modules own the docstrings; that
also prevents a Base method you extend from dragging in unrelated docs.remotes = nothing, otherwise Documenter tries to build source links against
a remote that does not exist.deploydocs needs no protocol prefix in repo (no https://, no git@).deploydocs out of local builds only if you must; it is a no-op outside
CI unless it decides to deploy.docs/src/index.md is the landing page. Splice docstrings into Markdown with
@docs (one object per line), and use @meta to set the module for a page:
# MyPkg.jl
```@meta
CurrentModule = MyPkg
```
## Reference
```@docs
fit_model
FitResult
```
@autodocs includes every docstring in a module; @contents builds a
table of contents; @index builds a flat docstring index.[fit_model](@ref) and section
headings with [Home](@ref).pages argument (shown in
Step 3) and hide pages with Documenter.hide.$ julia --project=docs docs/make.jl
Output lands in docs/build/. Documenter uses pretty URLs
(src/foo.md → foo/index.html), which browsers do not resolve for local
file:// paths, so preview over HTTP instead:
$ julia -e 'using LiveServer; serve(dir="docs/build")'
# or
$ python3 -m http.server --bind localhost --directory docs/build
Add docs/build/ to .gitignore; never commit build output to the main branch.
A jldoctest block is executed and its output compared during makedocs
(failures are fatal by default). Use this for any example a reader can run:
```jldoctest
julia> 1 + 1
2
```
jldoctest mylabel) to share scope, or use setup = :(...) for short
definitions.filter = r"..." => s"..." or a page-level DocTestFilters in an @meta
block.modules.doctest(MyPkg; fix = true) (or
makedocs(; doctest = :fix)), then review the diff before committing.To run doctests as part of the normal test suite, add Documenter to the test
project (see [[testing-julia-package]]) and call doctest in
test/runtests.jl; it behaves like a @testset:
using Test, Documenter, MyPkg
@testset "MyPkg" begin
doctest(MyPkg; manual = false) # manual = false checks docstrings only
end
Run it with the other tests (see [[testing-julia-package]]).
Create .github/workflows/documentation.yml:
name: Documentation
on:
push:
branches: [main] # your development branch
tags: '*'
pull_request:
workflow_dispatch:
jobs:
build:
permissions:
contents: write # required to push to gh-pages with GITHUB_TOKEN
pull-requests: read
statuses: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: julia-actions/setup-julia@v3
with:
version: '1'
- uses: julia-actions/cache@v3
- name: Install dependencies
shell: julia --color=yes --project=docs {0}
run: |
using Pkg
Pkg.instantiate(; workspace=true)
- name: Build and deploy
run: julia --color=yes --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
gh-pages
branch (root). Documenter creates the branch on first deploy.GITHUB_TOKEN works and needs contents: write. For
tagged versions, TagBot must also be able to trigger the workflow — configure
it with an SSH deploy key (see below).DocumenterTools.genkeys(user="USER", repo="MyPkg.jl"), add the public key as
a write-enabled Deploy key on the target repository, and store the
base64-encoded private key as the DOCUMENTER_KEY repository secret on
the repository running the workflow.README.md once deployed:
[](https://USER.github.io/MyPkg.jl/stable).DOCUMENTER_KEY is an unencrypted private key granting write access to
the target repository. Never print it in logs, paste it into issues, or
commit it; store it only as an encrypted repository secret. Use the Secrets
tab (not Variables) and repository secrets (not environment secrets).makedocs and doctest execute the package's code and any code in
jldoctest blocks. Only build documentation for code you trust, and remember
the doc CI runs that code on every push.index.md. HTML output requires docs/src/index.md; other pages
are optional.makedocs's modules,
and @docs resolves names in Main unless a CurrentModule is set.remotes = nothing forgotten for a locally dev'd package, causing broken
source links.docs/build/. Gitignore it; generated files belong on
gh-pages, which Documenter manages.doctest(MyPkg; fix = true) regenerate
it, then inspect the diff; the fixer can rarely rewrite the wrong snippet.[compat] bound stops a new major release from
breaking your build unexpectedly.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
julia-docs, documenter-jl, github-pages, doctests, package-docs
Other plugins' skills for the same job
14 skills in this plugin
/auditing-julia-package-practicesUse when you review an existing or in-progress Julia package against this repository's development practices and want prioritized, evidence-based findings and concrete remediation suggestions/creating-julia-appUse when you create a CLI written in Julia packages or MCP servers/debugging-juliaUse when Julia code errors, throws an exception, produces wrong results, or crashes and you need to find the cause from the command line: capturing and reading stack traces, locating the failing method with @which/@code_warntype/@code_typed, finding potential runtime errors with JET.jl, and narrowing to a minimal reproduction/developing-julia-packageUse when you implement or edit code inside an existing Julia package: module/`include` layout, multiple dispatch, type annotations and stability, formatting, and docstrings/developing-julia-rust-bindingsUse when implementing or debugging Julia bindings to a Rust library with RustCall.jl or a native ABI. Covers memory ownership, Julia dispatch, reproducible builds, and isolating upstream failures with executable reproductions./finding-latest-julia-versionUse when you need the latest stable JuliaLang version number (e.g., to fill `VERSION=` in an install script) instead of hard-coding a valuenpx claudepluginhub atelierarith/atelier-arith-julia-development-skills --plugin aa-jl