AgentFriendly
module AgentFriendly| Assembly | Partas.Nacara.Plugins.AgentFriendly |
| Attributes | [<RequireQualifiedAccess>] |
A Nacara site agents can read: an llms.txt index, an llms-full.txt of every page, and a markdown copy of each page beside its html.
Follows the llms.txt proposal. The markdown is the page as authored, front matter stripped and its title restored as a heading, which is easier for a model to read than the rendered html and far shorter.
Functions and values
[<Literal>] DescriptionKey: string = "agent-friendly.description"
[<Literal>] DescriptionKey: string = "agent-friendly.description"Where a page's description is stored on it, as a string option.
agentPages (site: SiteInfo) (options: AgentFriendlyOptions) (pages: Page list) : AgentPage list
agentPages (site: SiteInfo) (options: AgentFriendlyOptions) (pages: Page list) : AgentPage listThe pages the plugin publishes, with where each is read.
| Parameter | |
|---|---|
site | For the urls. |
options | What to leave out, and which formats get a markdown copy. |
pages | Every page of the build. |
alternate (value: bool) (options: AgentFriendlyOptions) : AgentFriendlyOptions
alternate (value: bool) (options: AgentFriendlyOptions) : AgentFriendlyOptionsPoint each page's head at its markdown copy.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
createWith (configure: AgentFriendlyOptions -> AgentFriendlyOptions) : IPlugin
createWith (configure: AgentFriendlyOptions -> AgentFriendlyOptions) : IPluginAn agent-friendly site, configured.
| Parameter | |
|---|---|
configure | Given the defaults, the options to use. |
defaults: AgentFriendlyOptionsdescriptionKeys (value: string list) (options: AgentFriendlyOptions) : AgentFriendlyOptions
descriptionKeys (value: string list) (options: AgentFriendlyOptions) : AgentFriendlyOptionsThe front matter keys a page's description is read from.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
details (value: string) (options: AgentFriendlyOptions) : AgentFriendlyOptions
details (value: string) (options: AgentFriendlyOptions) : AgentFriendlyOptionsMarkdown placed after the summary in llms.txt.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
excludeCollections (value: string list) (options: AgentFriendlyOptions) : AgentFriendlyOptions
excludeCollections (value: string list) (options: AgentFriendlyOptions) : AgentFriendlyOptionsCollections to leave out of everything.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
formats (value: string list) (options: AgentFriendlyOptions) : AgentFriendlyOptions
formats (value: string list) (options: AgentFriendlyOptions) : AgentFriendlyOptionsSource formats whose pages are published as markdown too.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
llmsFullTxt (site: SiteInfo) (options: AgentFriendlyOptions) (pages: AgentPage list) : string
llmsFullTxt (site: SiteInfo) (options: AgentFriendlyOptions) (pages: AgentPage list) : stringEvery page with a markdown copy, one after another, for an agent that wants it all.
| Parameter | |
|---|---|
site | Its title, for the heading. |
options | The sections, which order the pages as llms.txt does. |
pages | What to include. Pages without a markdown copy are skipped. |
llmsFullTxtPath (value: string option) (options: AgentFriendlyOptions) : AgentFriendlyOptions
llmsFullTxtPath (value: string option) (options: AgentFriendlyOptions) : AgentFriendlyOptionsWhere llms-full.txt is written, or None for none.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
llmsTxt (site: SiteInfo) (options: AgentFriendlyOptions) (pages: AgentPage list) : string
llmsTxt (site: SiteInfo) (options: AgentFriendlyOptions) (pages: AgentPage list) : stringThe llms.txt index of a site.
| Parameter | |
|---|---|
site | Its title and description. |
options | The summary, details and sections. |
pages | What to list. |
llmsTxtPath (value: string option) (options: AgentFriendlyOptions) : AgentFriendlyOptions
llmsTxtPath (value: string option) (options: AgentFriendlyOptions) : AgentFriendlyOptionsWhere the llms.txt index is written, or None for none.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
markdown (page: AgentPage) : string
markdown (page: AgentPage) : stringA page as a markdown document of its own.
The title is restored as a heading unless the body opens with one, and the description follows it as a quote.
| Parameter | |
|---|---|
page | What to write. |
markdownCopies (value: bool) (options: AgentFriendlyOptions) : AgentFriendlyOptions
markdownCopies (value: bool) (options: AgentFriendlyOptions) : AgentFriendlyOptionsWrite a markdown copy of each page beside its html.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
markdownPath (route: Route) : string
markdownPath (route: Route) : stringWhere a page's markdown copy goes, relative to the output.
guide/setup/index.html becomes guide/setup.md and the home page's index.html becomes index.md.
| Parameter | |
|---|---|
route | The page's route. |
registerWith (configure: AgentFriendlyOptions -> AgentFriendlyOptions) (site: Site) : Site
registerWith (configure: AgentFriendlyOptions -> AgentFriendlyOptions) (site: Site) : SiteMake a site agent-friendly, configured.
| Parameter | |
|---|---|
configure | Given the defaults, the options to use. |
site | The site being described. |
section (value: Page -> string) (options: AgentFriendlyOptions) : AgentFriendlyOptions
section (value: Page -> string) (options: AgentFriendlyOptions) : AgentFriendlyOptionsThe heading a page is listed under in llms.txt.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
summary (value: string) (options: AgentFriendlyOptions) : AgentFriendlyOptions
summary (value: string) (options: AgentFriendlyOptions) : AgentFriendlyOptionsThe line quoted under the title of llms.txt.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |