Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 1.24 KB

README.md

File metadata and controls

23 lines (16 loc) · 1.24 KB

Parser Enhancements

The parser-enhancements directory is intended for use augmenting data before being parsed.

It is the second stage of the transformation from a document type (e.g. Textile) to a documentation page.

Compare

  1. Pre-parser - transforms plain text to plain text ready to be parsed.
  2. Post-parser - transforms data after it has been parsed by a dedicated parser such as textile-js.
  3. HTML Parser - for HTML manipulations that are too complex for string manipulation or the front-end.
  4. Component mapping - maps { data, type } objects to React components based on type.
  5. React components - standardise the behaviour, presentation, layout and markup semantics of data from { data, type } objects.

Usage

It is a good place to put:

  • Augmentations based on article meta-data such as document path, frontmatter attributes
  • Augmentations based on application meta-data/config such as .yaml files

It is not the best place to put:

  • Transformations designed to fix issues or make the text easier to understand; put these in pre- or post-parser
  • Alterations to presentation and design - put these in component mapping or React components