From 196dab8edcb329b2a685ebf10db484cfe206e62d Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Sun, 25 Oct 2026 16:30:09 +0100 Subject: [PATCH] Render code blocks with `DocumenterCodeBlocks` The plugin highlights Julia code at build time, adds linkable line numbers, and links identifiers in code blocks to their docstrings with hover tooltips. The configuration matches the one in KernelAbstractions.jl. [only docs] --- docs/Project.toml | 2 ++ docs/make.jl | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/docs/Project.toml b/docs/Project.toml index 866b320ea..cdf013c06 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,5 +1,6 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +DocumenterCodeBlocks = "b6400b83-267f-4b55-9fd8-bffc853bdfd8" oneAPI = "8f75cd03-7ff8-4ecb-9b8f-daf728133b1b" [sources] @@ -7,3 +8,4 @@ oneAPI = {path = ".."} [compat] Documenter = "1" +DocumenterCodeBlocks = "1.3" diff --git a/docs/make.jl b/docs/make.jl index d5c678302..e3e789579 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -5,6 +5,7 @@ Pkg.develop(PackageSpec(path=joinpath(dirname(@__FILE__), ".."))) Pkg.instantiate() using Documenter using Documenter.Remotes +using DocumenterCodeBlocks: CodeBlocks using oneAPI # Informational only; the docs build runs on GPU-less hosted runners, where loading @@ -17,6 +18,9 @@ end makedocs( sitename = "oneAPI.jl", + plugins = [ + CodeBlocks(; line_counter = :named), + ], format = Documenter.HTML( prettyurls = Base.get(ENV, "CI", nothing) == "true", canonical = "https://juliagpu.github.io/oneAPI.jl/stable/",