# docpad-plugin-shortcodeparser

> Easy shortcodes for DocPad

Latest version **2.0.3** (published 2014-03-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install docpad-plugin-shortcodeparser
pnpm add docpad-plugin-shortcodeparser
yarn add docpad-plugin-shortcodeparser
bun add docpad-plugin-shortcodeparser
```

## 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 | 2.0.3 |
| Published | 2014-03-09 |
| First published | 2014-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Maximilian Schmitt |
| Maintainers | maximilianschmitt |
| Keywords | docpad, docpad-plugin, shortcodes, shortcode-parser |

## Links

- npm: https://www.npmjs.com/package/docpad-plugin-shortcodeparser
- npm.io page: https://npm.io/package/docpad-plugin-shortcodeparser

## Dependencies (1)

- [shortcode-parser](https://npm.io/package/shortcode-parser.md) 0.0.1

## Recent versions

- 2.0.3 (latest) — 2014-03-09
- 2.0.2 — 2014-03-08
- 2.0.1 — 2014-03-08
- 2.0.0 — 2014-03-08

## README

# docpad-plugin-shortcodeparser

Easy shortcodes for DocPad using [shortcode-parser](https://github.com/derdesign/shortcode-parser).

## Usage

### 1. Add Shortcodes

To add shortcodes, edit your docpad.js-file to include a custom configuration for shortcodeparser:

```
module.exports = {
	shortcodeparser: {
		codes: [
			// [img src="path.png" alt="text"] becomes <img src="path.png" alt="text" />
			{
				tag: 'img',
				cb: function(buf, opts, templateData) {
					return '<img src="' + opts.src + '" alt="' + opts.alt + '" />';
				}
			},

			// [b]Bold text![/b] becomes <strong>Bold text!</strong>
			{
				tag: 'b',
				cb: function(buf, opts, templateData) {
					return '<strong>' + buf + '</strong>';
				}
			}
		]
	}
};
```

### 2. Use File Extensions

Now you can use shortcodes, for example, in your markdown-documents by adjusting the file-extension to "document-name.html.md.sc". You can also set a custom file-extension in your docpad.js-file by setting the key `shortcodeparser.extension`.

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