Skip to content

fir.generic.emit.markdown

An emitter that works with a GenericAST and turns it into markdown.

API

This is the API provided to work with the generic markdown emitter.

Element Summary
Functions
emit Emits Markdown from a GenericAST
emitDescription Emits Markdown from the description of an element.
emitSection Emits Markdown from a GenericSection
listAllSymbols Locates all symbols in an AST
replaceSymbols Returns a string with the symbol syntax replaced with its documentation location

emit 

:: ast:GenericAST, options:table -> markdown:string

Emits Markdown from a GenericAST

  • tabs:table: Adds tabbed syntax to the final output.
    • use:boolean|"docsify"|"pymdownx" (false): Outputs tab syntax, either docsify-tabs or pymdownx.tabbed.
    • docsify_header:string ("####"): Unused. Headers to use for docsify-tabs.
  • all:boolean (false): Also emits hidden elements.
  • sections:table: Settings for sections.
  • columns:table: Settings for columns.
    • [n]:table: (where n can be any number or "*"). Specifies the column names for section n (with fallback).
      • [1]:string ("Element") - Left column
      • [2]:string ("Summary") - Right column
  • types:table: Aliases for types.
    • [type]:string: (where type can be any of the types supported by GenericAST). Default values include type=Types and function=Functions among others.
  • symbols:{string:string}: Map of symbols to their documentation locations
  • symbols_in_code:boolean|'mkdocs' (false): Whether to link symbols inside code. Only supports MkDocs.

emitDescription 

:: desc:[DescriptionLine], options:table -> markdown:string

Emits Markdown from the description of an element.

  • tabs:table: Adds tabbed syntax to the final output.
    • use:boolean|"docsify"|"pymdownx" (false): Outputs tab syntax, either docsify-tabs or pymdownx.tabbed.
    • docsify_header:string ("####"): Headers to use for docsify-tabs.
  • symbols:{string:string}: Map of symbols to their documentation location
  • symbols_in_code:boolean|'mkdocs' (false): Whether to link symbols inside code. Only supports MkDocs.

Recognized options

  • headerOffset:number (1): Offsets the header levels by n

emitSection 

:: section:GenericSection, options:table -> markdown:string

Emits Markdown from a GenericSection

listAllSymbols 

:: ast:GenericAST -> {[symbol: string]: location:string}

Locates all symbols in an AST

  • module:string: Module string to use
  • url_prefix:string: Prefix of all documentation urls

replaceSymbols 

:: str:string, symbols:{string:string} -> str:string

Returns a string with the symbol syntax replaced with its documentation location

<symbol>