# mdast-directive-comment

> Helper function for creating plugin to process directive-comments

Latest version **0.1.2** (published 2017-07-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install mdast-directive-comment
pnpm add mdast-directive-comment
yarn add mdast-directive-comment
bun add mdast-directive-comment
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2017-07-03 |
| First published | 2017-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Masayuki Izumi |
| Maintainers | izumin5210 |
| Keywords | markdown, mdast, plugin, remark |

## Links

- npm: https://www.npmjs.com/package/mdast-directive-comment
- Repository: https://github.com/izumin5210/OHP
- Issues: https://github.com/izumin5210/OHP/issues
- npm.io page: https://npm.io/package/mdast-directive-comment

## Dependencies (2)

- [unist-util-visit](https://npm.io/package/unist-util-visit.md) ^1.1.3
- [mdast-comment-marker](https://npm.io/package/mdast-comment-marker.md) ^1.0.2

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.1.2 (latest) — 2017-07-03
- 0.1.1 — 2017-06-05

## README

![OHP - OHP is Hacker's Presentation writer with Markdown and CSS](./docs/visual.png)

# OHP
[![Build Status](https://travis-ci.org/izumin5210/OHP.svg?branch=master)](https://travis-ci.org/izumin5210/OHP)
[![MIT License](https://img.shields.io/github/license/izumin5210/OHP.svg)][license]

OHP is Hacker's Presentation writer with Markdown and CSS


## Usage
### Frontmatter
- `fontSize` (`number?`) - Font size (default: `36`)
- `page` - Default configuration for each pages
    - `className` (`string?`) - Default class(es)
- `pageNumber` - Default configuration for page numbers
    - `enable` (`boolean?`) - Whether to render the page numbers (default: `false`)
    - `className` (`string?`) - Class(es) of page number elements (default: `pageNumber`)
    - `number` (`number?`) - Pgae number for the first page (default: `1`)

#### Example
```markdown
---
fontSize: 32
page:
  className: page
pageNumber:
  enable: true
---

# Title
```

### Comment directives
#### `<!-- newpage -->`
##### Example
```markdown
# Page 1

<!-- newpage -->

# Page 2
```


#### `<!-- page [options] -->`
##### `options`
- `className` (`string?`) - Class(es) of the page element

#### Example
```markdown
<!-- page className="title" -->
# Title

<!-- newpage -->
<!-- page className="toc" -->
# Table of Contents
```

#### `<!-- pageNumber [options] -->`
##### `options`
- `enable` (`boolean?`) - Whether to render the page number to the current page
- `className` (`string?`) - Class(es) of the page number element
- `number` (`number?`) - Number to render to this page

##### Example
```markdown
<!-- pageNumber enable=false -->
# Title

<!-- newpage -->
<!-- pageNumber number=1 className="toc__pageNumber" -->
# Table of Contents
```

### Keyboard Shortcuts

| Windows/Linux | Mac | Action |
| --- | --- | --- |
| <kbd>Ctrl</kbd>+<kbd>Enter</kbd> | <kbd>Cmd</kbd>+<kbd>Enter</kbd> | Insert `<!-- newpage -->` |


## Sample

- [[source](https://gist.github.com/izumin5210/b4a61ed5003b1666dfe8ecd5baf683f1)] [Performance of rendering over 10k items using React // Speaker Deck](https://speakerdeck.com/izumin5210/performance-of-rendering-over-10k-items-using-react)


## Development
```
# Run `yarn install` and `lerna bootstrap`
$ yarn bootstrap

# Start webpack-dev-server and electron
$ yarn start:dev

# Or, run `yarn start:dev:app` and `yarn start:dev:server`
```


## License
Licensed under [MIT License][license].

[license]: ./LICENSE

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