Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maximilianschmitt/docpad-plugin-shortcodeparser
Easy shortcodes for DocPad using shortcode-parser
https://github.com/maximilianschmitt/docpad-plugin-shortcodeparser
Last synced: about 1 month ago
JSON representation
Easy shortcodes for DocPad using shortcode-parser
- Host: GitHub
- URL: https://github.com/maximilianschmitt/docpad-plugin-shortcodeparser
- Owner: maximilianschmitt
- License: mit
- Created: 2014-03-08T21:47:45.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-10T02:32:14.000Z (almost 11 years ago)
- Last Synced: 2024-10-15T04:45:06.052Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 145 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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![]()
{
tag: 'img',
cb: function(buf, opts, templateData) {
return '';
}
},// [b]Bold text![/b] becomes Bold text!
{
tag: 'b',
cb: function(buf, opts, templateData) {
return '' + buf + '';
}
}
]
}
};
```### 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`.