Skip to content

FrontMatterFormat

type FrontMatterFormat =
    {
        Name: string
        Extensions: string list
        Opening: string
        Closing: string
        Wrapper: (string * string) option
    }
AssemblyNacara.Core

How files of some kind carry their front matter.

Markdown puts the block at the top of the file; an F# source file puts it in the comment the file opens with, because a file that starts with --- does not compile.

Fields

Name: string

Reported when two formats claim the same extension.

Extensions: string list

Extensions this applies to, lowercase and dotted.

Opening: string

The line that opens the front matter block itself.

Closing: string

The line that closes it.

Wrapper: (string * string) option

The block that holds the front matter, when it cannot sit at the top of the file on its own.

An F# source puts it inside the comment the file opens with, since a file starting with --- does not compile:

(**            <- Wrapper, opening
---            <- Opening
title: Demo
---            <- Closing
*)             <- Wrapper, closing

The body is everything after the wrapper, so the code below it is left intact.