API
DocumenterDescriptions.AbstractDescriber — Typeabstract type AbstractDescriberAbstract supertype for all describer plugins.
Interface
(plugin::YourDescriber)(flattened_text::String)::String: Obtain the description of a page as a string, return it as a String.(::Type{YourDescriber})(): There should be a no-argument constructor.
Optionally, you can hook into the more descriptive API by defining (plugin::YourDescriber)(page, doc)::String.
DocumenterDescriptions.FirstNCharsDescriber — TypeFirstNCharsDescriber(; nchars = 160, approx = true) <: AbstractDescriberA describer that takes the first nchars characters of text.
Arguments
nchars::Int = 160: The target number of characters to include in the descriptionapprox::Bool = true: If true, will try to break at word boundaries rather than exactly atncharscharacters
Details
When approx=true, the describer will attempt to break at word boundaries to avoid cutting words in half. It will return slightly fewer characters than requested to ensure this. If approx=false, it will break exactly at nchars characters.
If the input text is shorter than nchars, the entire text is returned.
The text is preprocessed to collapse multiple whitespace characters into single spaces and trim leading/trailing whitespace.
DocumenterDescriptions.WriteToFile — TypeWriteToFile(describer) <: AbstractDescriberWraps another describer, and writes the generated description to the source file.
Useful if you're running an LLM to generate summaries and want to minimize cost!
Construct the object and pass it to the plugin kwarg of makedocs.
This will write to files - but if you're running this in a CI pipeline, then that won't propagate the changes to the branch or PR.
If you're running this locally, then it's fine - just remember to commit the changes.
Also, this won't work for generated files.
Arguments
describer: The describer to use to generate the description.