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 | String The language the renderer is expecting to handle. |
handler | Function The 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 | String Markdown text. |
options | Object |
options.baseURL | String The 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 | Boolean Turn this off if you do not want the headings to have anchors - the [name] attribute and the .anchorable-heading stuff. Defaults to: |
options.withTOC | Boolean Turn this on if you want the ToC meta-data. The return value will
be an object of the shape: Defaults to: |
String|Object The HTML. |
Made with ♥ using megadoc.