Skip to content

FSharpApi

module FSharpApi
AssemblyNacara.Plugin.FSharpApi
Attributes[<RequireQualifiedAccess>]

API reference pages for F# libraries.

The pages are generated from the assemblies a library ships and go through the pipeline like any other content: same theme, same highlighting, same search index, same link checking.

Functions and values

collection<'FrontMatter> (name: string) (decoder: Decoder<'FrontMatter>) (options: FSharpApiOptions) : Collection<'FrontMatter>

A collection whose pages are the API reference.

Parameter
nameWhat you call the collection, and what a menu refers to it by.
decoderReads the front matter the plugin writes - a title, a description - into the site's own type, so these pages carry what every other page carries.
optionsWhich assemblies to read, where to publish them, what to leave out.
create (options: FSharpApiOptions) : IPlugin

The plugin itself. The collection produces the pages.

Parameter
optionsThe same options the collection was given.
exclude (value: string list) (options: FSharpApiOptions) : FSharpApiOptions

Namespaces to leave out, with everything under them.

Parameter
valueThe value to use.
optionsThe options so far.
menu (options: FSharpApiOptions) : MenuOutline

The menu of the reference, as the plugin would have it.

A package, then what it declares - the namespace level only where a package declares more than one. A theme renders this when the site has not written a menu for the section itself.

namespaces (assemblies: FSharpApiAssembly list) : FSharpApiNamespace list

The namespaces of several assemblies, one entry per package that declares one.

Parameter
assembliesWhat was read, in the order it was asked for.

Returns. One entry per namespace, its declarations sorted by name.

outline (options: FSharpApiOptions) : FSharpApiOutlinePackage list

The same, read from where the command line says the project root is.

Parameter
optionsWhich assemblies to read, and what to leave out.
outlineFrom (projectRoot: AbsolutePath) (options: FSharpApiOptions) : FSharpApiOutlinePackage list

The namespaces and what each declares, for a site building its own menu.

Names and page paths, nothing else - a menu belongs to the theme:

let rec entry (item: FSharpApiOutlineEntry) =
match item.Children with
| [] -> Menu.page item.Page
| children -> Menu.group item.Page [ for child in children -> entry child ]

Api.outline options
|> List.map (fun ns -> Menu.group ns.Page [ for item in ns.Entries -> entry item ])

A namespace offers what it declares at the top level; what a module or type declares hangs under it.

Parameter
projectRootWhat the sources' relative paths are resolved against.
optionsWhich assemblies to read, and what to leave out.
read (options: FSharpApiOptions) : FSharpApiAssembly list

What the assemblies declare, read from where the command line says.

Parameter
optionsWhich assemblies to read, and what to leave out.
readFrom (projectRoot: AbsolutePath) (options: FSharpApiOptions) : FSharpApiAssembly list

What the assemblies declare.

Parameter
projectRootWhat the sources' relative paths are resolved against.
optionsWhich assemblies to read, and what to leave out.

Returns. One entry per assembly that could be read. One that could not is left out here and reported by the collection, which has somewhere to report to.

register (options: FSharpApiOptions) (site: Site) : Site

Add the API reference to a site.

Parameter
optionsThe same options the collection was given.
siteThe site being described.
root (value: string) (options: FSharpApiOptions) : FSharpApiOptions

Route prefix the pages are published under.

Parameter
valueThe value to use.
optionsThe options so far.
sources (value: FSharpApiSource list) (options: FSharpApiOptions) : FSharpApiOptions

Set Sources.

Parameter
valueThe value to use.
optionsThe options so far.
title (value: string) (options: FSharpApiOptions) : FSharpApiOptions

Title of the page that lists the namespaces.

Parameter
valueThe value to use.
optionsThe options so far.
warnOnUndocumented (value: bool) (options: FSharpApiOptions) : FSharpApiOptions

Report a member that takes parameters and documents none of them.

Parameter
valueThe value to use.
optionsThe options so far.