open-index/open-npm huggingface dataset:
npm package: @genexus/markdown-parser
Description: A markdown parser into a syntax tree.
Latest version: 0.3.0

# 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:

```bash
npm install @genexus/markdown-parser
```

### yarn

Run the following command in your terminal:

```bash
yarn install @genexus/markdown-parser
```

### pnpm

Run the following command in your terminal:

```bash
pnpm install @genexus/markdown-parser
```

## Exported methods

### `markdownToMdAST: (markdownToParse: string) => Root`

Turn markdown into [mdast](https://github.com/syntax-tree/mdast) using [micromark](https://github.com/micromark/micromark) via [mdast-util-from-markdown](https://github.com/syntax-tree/mdast-util-from-markdown).

This primitive also supports Github Flavored Markdown (GFM) by using [mdast-util-gfm](https://github.com/syntax-tree/mdast-util-gfm) and [micromark-extension-gfm](https://github.com/micromark/micromark-extension-gfm).

### `parseCodeToHAST: (language: string, code: string) => Root`

Turn programming code into [hast](https://github.com/micromark/micromark-extension-gfm) using [lowlight](lowlight).

This primitive also supports all programming languages from [highlight.js](https://github.com/highlightjs/highlight.js). When used at runtime, it will load on demand the programming language needed to parse the code.