-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
How to change markdown parser #882
Comments
I’m interested in using Remarkable instead, so I’m chiming in here in case this becomes a build option. |
I am with you, remarkable would be fine too! |
Maybe there is already some kind of way? I need a clever guy to figure it out! :) Because in this comment #144 (comment) @QingWei-Li states that...
I'm not sure what he means by " As it states on the markdown-docs:
so maybe we can say this instead?:
|
It's doable using custom plugins.
Now within your window.$docsify you can create a custom plugin to do the markdown for you.
This would let you render the doc using markdown-it & since there would be no other markdown left, the other renderer would leave it alone. However, there could be performance implications. (Redundency) |
@varadpoddar your solution doesn't render footnote, plus the todo check list seems to be broken, is there any thing i have to add on? |
@rockmanvnx6 The footnotes and task lists functionality is a part of markdown's extended syntax. You should add these corresponding packages for markdown-it. (If you choose to use markdown-it). PS : If you are a web developer, you should test these plugins out using browsify's CDN. Example Code : \\ Script files added before calling window.$docsify.
\\ Markdown-it V10.0
<script src="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/10.0.0/markdown-it.min.js" integrity="sha256-YASERpEeN8gRNr/Fy4Km34WGFqIq1h6HkJMAQnVHlhk=" crossorigin="anonymous"></script>
\\ Markdown-It-Attrs for Markdown-it
<script src="https://wzrd.in/standalone/markdown-it-attrs@latest" charset="utf-8"></script>
\\ Markdown-It-Footnote for Markdown-it
<script src="https://wzrd.in/standalone/markdown-it-footnote@latest" charset="utf-8"></script>
\\ Markdown-It-Task-List for Markdown-it
<script src="https://wzrd.in/standalone/markdown-it-task-list@latest" charset="utf-8"></script>
\\ Docsify
<script>
window.$docsify = {
plugins:[
function (hook,vm) {
hook.beforeEach(function (html) {
var md = window.markdownit();
md.use(markdownItAttrs, {
// optional, these are default options
leftDelimiter: '{',
rightDelimiter: '}',
allowedAttributes: [] // empty array = all attributes are allowed
}).use(markdownitFootnote).use(markdownItTaskList);
return md.render(html);
});
}
]
};
</script> |
@varadpoddar thank you, for the script to work, I've to modify a bit: function (hook,vm) {
hook.beforeEach(function (html) {
var md = window.markdownit();
md.use(window.markdownItAttrs, {
// optional, these are default options
leftDelimiter: '{',
rightDelimiter: '}',
allowedAttributes: [] // empty array = all attributes are allowed
}).use(window.markdownItFootnote)
.use(markdownItTaskList.default);
return md.render(html);
});
}, |
@QingWei-Li Can I add the above workaround in the current docs in the form of a PR? |
You cant change the parser It is in our roadmap for using a new pluggable parser for Closing this as it will be considered if required. |
Feature request
Can I change parser from marked to markdown-it. I really need the footnote features.
The text was updated successfully, but these errors were encountered: