API Reference
Plugin
DocumenterCopyButton.CopyButton — Type
CopyButton(; providers=nothing, prompt="Read", copy_label="Copy for AI")A [Documenter.Plugin] that adds floating "Copy as Markdown" and "Open in AI" buttons to opted-in documentation pages.
Pages opt in by including a @copybutton block in their markdown source.
Keyword Arguments
providers: A list of AI providers for the "Open in AI" dropdown. Defaults toDEFAULT_PROVIDERS. Each element can be:- A
Providerinstance - A
name => base_urlpair (suffix defaults to"") - A
name => (base_url, suffix)pair
- A
prompt: A prefix string prepended to the URL when opening in an AI provider. Defaults to"Read".copy_label: Label text for the copy button. Defaults to"Copy for AI".
Example
using DocumenterCopyButton: CopyButton
makedocs(;
plugins = [CopyButton()],
# ...
)Custom providers:
CopyButton(providers = [
"Claude" => "https://claude.ai/new?q=",
"MyAI" => ("https://myai.com/?q=", "&extra=1"),
])DocumenterCopyButton.Provider — Type
Provider(name, base_url, suffix)An AI provider configuration for the "Open in AI" dropdown.
Fields
name::String: Display name shown in the dropdown (e.g."Claude")base_url::String: Base URL for the provider, to which the encoded query is appendedsuffix::String: Optional suffix appended after the encoded query (e.g."&hints=search")
DocumenterCopyButton.DEFAULT_PROVIDERS — Constant
DEFAULT_PROVIDERSDefault list of AI providers included in the "Open in AI" dropdown: Claude, ChatGPT, Perplexity, Grok, T3, v0, Cursor, and Zed.
At-Block
DocumenterCopyButton.CopyButtonBlocks — Type
@copybuttonA Documenter at-block that opts a page into the copy button feature.
The block content is an optional path to the source file that should be served to users when they click "Copy as Markdown." The path is relative to the doc root (e.g. src/tutorial.md). If the block is empty, it defaults to the page's own markdown source.
Usage
Opt in with the page's own source (most common):
```@copybutton
```Opt in with a specific source file (e.g. a Literate.jl script):
```@copybutton
literate/tutorials/first_gate.jl
```