Sapper/Svelte: How do I add markdown files?

☆樱花仙子☆ 提交于 2019-12-08 06:41:14

问题


I am creating a blog using Sapper using the default sapper-template-rollup.

In the blog folder, it does mention about generating data from markdown files. But I can't find how to do it?


回答1:


You may find this repo helpful. I also have an open PR on the Sapper Template repo, first revising the old Markdown branch in Jan. 2019 and then adding Svelte 3 support in May 2019, but it is probably easier to look at and clone my repo on GitLab, plus it has more current dependency updates I have not added to the PR yet.




回答2:


You might have more lick using MDsveX which is a Svelte Markdown processor, created by one of the core community members.

However yes, you can also just use marked or snarkdown (which is what I use), the same way as you would use any other library - simply import it and pass your markdown code to it.



来源:https://stackoverflow.com/questions/58417881/sapper-svelte-how-do-i-add-markdown-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!