User Guide
Usage Examples
Basic Usage (No Deployment)
For local documentation only:
using PkgTemplates
using PkgTemplatesShikiPlugin
t = Template(;
user="YourUsername",
plugins=[DocumenterShiki()] # Defaults to NoDeploy
)
t("MyPackage")
Configuration Options
The DocumenterShiki constructor accepts the following options:
theme::String: Light theme (default:"github-light")dark_theme::String: Dark theme (default:"github-dark")languages::Vector{String}: Programming languages to support (default:["julia", "javascript", "python", "bash", "json", "yaml", "toml"])cdn_url::String: CDN URL for Shiki (default:"https://esm.sh")assets::Vector{String}: Additional asset files to copylogo::Logo: Documentation logo (light and dark variants)makedocs_kwargs::Dict{Symbol,Any}: Additional arguments formakedocs()devbranch::String: Development branch nameedit_link::Union{String,Symbol}: Edit link type
See available Shiki themes for theme options.
Deployment Types
DocumenterShiki supports the same deployment types as the standard Documenter plugin:
DocumenterShiki()orDocumenterShiki{NoDeploy}(): Local documentation only ✅ TestedDocumenterShiki{GitHubActions}(): Deploy to GitHub Pages via GitHub Actions SupportedDocumenterShiki{TravisCI}(): Deploy to GitHub Pages via Travis CI SupportedDocumenterShiki{GitLabCI}(): Deploy to GitLab Pages via GitLab CI Supported
Note: When using deployment types other than NoDeploy, you must include the corresponding CI plugin in your template.
Example (NoDeploy - tested):
using PkgTemplates
using PkgTemplatesShikiPlugin
t = Template(;
user="YourUsername",
plugins=[DocumenterShiki()]
)
t("MyPackage")
Comparison with Standard Documenter
| Feature | Documenter | DocumenterShiki |
|---|---|---|
| Syntax Highlighting | highlight.js | Shiki (VS Code engine) |
| Theme Quality | Basic | Professional, consistent |
| Theme Customization | Limited | 100+ themes available |
| Language Support | Good | Excellent (240+ languages) |
| Dark Mode | Manual | Automatic switching |
| Setup Complexity | Low | Low (automatic) |
| Build Speed | Fast | Fast (CDN-based) |
Requirements
- Julia 1.8 or later
- PkgTemplates 0.7 or later
- Node.js 18+ (for building documentation)
- pnpm or npm (for Shiki dependencies)
Generated Package Structure
When you generate a package with DocumenterShiki, it creates:
MyPackage/
├── docs/
│ ├── make.jl # Documentation build script
│ ├── ShikiHighlighter.jl # Shiki integration module
│ └── src/
│ └── index.md # Documentation homepage
├── package.json # Node.js dependencies
├── build-shiki.js # Shiki build script
└── ...Building Documentation
In the generated package:
# Install Node.js dependencies
pnpm install
# Build documentation
julia --project=docs docs/make.jl
Live Examples
To see Shiki syntax highlighting in action with various themes and languages, visit the DocumenterShikiDemo showcase.
The demo includes:
- Interactive theme switching
- Copy-to-clipboard functionality
- Real-world code examples
This demo site was itself generated using PkgTemplatesShikiPlugin! See GENERATION.md for the exact template command used to generate the package skeleton.