Use docsify as markdown engine, get markdown link from queryparam and render
-
Configure docsify-to-queryparam-markdown-engine (optional):
<script> window.$docsify = { queryParamMarkdownEngine: { hideClassName: ['cover','sidebar','sidebar-toggle','github-corner'], // default ['cover','sidebar','sidebar-toggle','github-corner'] }, } </script>
-
Insert script into docsify document:
<script src="//cdn.jsdelivr.net/npm/docsify-to-queryparam-markdown-engine/dist/docsify-to-queryparam-markdown-engine.min.js"></script>
Write your remote-markdown code like this:
demo2Url: https://retrocode.io/#/%E6%8A%80%E5%B7%A7/Markdown%E8%AF%AD%E6%B3%95?custom=1
demo3Url: https://retrocode.io/#/?mdurl=https://docsify.js.org/README.md
It will be replaced by the raw text of the mdurl above into your doc file content.
If queryparam has 'custom=1' then will set all 'hideClassName' elements style to 'display:none'
By default, we set the hideClassName as ['cover','sidebar','sidebar-toggle','github-corner']
for you.
However, you can change this options as you like:
window.$docsify = {
queryParamMarkdownEngine: {
hideClassName: ['classname'],
},
}
This project is licensed under the MIT license.
Copyright (c) ShowMeBaby (retrocode@qq.com)