Skip to content

AgentFriendly

module AgentFriendly
AssemblyPartas.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"

Where a page's description is stored on it, as a string option.

agentPages (site: SiteInfo) (options: AgentFriendlyOptions) (pages: Page list) : AgentPage list

The pages the plugin publishes, with where each is read.

Parameter
siteFor the urls.
optionsWhat to leave out, and which formats get a markdown copy.
pagesEvery page of the build.
alternate (value: bool) (options: AgentFriendlyOptions) : AgentFriendlyOptions

Point each page's head at its markdown copy.

Parameter
valueThe value to use.
optionsThe options so far.
alternateLink (url: string) : string

The tag pointing a page's head at its markdown copy.

create () : IPlugin

An agent-friendly site, with the default options.

createWith (configure: AgentFriendlyOptions -> AgentFriendlyOptions) : IPlugin

An agent-friendly site, configured.

Parameter
configureGiven the defaults, the options to use.
descriptionKeys (value: string list) (options: AgentFriendlyOptions) : AgentFriendlyOptions

The front matter keys a page's description is read from.

Parameter
valueThe value to use.
optionsThe options so far.
details (value: string) (options: AgentFriendlyOptions) : AgentFriendlyOptions

Markdown placed after the summary in llms.txt.

Parameter
valueThe value to use.
optionsThe options so far.
excludeCollections (value: string list) (options: AgentFriendlyOptions) : AgentFriendlyOptions

Collections to leave out of everything.

Parameter
valueThe value to use.
optionsThe options so far.
formats (value: string list) (options: AgentFriendlyOptions) : AgentFriendlyOptions

Source formats whose pages are published as markdown too.

Parameter
valueThe value to use.
optionsThe options so far.
llmsFullTxt (site: SiteInfo) (options: AgentFriendlyOptions) (pages: AgentPage list) : string

Every page with a markdown copy, one after another, for an agent that wants it all.

Parameter
siteIts title, for the heading.
optionsThe sections, which order the pages as llms.txt does.
pagesWhat to include. Pages without a markdown copy are skipped.
llmsFullTxtPath (value: string option) (options: AgentFriendlyOptions) : AgentFriendlyOptions

Where llms-full.txt is written, or None for none.

Parameter
valueThe value to use.
optionsThe options so far.
llmsTxt (site: SiteInfo) (options: AgentFriendlyOptions) (pages: AgentPage list) : string

The llms.txt index of a site.

Parameter
siteIts title and description.
optionsThe summary, details and sections.
pagesWhat to list.
llmsTxtPath (value: string option) (options: AgentFriendlyOptions) : AgentFriendlyOptions

Where the llms.txt index is written, or None for none.

Parameter
valueThe value to use.
optionsThe options so far.
markdown (page: AgentPage) : string

A 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
pageWhat to write.
markdownCopies (value: bool) (options: AgentFriendlyOptions) : AgentFriendlyOptions

Write a markdown copy of each page beside its html.

Parameter
valueThe value to use.
optionsThe options so far.
markdownPath (route: Route) : string

Where 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
routeThe page's route.
register (site: Site) : Site

Make a site agent-friendly.

registerWith (configure: AgentFriendlyOptions -> AgentFriendlyOptions) (site: Site) : Site

Make a site agent-friendly, configured.

Parameter
configureGiven the defaults, the options to use.
siteThe site being described.
section (value: Page -> string) (options: AgentFriendlyOptions) : AgentFriendlyOptions

The heading a page is listed under in llms.txt.

Parameter
valueThe value to use.
optionsThe options so far.
sectionOf (page: Page) : string

The default Section: the route's first segment, or Pages.

summary (value: string) (options: AgentFriendlyOptions) : AgentFriendlyOptions

The line quoted under the title of llms.txt.

Parameter
valueThe value to use.
optionsThe options so far.