# markdown-to-pug

> Markdown to PugJS converter

Latest version **1.0.11** (published 2017-12-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install markdown-to-pug
pnpm add markdown-to-pug
yarn add markdown-to-pug
bun add markdown-to-pug
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2017-12-16 |
| First published | 2017-11-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Alexandre Masy |
| Maintainers | alexandremasy |

## Links

- npm: https://www.npmjs.com/package/markdown-to-pug
- Repository: https://github.com/alexandremasy/markdown-to-pug
- Homepage: https://github.com/alexandremasy/markdown-to-pug#README
- Issues: https://github.com/alexandremasy/markdown-to-pug/issues
- npm.io page: https://npm.io/package/markdown-to-pug

## Dependencies (2)

- [he](https://npm.io/package/he.md) ^1.1.1
- [markdown-it](https://npm.io/package/markdown-it.md) ^8.4.0

## Recent versions

- 1.0.11 (latest) — 2017-12-16
- 1.0.10 — 2017-12-16
- 1.0.9 — 2017-12-15
- 1.0.8 — 2017-12-15
- 1.0.7 — 2017-12-15
- 1.0.6 — 2017-12-15
- 1.0.5 — 2017-12-15
- 1.0.4 — 2017-12-15
- 1.0.3 — 2017-12-15
- 1.0.2 — 2017-12-15
- 1.0.1 — 2017-11-12
- 1.0.0 — 2017-11-12

## README

# Markdown To [PugJS](https://pugjs.org/)
> Convert your Markdown to [PugJS](https://pugjs.org/)

<https://alexandremasy.github.io/markdown-to-pug/>

[![CircleCI](https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser.svg)](https://circleci.com/gh/alexandremasy/markdown-to-pug)
---

## Why?

Sometimes you like the simplicity of markdown to just express whatever you want to say, but want to keep control on how it will look like. This is what it is about, get control over the output while adding simple ways to take advantage of the PugJS functionalities like mixins and layout.



## Install

**NodeJS**

```shell
npm --save install markdown-to-pug
```

or

```shell
yarn add markdown-to-pug
```



**Dependencies**

- [Markdown-It](https://github.com/markdown-it/markdown-it)




## API

#### constructor(options)

**Parameters**

| Property | Type   | Description                 |
| -------- | ------ | --------------------------- |
| options  | Object | An object with the options. |



**Options**

| Option        | Description                              |
| ------------- | ---------------------------------------- |
| `newline`     | Newline definition. Default value: `\n`  |
| `space`       | Space definition. Default value: `\t`    |
| `linkify`     | Allow the use of Linkify by MarkdownIt. Default value: `true` |
| `typographer` | Allow the use of Typographer by MarkdownIt. Default value: `true` |
| `langPrefix`  | Prefix to use to generate class on code block. Default value: `language-` |



### .render(src)

**Parameters**

| Property | Type   | Description                      |
| -------- | ------ | -------------------------------- |
| src      | String | The Markdown you like to convert |



**Return**

| Type   | Description      |
| ------ | ---------------- |
| String | The PugJS String |

### .md

The instance of markdown-it. Use it to add plugin support.


## Example

```js
var md2pug = new (require('markdown-to-pug'))();

var md = `![Stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopocat")`;
var pug = md2pug.render(md);
```

### Mixin support

With the folliwing PugJS mixin

```pugjs
mixin list
  ul
    li first
    li second
    li third    
```

```md
<!-- +list -->
```

### Layout support

```md
<!-- extends layout.pug -->

<!-- block content -->
# Title
```

will yield to

```pugjs
extend layout.pug

block content
  h1 Title
```

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