Defined in: lib/Renderer.js
Markdown to HTML renderer.
| String|Object | renderMarkdown(String, Object) |
| void | addCodeBlockRenderer(String, Function) |
config | Object |
config.layoutOptions.singlePageMode | Boolean |
Install a handler for a certain language code-block. The handler is expected to return VALID, FULL HTML.
language | StringThe language the renderer is expecting to handle. |
handler | FunctionThe rendering routine. |
Example: Installing a handler for a custom "dot" language:
Renderer.addCodeBlockRenderer("dot", function(code) {
return '<pre>' + code + '</pre>';
});Render Markdown to HTML.
text | StringMarkdown text. |
options | Object |
options.baseURL | StringThe url to prefix the anchor links with. This is necessary only in the Single Page Mode because all anchors must be absolute then. In the regular mode, the anchors are shortened to be more friendly since they assume there won't be conflicts (because each "page" is expected to represent a single document.) Pass the documentNode's @meta.href value here if you're compiling from a corpus node. Defaults to: |
options.anchorableHeadings | BooleanTurn this off if you do not want the headings to have anchors - the [name] attribute and the .anchorable-heading stuff. Defaults to: |
options.withTOC | BooleanTurn this on if you want the ToC meta-data. The return value will
be an object of the shape: Defaults to: |
String|ObjectThe HTML. |
Made with ♥ using megadoc.