-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jstransformer #12
Comments
You can already use your own markdown tool. I specifically designed it that way. Call the var nunjucks = require('nunjucks'),
markdown = require('nunjucks-markdown');
var env = nunjucks.configure('views');
// The second argument can be any function that renders markdown
markdown.register(env, yourRenderMethod); |
CommonMark have different API than marked. :-( I get error. |
Can you give me an example of what you're trying to accomplish? |
|
You are trying to pass in the commonmark module as a whole, but that doesn't work. The reason I could pass in It looks to me like you'll have to do something like this: var nunjucks = require('nunjucks'),
markdown = require('nunjucks-markdown'),
cm = require('commonmark');
var env = nunjucks.configure('views');
var reader = new cm.Parser();
var writer = new cm.HtmlRenderer();
function render(markdown) {
var parsed = reader.parse(markdown);
return writer.render(parsed);
}
markdown.register(env, render); This may or may not work, but it's just something I slapped together by looking at the commonmark examples. |
Thank you 👍 I will use it in this repo https://github.com/StartPolymer/polymer-starter-kit-plus |
No problem. Let me know if you have any more issues. |
Could you add jstransformer for load own markdown renderer? I need CommonMark.
https://github.com/jstransformers/inputformat-to-jstransformer
https://github.com/jstransformers/inputformat-to-jstransformer/blob/master/dictionary.json
https://github.com/jstransformers/jstransformer-commonmark
Thank you
The text was updated successfully, but these errors were encountered: