Skip to content

fir.generic.backend

A generic implementation of a backend for the Fir documentation generator.

This specific implementation uses a language module (defaults to fir.generic.languages) to parse comments from any file.

Check out an example output of this backend here.

API

This is the API provided to work with the generic backend.

Element Summary
Functions
extract Extracts comment from a string separated by newlines.
Types
GenericComment Comment returned by extract.
Language Language type accepted by extract.

extract 

:: input:string, language?:Language, options?:table -> comments:[GenericComment]

Extracts comment from a string separated by newlines.

  • patterns:boolean (false): Whether to use patterns for the language fields and ignore string or not.
  • ignore:string ("///"): String used to determine when to start or stop ignoring comments.
  • merge:boolean (true): Whether to merge adjacent single-line comments.
  • paragraphs:boolean (true): Whether to split multi-line comments by empty strings ("").

GenericComment 

Comment returned by extract.

GenericComment {
  start   :: number
  end     :: number
  content :: [string]
}

Language 

Language type accepted by extract.

Language {
  single     :: string
  multi      :: [string]
  extensions :: [string]
}