open-index/open-npm huggingface dataset:
npm package: @gerhobbelt/jison2json
Description: Converts jison grammar definitions to JSON
Author: Zach Carter
Latest version: 0.6.1-215

# jison2json


[![build status](https://secure.travis-ci.org/GerHobbelt/jison2json.png)](http://travis-ci.org/GerHobbelt/jison2json)


[jison](http://jison.org) grammars come in two formats: JSON or a special text format similar to Bison's. This utility converts from the jison's format to JSON. See the [json2jison](https://github.com/zaach/json2jison) for the reverse conversion.


## install

    npm install @gerhobbelt/jison2json -g



## build

Follow the install & build directions of the monorepo.
    
You can also only build this particular subpackage by `cd`-ing into this directory
and then invoking the local make:
    
    cd packages/jison2json
    make

This will generate the rollup/babel-postprocessed ES6 and ES5 
compatible libraries in the local `dist/` directory.



## usage

    # single grammar
    jison2json grammar.y

    # or separate grammars
    jison2json grammar.y lex.l

Or require it and convert programatically:

    var jison2json = require('@gerhobbelt/jison2json');
    var grammar = "%% foo: bar { return true; };";

    var json = jison2json.convert(grammar);


## license

MIT
npm package: @gerhobbelt/json2jison
Description: Converts json grammar definitions to jison's own format
Author: Zach Carter
Latest version: 0.6.1-215

# json2jison


[![build status](https://secure.travis-ci.org/GerHobbelt/json2jison.png)](http://travis-ci.org/GerHobbelt/json2jison)


[jison](http://jison.org) grammars come in two formats: JSON or a special text format similar to Bison's. This utility converts from the JSON format to jison's text format. See the [jison2json](https://github.com/zaach/jison2json) utility for the reverse conversion.


## install

    npm install @gerhobbelt/json2jison -g



## build

Follow the install & build directions of the monorepo.
    
You can also only build this particular subpackage by `cd`-ing into this directory
and then invoking the local make:
    
    cd packages/json2jison
    make

This will generate the rollup/babel-postprocessed ES6 and ES5 
compatible libraries in the local `dist/` directory.



## license

MIT
npm package: @gerhobbelt/keyscss
Description: A simple stylesheet to render beautiful keyboard-styled elements.
Author: Michael Hüneburg
Latest version: 1.1.3-6

# <kbd>K</kbd><kbd>E</kbd><kbd>Y</kbd><kbd>S</kbd>.less

<link rel="stylesheet" href="keys-readme.css" type="text/css" />

A simple stylesheet to render beautiful keyboard-styled elements.

## Usage

Download the stylesheet and include it via

```html
<link rel="stylesheet" href="keys.css" type="text/css" />
```

The stylesheet comes with two classes for light and dark keys for good visibility on every background. Since most websites have light backgrounds, the dark style is the default.

```html
<!-- Dark keys: -->
<kbd>ctrl</kbd> + <kbd>S</kbd>
```

<kbd>ctrl</kbd> + <kbd>S</kbd>



```html
<!-- ...or... -->
<kbd class="dark">ctrl</kbd> + <kbd class="dark">S</kbd>
```

<kbd class="dark">ctrl</kbd> + <kbd class="dark">S</kbd>



```html
<!-- ...or... -->
<span class="dark-keys">
    <kbd>ctrl</kbd> + <kbd>S</kbd>
</span>
```

<span class="dark-keys">
    <kbd>ctrl</kbd> + <kbd>S</kbd>
</span>



```html
<!-- Light keys: -->
<kbd class="light">ctrl</kbd> + <kbd class="light">S</kbd>
```

<kbd class="light">ctrl</kbd> + <kbd class="light">S</kbd>



```html
<!-- ...or... -->
<span class="light-keys">
    <kbd>ctrl</kbd> + <kbd>S</kbd>
</span>
```

<span class="light-keys">
    <kbd>ctrl</kbd> + <kbd>S</kbd>
</span>



```html
<!-- StackOverflow-styled keys: -->
<kbd class="so">ctrl</kbd> + <kbd class="so">S</kbd>
```

<kbd class="so">ctrl</kbd> + <kbd class="so">S</kbd>



```html
<!-- ...or... -->
<span class="so-keys">
    <kbd>ctrl</kbd> + <kbd>S</kbd>
</span>
```

<span class="so-keys">
    <kbd>ctrl</kbd> + <kbd>S</kbd>
</span>



That's all. The size of the keys depends on the set `font-size`.



## Usage for LESS users

Import the LESS macros in your project like this:

```less
@import "node_modules/keyscss/keys-macros";
```

Three macro's (a.k.a. "mixins") are defined:

- `.keycap()` : this is the base mixin which defines the key shape
- `.keycap-dark()` : this is the 'dark theme' for the keys
- `.keycap-light()` : this is the 'light theme' for the keys

You can use these macros in your own LESS stylesheets like this, for example to style all `<KBD>` tags in your HTML:

```less
kbd
{
    .keycap-light();

    // override the padding defined by the mixin:
    padding: 0em .25em .0em .25em;

    margin-left: 0.2em;
    margin-right: 0.2em;
}
```


## License

MIT License (see LICENSE.txt)
npm package: @gerhobbelt/markdown-it-abbr
Description: <abbr> tag for markdown-it markdown parser.
Latest version: 1.0.4-29

# markdown-it-abbr

[![Build Status](https://img.shields.io/travis/GerHobbelt/markdown-it-abbr/master.svg?style=flat)](https://travis-ci.org/GerHobbelt/markdown-it-abbr)
[![NPM version](https://img.shields.io/npm/v/@gerhobbelt/markdown-it-abbr.svg?style=flat)](https://www.npmjs.org/package/@gerhobbelt/markdown-it-abbr)
[![Coverage Status](https://img.shields.io/coveralls/GerHobbelt/markdown-it-abbr/master.svg?style=flat)](https://coveralls.io/r/GerHobbelt/markdown-it-abbr?branch=master)

> Abbreviation (`<abbr>`) tag plugin for [markdown-it](https://github.com/markdown-it/markdown-it) markdown parser.

__v1.+ requires `markdown-it` v4.+, see changelog.__

Markup is based on [php markdown extra](https://michelf.ca/projects/php-markdown/extra/#abbr) definition, but without multiline support.

Markdown:

```
*[HTML]: Hyper Text Markup Language
*[W3C]:  World Wide Web Consortium
The HTML specification
is maintained by the W3C.
```

HTML:

```html
<p>The <abbr title="Hyper Text Markup Language">HTML</abbr> specification
is maintained by the <abbr title="World Wide Web Consortium">W3C</abbr>.</p>
```

## Install

node.js, browser:

```bash
npm install @gerhobbelt/markdown-it-abbr --save
```

## Use

```js
var md = require('@gerhobbelt/markdown-it')()
            .use(require('@gerhobbelt/markdown-it-abbr'));

md.render(/*...*/); // See examples above
```

### Pass a JSON list of abbr definitions

```js
var abbrDefList = {
    "HTML": "Hyper Text Markup Language",
    "W3C": "World Wide Web Consortium"
};

var md = require('markdown-it')()
            .use(require('markdown-it-abbr'), abbrDefList);

md.render(/*...*/) // see example above
```

The list will be merged with the reference style abbreviation definitions like 
`*[HTML]: Hyper Text Markup Language` 
inside the markdown files (file definitions overwrite existing list definitions 
by default). 
To let list definitions overwrite existing definitions in the markdown file 
instead, pass a third argument `listPriorsFile` with `true`:

```js
var md = require('markdown-it')()
            .use(require('markdown-it-abbr'), abbrDefList, true);
```


_Differences in browser._ If you load script directly into the page, without
package system, module will add itself globally as `window.markdownitAbbr`.


## License

[MIT](https://github.com/GerHobbelt/markdown-it-abbr/LICENSE)
npm package: @gerhobbelt/markdown-it-alerts
Description: Markdown-it plugin to create Bootstrap alerts
Author: Nuno Freitas
Latest version: 0.2.0-8

# markdown-it-alerts

[Markdown-it][markdown-it] plugin to create [Bootstrap alerts][bootstrap-alerts].

E.g.:

```md
::: warning
Hello world! [Link](#).
:::
```

Gets converted to:

```html
<div class="alert alert-warning" role="alert">
<p>Hello world! <a href="#" class="alert-link">Link</a>.</p>
</div>
```


## Install

```bash
$ npm install markdown-it-alerts --save
```



## Usage


### Enable plugin

```js
var md = require('markdown-it');
var alerts = require('markdown-it-alerts');

md().use(alerts);
```


### Options

Enable/disable adding class `alert-link` to links inside alerts.

```js
var md = require('markdown-it');
var alerts = require('markdown-it-alerts');

md().use(alerts, {links: false});
```

Enable/disable adding a matching glyphicon to alerts.

```js
var md = require('markdown-it');
var alerts = require('markdown-it-alerts');

md().use(alerts, {icons: true});
```

Note that this option adds extra markup that must be accommodated by your CSS.

### Example

With option `links` enabled (by default):

```md
This is a test. [Link](#).

::: success
Hello world! [Link](#).
:::

This is a test. [Link](#).
```

Gets converted to:

```html
<p>This is a test. <a href="#">Link</a>.</p>
<div class="alert alert-success" role="alert">
<p>Hello world! <a href="#" class="alert-link">Link</a>.</p>
</div>
<p>This is a test. <a href="#">Link</a>.</p>
```

With option `icons` enabled (not default):

```md
This is a test. [Link](#).

::: warning
Uh-oh! [Link](#).
:::

This is a test. [Link](#).
```

Gets converted to:

```html
<p>This is a test. <a href="#">Link</a>.</p>
<div class="alert alert-warning" role="alert">
<div class="alert-inner">
<div class="alert-icon"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span></div>
<div class="alert-message"><p>Uh-oh! <a href="#" class="alert-link">Link</a>.</p>
</div>
</div>
</div>
<p>This is a test. <a href="#">Link</a>.</p>
```


[markdown-it]: https://github.com/markdown-it/markdown-it
[bootstrap-alerts]: http://getbootstrap.com/components/#alerts
npm package: @gerhobbelt/markdown-it-ast
Description: Generate AST from tokens parsed from markdown-it.
Author: Andy Pan
Latest version: 0.0.1-2

# Markdown-It AST Generator

Generate AST from tokens parsed from markdown-it to be more efficient on searching and rewriting tokens.

## Usage

```js
var markdownIt    = require('markdown-it');
var markdownItAST = require('markdown-it-ast');

var tokens = markdownIt.parse('#123\n##456');
markdownItAST.makeAST(tokens);
```

## Structure
`makeAST` returns a tree. Each token pair (open, close) is stored in `openNode` and `closeNode`, respectively. `nodeType` is derived from the opening token. Descendants are stored in `children`, and each descendant can be either an AST node **or an inline node**.

## License

This project is [licensed under MIT](https://github.com/GerHobbelt/markdown-it-ast/LICENSE).
npm package: @gerhobbelt/markdown-it-collapsible
Description: A markdown-it plugin, which adds collapsibles via the HTML <details> and <summary> elements
Author: bioruebe
Latest version: 1.0.0-3

# markdown-it-collapsible

[![Build Status](https://img.shields.io/travis/GerHobbelt/markdown-it-collapsible/master.svg?style=flat)](https://travis-ci.org/GerHobbelt/markdown-it-collapsible)
[![NPM version](https://img.shields.io/npm/v/@gerhobbelt/markdown-it-collapsible.svg?style=flat)](https://www.npmjs.org/package/@gerhobbelt/markdown-it-collapsible)
[![Coverage Status](https://img.shields.io/coveralls/GerHobbelt/markdown-it-collapsible/master.svg?style=flat)](https://coveralls.io/r/GerHobbelt/markdown-it-collapsible?branch=master)

> A markdown-it plugin, which adds collapsibles via the HTML `<details>` and `<summary>` elements


## Preview

![preview](docs/preview.png)


## Usage


### Install

```bash
npm install markdown-it-collapsible
```


### Enable

```js
const markdown_it = require("markdown-it");
const markdown_it_collapsible = require("markdown-it-collapsible");
const md = markdown_it().use(markdown_it_collapsible, options);
```


### Syntax

```md
+++ <visible_text>
<hidden_text>
+++
```

e.g.

```md
+++ Click me!
Hidden text
+++
```

is interpreted as

```html
<details>
	<summary>
        <span class="details-marker">
            &nbsp;
        </span>
        Click me!
    </summary>
    <p>
        Hidden text
    </p>
</details>
```



### Example CSS

```css
details > summary:first-of-type {
	list-style-type: none;
}

::-webkit-details-marker {
	display: none;
}

summary {
	outline: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-khtml-user-select: none;
	-ms-user-select: none;
	cursor: pointer;
}

details > summary .details-marker:before {
	content: "\25BA";
}

details[open] > summary .details-marker:before {
	content: "\25BC";
}

details > *:not(summary) {
	padding-left: 1.25em;
}
```
npm package: @gerhobbelt/markdown-it-deflist
Description: <dl> tag for markdown-it markdown parser.
Latest version: 2.0.4-2

# markdown-it-deflist

[![Build Status](https://img.shields.io/travis/GerHobbelt/markdown-it-deflist/master.svg?style=flat)](https://travis-ci.org/GerHobbelt/markdown-it-deflist)
[![NPM version](https://img.shields.io/npm/v/@gerhobbelt/markdown-it-deflist.svg?style=flat)](https://www.npmjs.org/package/@gerhobbelt/markdown-it-deflist)
[![Coverage Status](https://img.shields.io/coveralls/GerHobbelt/markdown-it-deflist/master.svg?style=flat)](https://coveralls.io/r/GerHobbelt/markdown-it-deflist?branch=master)

> Definition list (`<dl>`) tag plugin for [markdown-it](https://github.com/markdown-it/markdown-it) markdown parser.

__v2.+ requires `markdown-it` v5.+, see changelog.__

Syntax is based on [pandoc definition lists](http://johnmacfarlane.net/pandoc/README.html#definition-lists).


## Install

node.js, browser:

```bash
npm install @gerhobbelt/markdown-it-deflist --save
bower install @gerhobbelt/markdown-it-deflist --save
```

## Use

```js
var md = require('@gerhobbelt/markdown-it')()
            .use(require('@gerhobbelt/markdown-it-deflist'));

md.render(/*...*/);
```

_Differences in browser._ If you load script directly into the page, without
package system, module will add itself globally as `window.markdownitDeflist`.


## License

[MIT](https://github.com/GerHobbelt/markdown-it-deflist/blob/master/LICENSE)
npm package: @gerhobbelt/markdown-it-fontawesome
Description: Markdown-it plugin that adds Font Awesome 5 icons support
Author: Nuno Freitas
Latest version: 0.3.0-3

# markdown-it-fontawesome

[![Build Status](https://img.shields.io/travis/GerHobbelt/markdown-it-fontawesome/master.svg?style=flat)](https://travis-ci.org/GerHobbelt/markdown-it-fontawesome)
[![NPM version](https://img.shields.io/npm/v/@gerhobbelt/markdown-it-fontawesome.svg?style=flat)](https://www.npmjs.org/package/@gerhobbelt/markdown-it-fontawesome)
[![Coverage Status](https://img.shields.io/coveralls/GerHobbelt/markdown-it-fontawesome/master.svg?style=flat)](https://coveralls.io/r/GerHobbelt/markdown-it-fontawesome?branch=master)

[Markdown-it][markdown-it] plugin that adds [Font Awesome][fontawesome] icons support.

Turn this:

```md
Hello World! :fa-flag:
```

Into this:

```html
<p>Hello World! <i class="fa fa-flag"></i></p>
```


## Install
```bash
$ npm install @gerhobbelt/markdown-it-fontawesome --save
```



## Usage


### Enable plugin

```js
var md = require('@gerhobbelt/markdown-it');
var fa = require('@gerhobbelt/markdown-it-fontawesome');

md().use(fa);
```


### Font Awesome version 4 example

```md
Hello World! :fa-flag:

- [:fa-google: Google](https://www.google.com/)
- [:fa-github: GitHub](https://github.com/)
```

Gets converted to:

```html
<p>Hello World! <i class="fa fa-flag"></i></p>
<ul>
<li><a href="https://www.google.com/"><i class="fa fa-google"></i> Google</a></li>
<li><a href="https://github.com/"><i class="fa fa-github"></i> GitHub</a></li>
</ul>
```


### Font Awesome 5+ example


```md
Hello World! :fal-flag:

- [:fab-google: Google](https://www.google.com/)
- [:fab-github: GitHub](https://github.com/)
```

gets converted to: 

```html
<p>Hello World! <i class="fal fa-flag"></i></p>
<ul>
<li><a href="https://www.google.com/"><i class="fab fa-google"></i> Google</a></li>
<li><a href="https://github.com/"><i class="fab fa-github"></i> GitHub</a></li>
</ul>
```


[markdown-it]: https://github.com/markdown-it/markdown-it
[fontawesome]: https://fortawesome.github.io/Font-Awesome/


### Credits 

Original: https://github.com/nunof07

Font awesome 5 support and tests: https://github.com/rjjakes


### License

MIT
npm package: @gerhobbelt/markdown-it-for-inline
Description: Inline tokens iterator for markdown-it markdown parser.
Latest version: 0.1.2-1

# markdown-it-for-inline

[![Build Status](https://img.shields.io/travis/GerHobbelt/markdown-it-for-inline/master.svg?style=flat)](https://travis-ci.org/GerHobbelt/markdown-it-for-inline)
[![NPM version](https://img.shields.io/npm/v/@gerhobbelt/markdown-it-for-inline.svg?style=flat)](https://www.npmjs.org/package/@gerhobbelt/markdown-it-for-inline)
[![Coverage Status](https://img.shields.io/coveralls/GerHobbelt/markdown-it-for-inline/master.svg?style=flat)](https://coveralls.io/r/GerHobbelt/markdown-it-for-inline)

> Inline tokens iterator for [markdown-it](https://github.com/markdown-it/markdown-it) markdown parser.

This plugin allows to apply function to certain types of inline tokens. Speed
will not be the fastest possible, but you can do quick prototyping of certain
rule types.


## Usage

## Install

node.js, browser:

```bash
npm install @gerhobbelt/markdown-it-for-inline --save
bower install @gerhobbelt/markdown-it-for-inline --save
```

## Use

```js
var iterator = require('@gerhobbelt/markdown-it-for-inline');

// plugin params are:
//
// - rule name (should be unique)
// - token type to apply
// - function
//
var md = require('@gerhobbelt/markdown-it')()
            .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
              tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');
            });
```

_Differences in browser._ If you load script directly into the page, without
package system, module will add itself globally as `window.markdownitForInline`.


__Example 2.__ Cut link prefixes

```js
var iterator = require('@gerhobbelt/markdown-it-for-inline');

var md = require('@gerhobbelt/markdown-it')({ linkify: true })
            .use(iterator, 'url_beautify', 'link_open', function (tokens, idx) {
              // Make sure link contains only text
              if ((tokens[idx + 2].type !== 'link_close') ||
                  (tokens[idx + 1].type !== 'text')) {
                return;
              }
              // Do replacement
              tokens[idx + 1].content = tokens[idx + 1].content
                                          .replace(/^https?:\/\//, '')
                                          .replace(/^www./, '');
            });
```

__Example 3.__ Make links open in new window

```js
var iterator = require('@gerhobbelt/markdown-it-for-inline');

var md = require('@gerhobbelt/markdown-it')({ linkify: true })
            .use(iterator, 'url_new_win', 'link_open', function (tokens, idx) {
              tokens[idx].attrPush([ 'target', '_blank' ]);
            });
```


## License

[MIT](https://github.com/GerHobbelt/markdown-it-for-inline/blob/master/LICENSE)
npm package: @gerhobbelt/markdown-it-front-matter
Description: Plugin to process front matter container for markdown-it markdown parser (based on Craig McKenna's original)
Author: Craig McKenna
Latest version: 0.2.3-4

# markdown-it-front-matter
 
[![npm](https://badge.fury.io/js/markdown-it-front-matter.svg)](https://badge.fury.io/js/markdown-it-front-matter)
[![master-ci](https://github.com/ParkSB/markdown-it-front-matter/workflows/master-ci/badge.svg)](https://github.com/ParkSB/markdown-it-front-matter/actions?query=workflow%3Amaster-ci)

[![Build Status](https://img.shields.io/travis/GerHobbelt/markdown-it-front-matter/master.svg?style=flat)](https://travis-ci.org/GerHobbelt/markdown-it-front-matter)
[![NPM version](https://img.shields.io/npm/v/@gerhobbelt/markdown-it-front-matter.svg?style=flat)](https://www.npmjs.org/package/@gerhobbelt/markdown-it-front-matter)
[![Coverage Status](https://img.shields.io/coveralls/GerHobbelt/markdown-it-front-matter/master.svg?style=flat)](https://coveralls.io/r/GerHobbelt/markdown-it-front-matter?branch=master)

> Plugin for processing front matter for [markdown-it](https://github.com/markdown-it/markdown-it) markdown parser.


## Install

```sh
$ npm install markdown-it-front-matter --save
```

## Valid Front Matter

Essentially, valid front matter is a fenced block:

* Indicated by **three** or **more** dashes: `---`
* Opening and closing fences must be the same number of *dash* characters
* Opening fence must begin on the first line of the markdown string/file
* Opening fence must not be indented

```yaml
---
valid-front-matter: true
---
```

> The example above uses YAML but YAML is not required

> (bring your own front matter parser, e.g. [front-matter](https://www.npmjs.com/package/gray-matter))


## Example

  * Front Matter is not rendered.
  * Any markup inside the block is passed to the **required** callback function as the first parameter.
  * The markdown_it 'front_matter' token is passed to the callback in the second argument.
  * The markdown_it `state` object is passed in the third argument.
  * The callback's `this` references the active markdown-it-front-matter options object 
    (which is a [`Object.assign()`-ed copy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) of the options object you passed earlier into the `use()` API call).

```javascript
const md = require('@gerhobbelt/markdown-it')()
  .use(require('@gerhobbelt/markdown-it-front-matter'), {
    callback: function(fm, token, state) {
      console.log(fm);
    }
  });

let result = md.render('---\ntitle: This is the Title\n---\n# Heading\n----\nsome text');

// > title: This is the Title
```

## References / Thanks

Code heavily borrowed from [markdown-it-container](https://github.com/markdown-it/markdown-it-container)

* Alex Kocharin [github/rlidwka](https://github.com/rlidwka)
* Vitaly Puzrin [github/puzrin](https://github.com/puzrin)


## License

_markdown-it-front-matter_ is distributed under the MIT License - see the [LICENSE](LICENSE) file for details.
npm package: @gerhobbelt/markdown-it-hashtag
Description: hashtag for markdown-it markdown parser.
Latest version: 0.4.0-1

# markdown-it-hashtag

[![Build Status](https://img.shields.io/travis/svbergerem/markdown-it-hashtag/master.svg?style=flat)](https://travis-ci.org/svbergerem/markdown-it-hashtag)
[![Coverage Status](https://img.shields.io/coveralls/svbergerem/markdown-it-hashtag/master.svg?style=flat)](https://coveralls.io/r/svbergerem/markdown-it-hashtag?branch=master)
[![npm version](https://img.shields.io/npm/v/markdown-it-hashtag.svg?style=flat)](https://npmjs.com/package/markdown-it-hashtag)

> hashtag (`#tag`) plugin for [markdown-it](https://github.com/markdown-it/markdown-it) markdown parser.

`#hashtag` => `<a href="/tags/hashtag" class="tag">#hashtag</a>`

## Install

node.js, bower:

```bash
npm install markdown-it-hashtag --save
bower install markdown-it-hashtag --save
```

## Use

#### Basic

```js
var md = require('markdown-it')()
            .use(require('markdown-it-hashtag'));

md.render('#hashtag'); // => '<p><a href="/tags/hashtag" class="tag">#hashtag</a></p>'
```

_Differences in browser._ If you load the script directly into the page, without
package system, module will add itself globally as `window.markdownitHashtag`.

#### Advanced

You can specify the RegExp for hashtags and specify the allowed preceding content. You can also
modify the output of the renderer. Here is an example with default values:

```js
var md = require('markdown-it')()
            .use(require('markdown-it-hashtag'),{
              // pattern for hashtags with normal string escape rules
              hashtagRegExp: '\\w+',
              // pattern for allowed preceding content
              preceding:     '^|\\s'
            });

md.renderer.rules.hashtag_open  = function(tokens, idx) {
  var tagName = tokens[idx].content.toLowerCase(); 
  return '<a href="/tags/' + tagName + '" class="tag">';
}

md.renderer.rules.hashtag_text  = function(tokens, idx) {
  return '#' + tokens[idx].content;
}

md.renderer.rules.hashtag_close = function { return '</a>'; }

md.render('#hashtag'); // => '<p><a href="/tags/hashtag" class="tag">#hashtag</a></p>'
```

## License

[MIT](https://github.com/svbergerem/markdown-it-hashtag/blob/master/LICENSE)
npm package: @gerhobbelt/markdown-it-header-sections
Description: add sections to markdown headers
Author: Arve Seljebu
Latest version: 0.2.2-1

# markdown-it-header-sections [![Build Status](https://travis-ci.org/GerHobbelt/markdown-it-header-sections.svg)](https://travis-ci.org/GerHobbelt/markdown-it-header-sections) [![npm version](https://badge.fury.io/js/%40gerhobbelt%2Fmarkdown-it-header-sections.svg)](http://badge.fury.io/js/%40gerhobbelt%2Fmarkdown-it-header-sections)


Renders this markdown
```md
# Header 1
Text.
### Header 2
Lorem?
## Header 3
Ipsum.
# Last header
Markdown rules!
```

to this output (without indentation)
```html
<section>
  <h1>Header 1</h1>
  <p>Text.</p>
  <section>
    <h3>Header 2</h3>
    <p>Lorem?</p>
  </section>
  <section>
    <h2>Header 3</h2>
    <p>Ipsum.</p>
  </section>
</section>
<section>
  <h1>Last header</h1>
  <p>Markdown rules!</p>
</section>
```

If you add [attrs], [anchor] or any other plugin that adds attributes to header-tokens, sections will have the same attributes (which is useful for styling).

E.g., with [attrs] enabled before header-sections:

```js
var md = require('markdown-it')()
  .use(require('markdown-it-attrs'))
  .use(require('markdown-it-header-sections'))
```

this markdown
```md
# great stuff {.jumbotron}
lorem

click me {.btn .btn-default}
```

renders to
```md
<section class="jumbotron">
  <h1 class="jumbotron">great stuff</h1>
  <p>lorem</p>
  <p class="btn btn-default">click me</p>
</section>
```

## Install
```
npm install @gerhobbelt/markdown-it-header-sections @gerhobbelt/markdown-it
```

## Usage
```js
var md = require('@gerhobbelt/markdown-it')();
md.use(require('@gerhobbelt/markdown-it-header-sections'));

var src = '# first header\n';
src += 'lorem\n\n'
src += '## second header\n';
src += 'ipsum';

console.log(md.render(src));
```

[demo as jsfiddle](https://jsfiddle.net/arve0/5dn54cow/1/)


[attrs]: https://github.com/GerHobbelt/markdown-it-attrs
[anchor]: https://github.com/GerHobbelt/markdown-it-anchor
npm package: @gerhobbelt/markdown-it-headinganchor
Description: markdown-it plugin that adds an anchor (i.e., `<a name="blah"...>`) to headings.
Latest version: 1.2.1-1

[![Build Status](https://travis-ci.org/GerHobbelt/markdown-it-headinganchor.svg?branch=master)](https://travis-ci.org/GerHobbelt/markdown-it-headinganchor)
[![NPM version](https://img.shields.io/npm/v/%40gerhobbelt%2Fmarkdown-it-headinganchor.svg?style=flat)](https://www.npmjs.org/package/%40gerhobbelt%2Fmarkdown-it-headinganchor)
[![Coverage Status](https://coveralls.io/repos/GerHobbelt/markdown-it-headinganchor/badge.svg)](https://coveralls.io/r/GerHobbelt/markdown-it-headinganchor)


# markdown-it-headinganchor

This is a [markdown-it](https://github.com/markdown-it/markdown-it) plugin that adds an anchor (i.e., `<a name=\"blah\"...>`) to headings. 

There are other plugins that add an `id` attribute ([valeriangalliat/markdown-it-anchor](https://github.com/valeriangalliat/markdown-it-anchor)) or `name` attribute ([leff/markdown-it-named-headers](https://github.com/leff/markdown-it-named-headers)) to headings, but neither of these approches work for adding anchors that are not stripped out of email.

So this extension renders from this...

```md
# My Heading
...
[Link to that heading](#MyHeading).
```

...to this:

```html
<h1 id="MyHeading">
  <a name="MyHeading" class="markdown-it-headinganchor" href="#"></a>
  My Heading
</h1>
...
<p>
  <a href="#MyHeading">Link to that heading</a>.
</p>
```

To refer to in heading anchor in a link, remove all spaces from the original text. So, for example, you might have:

```md
## `code` is **bold**
...
[link to the heading](#`code`is**bold**)
```

Much like other markdown-it plugins, the usage is:

```js
var md = require('@gerhobbelt/markdown-it')();
md.use(require('@gerhobbelt/markdown-it-headinganchor'), {
  anchorClass: 'my-class-name', // default: 'markdown-it-headinganchor'
  addHeadingID: true,           // default: true
  addHeadingAnchor: true,       // default: true
  slugify: function(str, md) {} // default: 'My Heading' -> 'MyHeading'
});
md.render('# My Heading');
```

Originally developed for use with [Markdown Here](https://github.com/adam-p/markdown-here).