Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chkal/metalsmith-asciidoctor
Metalsmith plugin to transform Asciidoc files to HTML
https://github.com/chkal/metalsmith-asciidoctor
Last synced: about 6 hours ago
JSON representation
Metalsmith plugin to transform Asciidoc files to HTML
- Host: GitHub
- URL: https://github.com/chkal/metalsmith-asciidoctor
- Owner: chkal
- License: mit
- Created: 2017-12-19T16:16:26.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-06-04T07:09:06.000Z (over 2 years ago)
- Last Synced: 2024-11-11T07:39:32.649Z (6 days ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# metalsmith-asciidoctor
[![npm version](https://badge.fury.io/js/metalsmith-asciidoctor.svg)](https://badge.fury.io/js/metalsmith-asciidoctor)
[![Build Status](https://travis-ci.org/chkal/metalsmith-asciidoctor.svg?branch=master)](https://travis-ci.org/chkal/metalsmith-asciidoctor)Metalsmith plugin to transform AsciiDoc files to HTML using [asciidoctor.js](http://asciidoctor.org/docs/asciidoctor.js/).
## Installation
With `npm`:
```bash
npm install --save-dev metalsmith-asciidoctor
```With `yarn`:
```bash
yarn add --dev metalsmith-asciidoctor
```## Usage
```js
var asciidoctor = require("metalsmith-asciidoctor");Metalsmith(__dirname)
/* ... */
.use(asciidoctor())
/* ... */
```By default, the plugin will process all `.adoc` files and render them to HTML. You can customize this
default behavior by setting the `pattern` property on a configuration object.```js
.use(asciidoctor({
pattern: "**/*.asciidoc"
}))
```You can also pass custom options to the `asciidoctor.js` by setting the `options` property. Please
note that this will also allow you to provide custom attributes.```js
.use(asciidoctor({
options: {
safe: "safe",
attributes: {
"note-caption": "Hinweis",
"warning-caption": "Warnung"
}
}
}))
```## License
MIT