Module rst

This module implements a reStructuredText parser. A large subset is implemented. Some features of the markdown wiki syntax are also supported.

Types

TRstParseOption = enum 
  roSkipPounds,               ## skip ``#`` at line beginning (documentation
                              ## embedded in Nimrod comments)
  roSupportSmilies,           ## make the RST parser support smilies like ``:)``
  roSupportRawDirective,      ## support the ``raw`` directive (don't support
                              ## it for sandboxing)
  roSupportMarkdown           ## support additional features of markdown
options for the RST parser
TRstParseOptions = set[TRstParseOption]
TMsgClass = enum 
  mcHint = "Hint", mcWarning = "Warning", mcError = "Error"
TMsgKind = enum 
  meCannotOpenFile, meExpected, meGridTableNotImplemented, meNewSectionExpected, 
  meGeneralParseError, meInvalidDirective, mwRedefinitionOfLabel, 
  mwUnknownSubstitution, mwUnsupportedLanguage
the possible messages
TMsgHandler = proc (filename: string; line, col: int; msgKind: TMsgKind; 
                    arg: string) {.nimcall.}
what to do in case of an error
TFindFileHandler = proc (filename: string): string {.nimcall.}
EParseError = object of EInvalidValue

Procs

proc whichMsgClass(k: TMsgKind): TMsgClass {.raises: [], tags: [].}
returns which message class k belongs to.
proc defaultMsgHandler(filename: string; line, col: int; msgkind: TMsgKind; 
                       arg: string) {.procvar, raises: [EInvalidValue, 
    EParseError, EIO], tags: [FWriteIO].}
proc defaultFindFile(filename: string): string {.procvar, raises: [], 
    tags: [FReadDir].}
proc addNodes(n: PRstNode): string {.raises: [], tags: [].}
proc rstnodeToRefname(n: PRstNode): string {.raises: [], tags: [].}
proc getFieldValue(n: PRstNode; fieldname: string): string {.raises: [], 
    tags: [].}
proc getArgument(n: PRstNode): string {.raises: [], tags: [].}
proc rstParse(text, filename: string; line, column: int; hasToc: var bool; 
              options: TRstParseOptions; findFile: TFindFileHandler = nil; 
              msgHandler: TMsgHandler = nil): PRstNode {.raises: [E_Base], 
    tags: [TEffect, FReadEnv].}
Generated: 2014-10-20 01:45:14 UTC