Partas.Nacara.Plugins
Plugins and a documentation theme for Nacara, the F# static site generator whose site is an F# program. Each package is independent — take the one you want.
New here? Start with getting started.
Write your own ::: blocks
Partas.Nacara.Plugins.Directives turns a fenced block into a typed F# function: a decoder for the arguments on the opening line, a render function for the result. Arguments arrive typed, nested directives read their parents by type, and a broken one is loud rather than silent.
::::steps
:::step title="Install"
Add the package.
:::
::::
Style the theme without fighting it
Partas.Nacara.Theme is the documentation theme this site is built with. Its stylesheet is a list of named CSS cascade layers rather than one file, so replacing, dropping or reordering a part is a line of F# and order decides ties instead of specificity.
Theme.defaults
|> Theme.replaceLayer "components" myCss
|> Theme.layerAfter "components" "widgets" widgetCss
Its design tokens are a record rather than a stylesheet, so a colour is changed by name and a name that does not exist does not compile:
Theme.defaults
|> Theme.lightTokens (fun tokens -> { tokens with Primary = "#c0392b" })
|> Theme.darkTokens (fun tokens -> { tokens with Primary = "#e74c3c" })
→ Theme
Let plugins contribute styles
Partas.Nacara.Theme.Contracts is what a theme and a styling plugin agree on, in a package that depends on nothing so neither side depends on the other. A plugin offers a cascade layer; the theme bundles it.
PluginLayers.offer { Name = "directives"; Css = myCss }
CSS tooling
Partas.Nacara.Plugins.Tailwind runs Tailwind over the built site and orders its output against the theme's layers. Partas.Nacara.Plugins.DaisyUI adds DaisyUI on top of it, so class="btn" works in your markdown:
Link previews
Partas.Nacara.Plugins.OgImage gives every page an og:image: named in its front matter, or falling back to one you configure for a section or the whole site.
og_image: /images/release.png
og_image_alt: The 2.0 banner
Readable by agents
Partas.Nacara.Plugins.AgentFriendly publishes an llms.txt index, an llms-full.txt, and a markdown copy of every page beside its html. This site has them: llms.txt.
Licensing
Most of this repository is MIT. Partas.Nacara.Theme is a derivative work of Nacara.Theme.Default and is Apache-2.0 — see LICENSE and NOTICE in the repository.