From 2da7551baf98cc5a983b001be1a760cee4ddd37e Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Sun, 25 Oct 2026 16:30:08 +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 43ecaaee1..857d31ec4 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,5 +1,7 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +DocumenterCodeBlocks = "b6400b83-267f-4b55-9fd8-bffc853bdfd8" [compat] Documenter = "1.8" +DocumenterCodeBlocks = "1.3" diff --git a/docs/make.jl b/docs/make.jl index a37b0cd9b..1ef49403d 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,8 +1,12 @@ using Documenter, GPUArrays +using DocumenterCodeBlocks: CodeBlocks function main() makedocs( modules = [GPUArrays], + plugins = [ + CodeBlocks(; line_counter = :named), + ], format = Documenter.HTML( # Use clean URLs on CI prettyurls = get(ENV, "CI", nothing) == "true",