doxie.render

A plugin for doxie. Render a comment to markdown, HTML, or any other format.

Showing:

Popularity

Downloads/wk

1

GitHub Stars

0

Maintenance

Last Commit

6yrs ago

Contributors

0

Package

Dependencies

4

Size (min+gzip)

4.5KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Coveralls – test coverage
Travis – build status
David – status of dependencies
Stability: unstable
Code style: airbnb

doxie --render

A plugin for doxie.
Render a comment to markdown, HTML, or any other format.





Note: Don’t panic. doxie --render is a flexible, low-level plugin. We’re working on higher-level plugins which you can drop into your project without fiddling with configuration.

CLI Usage

doxie --render is a plugin for the command-line tool doxie. Most plugins are designed for dox data. Install all three if you haven’t already:

$ npm install --global dox doxie doxie.render

Create the module .doxie.render.js in your project directory. Export a template function from it. Then pass the option --render to doxie to put it in the plugin pipeline.

I’m including --output to print the results of doxie --render.

$ echo '
module.exports = function (comment) {
  return comment.data.isPrivate ? "Sshhh…\n" : "Boom!\n"
};' > .doxie.render.js

$ dox < my.js | doxie --render --output
Sshhh…
Boom!
Boom!

If you want to put the template function in another file, no problem:

$ doxie   --render build/my-template-function.js   --output

Programmatic usage

doxie.render can be used directly with doxie-core – the backend of doxie. Install both if you haven’t already:

$ npm install doxie-core doxie.render

Pass the template function to doxie.render to configure the plugin:

const doxie = require('doxie-core');
const render = require('doxie.render');
const output = require('doxie.output');

const myTemplate = ({data}) => `${data.isPrivate ? 'Sshhh…' : 'Boom!'}\n`;
const myDoxData = [{isPrivate: true}, {isPrivate: false}, {isPrivate: false}];

doxie([
  render(myTemplate),
  output(),
])(myDoxData).output;
//» "Sshhh…\nBoom!\nBoom!\n"

The template function

Work in progress…

License

MIT © Studio B12 GmbH

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100