@genexus/markdown-parser
v0.1.1
Published
A markdown parser into a syntax tree.
Downloads
626
Keywords
Readme
GeneXus Markdown Parser
This project provides several methods to parse markdown into a syntax tree. It is written in TypeScript, which allows for static typing and better code organization.
Installation
To install the dependencies for this project, you can use one of the following package managers: npm
, yarn
, or pnpm
. Choose the one you are most comfortable with and follow the instructions below:
npm
Run the following command in your terminal:
npm install @genexus/markdown-parser
yarn
Run the following command in your terminal:
yarn install @genexus/markdown-parser
pnpm
Run the following command in your terminal:
pnpm install @genexus/markdown-parser
Exported methods
markdownToMdAST: (markdownToParse: string) => Root
Turn markdown into mdast using micromark via mdast-util-from-markdown.
This primitive also supports Github Flavored Markdown (GFM) by using mdast-util-gfm and micromark-extension-gfm.
parseCodeToHAST: (language: string, code: string) => Root
Turn programming code into hast using lowlight.
This primitive also supports all programming languages from highlight.js. When used at runtime, it will load on demand the programming language needed to parse the code.