<commit_before># markdown-it-decorate

Add attributes, IDs and classes to Markdown.

[![Status](https://travis-ci.org/rstacruz/markdown-it-decorate.svg?branch=master)](https://travis-ci.org/rstacruz/markdown-it-decorate "See test builds")

```md
This is some text. <!--{.center}-->
```

```html
<p class='center'>This is some text.</p>
```

## Block elements

Create an HTML comment in the format `<!--{...}-->`, where `...` can be a `.class`, `#id`, `key=attr` or a combination of both. Be sure to render markdownIt with `html: true` to enable parsing of `<!--{comments}-->`.

You can put the comment in the same line or in the next.

#### Examples

| What | Source | Destination |
|----|----|----|
| Classes | `Text <!--{.center}-->` | `<p class='center'>Text</p>` |
| Multi classes | `# Hello <!--{.center.red}-->` | `<h1 class='center red'>Hello</h1>` |
| ID and classes | `# Hello <!--{#top .hide}-->` | `<h1 id='top' class='hide'>Hello</h1>` |

## Prior art

This is initially based off of [arve0/markdown-it-attrs](https://github.com/arve0/markdown-it-attrs), which uses text to annotate blocks (eg, `{.class #id}`). markdown-it-attr's approach was based off of [Pandoc's header attributes](http://pandoc.org/README.html#extension-header_attributes).

[Maruku](http://maruku.rubyforge.org/) (Ruby Markdown parser) also allows for block-level attributes and classnames with its [meta-data syntax](http://maruku.rubyforge.org/proposal.html). The syntax is similar to PanDoc's (`{: .class #id}`

[Kramdown](http://kramdown.gettalong.org/) (Ruby markdown parser) also supports the same syntax, also with a colon (`{: .class #id}`).

markdown-it-decorate is inspired by these designs, except it also has a few niceties:

* Elements are annotated via HTML comments; they will not be visible in other markdown parsers (eg, GitHub).
* It (will) support inline elements in addition to block elements (in the future).
<commit_msg>Simplify readme<commit_after># markdown-it-decorate

Add attributes, IDs and classes to Markdown.

[![Status](https://travis-ci.org/rstacruz/markdown-it-decorate.svg?branch=master)](https://travis-ci.org/rstacruz/markdown-it-decorate "See test builds")

```md
This is some text. <!--{.center}-->
```

```html
<p class='center'>This is some text.</p>
```

## Block elements

Create an HTML comment in the format `<!--{...}-->`, where `...` can be a `.class`, `#id`, `key=attr` or a combination of both. Be sure to render markdownIt with `html: true` to enable parsing of `<!--{comments}-->`.

You can put the comment in the same line or in the next.

#### Examples

| Source | Output |
|----|----|
| `Text <!--{.center}-->` | `<p class='center'>Text</p>` |
| `# Hi <!--{.center.red}-->` | `<h1 class='center red'>Hi</h1>` |
| `# Hi <!--{#top .hide}-->` | `<h1 id='top' class='hide'>Hi</h1>` |

## Prior art

This is initially based off of [arve0/markdown-it-attrs](https://github.com/arve0/markdown-it-attrs), which uses text to annotate blocks (eg, `{.class #id}`). markdown-it-attr's approach was based off of [Pandoc's header attributes](http://pandoc.org/README.html#extension-header_attributes).

[Maruku](http://maruku.rubyforge.org/) (Ruby Markdown parser) also allows for block-level attributes and classnames with its [meta-data syntax](http://maruku.rubyforge.org/proposal.html). The syntax is similar to PanDoc's (`{: .class #id}`

[Kramdown](http://kramdown.gettalong.org/) (Ruby markdown parser) also supports the same syntax, also with a colon (`{: .class #id}`).

markdown-it-decorate is inspired by these designs, except it also has a few niceties:

* Elements are annotated via HTML comments; they will not be visible in other markdown parsers (eg, GitHub).
* It (will) support inline elements in addition to block elements (in the future).

{'fraction_non_alphanumeric': 0.18261099365750527, 'fraction_numerical': 0.003171247357293869, 'mean_word_length': 4.149659863945578, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1102967', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1206, 'n_words': 404}