Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vberlier/gridsome-transformer-docutils
Docutils transformer for Gridsome.
https://github.com/vberlier/gridsome-transformer-docutils
docutils gridsome gridsome-plugin gridsome-transformer restructuredtext sphinx xml
Last synced: about 1 month ago
JSON representation
Docutils transformer for Gridsome.
- Host: GitHub
- URL: https://github.com/vberlier/gridsome-transformer-docutils
- Owner: vberlier
- License: mit
- Created: 2019-03-10T02:27:16.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T04:04:24.000Z (almost 2 years ago)
- Last Synced: 2024-10-03T20:09:51.353Z (3 months ago)
- Topics: docutils, gridsome, gridsome-plugin, gridsome-transformer, restructuredtext, sphinx, xml
- Language: JavaScript
- Homepage:
- Size: 701 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gridsome-transformer-docutils
[![Build Status](https://travis-ci.com/vberlier/gridsome-transformer-docutils.svg?branch=master)](https://travis-ci.com/vberlier/gridsome-transformer-docutils)
[![npm](https://img.shields.io/npm/v/gridsome-transformer-docutils.svg)](https://www.npmjs.com/package/gridsome-transformer-docutils)> Docutils transformer for Gridsome.
This transformer parses [docutils xml documents](http://docutils.sourceforge.net/docs/ref/doctree.html) with the [docutils](https://github.com/vberlier/docutils) package. You can use it to load documentation generated by tools like [sphinx](http://www.sphinx-doc.org) in Gridsome collections.
## Installation
You can install `gridsome-transformer-docutils` with your `npm` client of choice.
```bash
$ npm install --save-dev gridsome-transformer-docutils
```## Usage
After installing the package as a development dependency, you can configure [@gridsome/source-filesystem](https://github.com/gridsome/gridsome/tree/master/packages/source-filesystem) to load the generated xml files.
```js
// gridsome.config.jsmodule.exports = {
plugins: [
{
use: '@gridsome/source-filesystem',
options: {
typeName: 'SphinxDocument',
baseDir: 'sphinx/dist',
path: '**/*.xml',
docutils: {
// Options
}
}
}
],
templates: {
SphinxDocument: node => node.path
},
transformers: {
docutils: {
// Global options
}
}
}
```### Options
You can configure the transformer globally or for specific filesystem sources.
- `plugins`
Defaults to `[]`. An array of plugins passed to the [docutils](https://github.com/vberlier/docutils) parser.
### Fields
In addition to the fields provided by the `source-filesystem` plugin, the transformer generates a JSON field containing the parsed document.
- `root`
The document parsed as a hierarchy of plain JavaScript objects. Check out the [docutils](https://github.com/vberlier/docutils) documentation for more details.
## Contributing
Contributions are welcome. This project uses [jest](https://jestjs.io/) for testing.
```bash
$ npm test
```The code follows the [javascript standard](https://standardjs.com/) style guide.
```bash
$ npm run lint
```---
License - [MIT](https://github.com/vberlier/gridsome-transformer-docutils/blob/master/LICENSE)