# dst-parser

> This package contains a parser for a custom docstring syntax

Latest version **0.0.11** (published 2022-09-13) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install dst-parser
pnpm add dst-parser
yarn add dst-parser
bun add dst-parser
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.11 |
| Published | 2022-09-13 |
| First published | 2022-08-11 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 43.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | 6r1d |
| Maintainers | 6r1d |
| Keywords | documentation, parsing |

## Links

- npm: https://www.npmjs.com/package/dst-parser
- npm.io page: https://npm.io/package/dst-parser

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 0.0.11 (latest) — 2022-09-13
- 0.0.10 — 2022-09-13
- 0.0.9 — 2022-09-13
- 0.0.8 — 2022-08-19
- 0.0.7 — 2022-08-17
- 0.0.6 — 2022-08-17
- 0.0.5 — 2022-08-16
- 0.0.4 — 2022-08-16
- 0.0.3 — 2022-08-16
- 0.0.2 — 2022-08-16
- 0.0.1 — 2022-08-11

## README

# Docstring Parser

The docstring parser for C-like (including C++, JavaScript, Rust)
and Python-like syntax, where code that should be included in documentation is marked with custom comments.

## Syntax

A piece of code is considered a named fragment when it is located between `// BEGIN FRAGMENT: <name>` and `// END FRAGMENT`, `<>` not included. This syntax is case-sensitive.

Don't use special characters in names; `snakeCase` is preferrable.

Fragments can be included in one another. In that case the lines matching `// BEGIN FRAGMENT: <name>` and `// END FRAGMENT` are removed.

Elements between `// BEGIN ESCAPE` and `// END ESCAPE` are excluded unconditionally from the tutorial.

## Installation

Install the parser as a development dependency of your package:

```bash
npm install dst-parser --save-dev
```

Install the parser globally:

```bash
npm install dst-parser -g
```

## Example code

```ts
import { ExampleParser } from "dst-parser"
let text = `
// BEGIN FRAGMENT: Test
This text is displayed
// BEGIN ESCAPE
OR IS IT?
// END ESCAPE
// END FRAGMENT
`
let parser_inst = new ExampleParser(text)
console.log(parser_inst.mapLines())
```

---
_Source: https://npm.io/package/dst-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
