Options
All
  • Public
  • Public/Protected
  • All
Menu

Create Markup Parser

Building your markup language was never been that easy. This library is built using Non-deterministic Finite Automata concepts in mind, which simplifies the readability and maintainability of the source code.

Usage

yarn add create-markup-parser
# or
npm install create-markup-parser

Importing library

You can import the generated bundle to use the whole library generated by this starter:

import { createMarkupParser } from 'create-markup-parser'

// Create custom markup parser
const parser = createMarkupParser({
  '^': character => character.toUpperCase(),
  _: character => character.toLowerCase(),
  '#': () => undefined
})

const input = 'Hello ^dear^. Good to see _YOU_ #again#'
const output = parser.parse(input)

console.log(output) // Hello DEAR. Good to see you

Index

Type aliases

State

State: string

Transformer

Transformer: function

Transformer function responsible for transforming every single character

param

Character from the text that has to be parsed

Type declaration

    • (character: string): string | undefined
    • Parameters

      • character: string

      Returns string | undefined

Functions

createMarkupParser

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc