1.1.0 • Published 4 years ago

gridsome-transformer-docutils v1.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

gridsome-transformer-docutils

Build Status npm

Docutils transformer for Gridsome.

This transformer parses docutils xml documents with the docutils package. You can use it to load documentation generated by tools like sphinx in Gridsome collections.

Installation

You can install gridsome-transformer-docutils with your npm client of choice.

$ npm install --save-dev gridsome-transformer-docutils

Usage

After installing the package as a development dependency, you can configure @gridsome/source-filesystem to load the generated xml files.

// gridsome.config.js

module.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 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 documentation for more details.

Contributing

Contributions are welcome. This project uses jest for testing.

$ npm test

The code follows the javascript standard style guide.

$ npm run lint

License - MIT

1.1.0

4 years ago

1.0.0

4 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.0

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago