Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

我需要文档和代码实例在同一张页面,如何实现呢? #59

Closed
hifizz opened this issue Jan 19, 2017 · 8 comments
Closed

Comments

@hifizz
Copy link

hifizz commented Jan 19, 2017

我的文档想用markdown写内容,同时里面有代码示例,需要写js、html、css。html和css没事,但是js在markdown中不能运行。我认为是markdown解析的时候就将script标签的脚本都忽略了。。。所以不能运行。但是我确实想找到一个办法来写这样的文档。不知道作者你有什么思路呢?我可以改造你和docute的代码也行,但是目前没思路,不知道怎么改。

@QingWei-Li
Copy link
Member

  1. 可以用 jsfiddle,codepen 等工具提供的内嵌脚本的功能
  2. 能否提供 markdownParser 接口,我希望在浏览器编译 jsx less #42 markrun-docsify 如果你写的是 react 等话
  3. https://github.com/QingWei-Li/vuep 如果是写 Vue 的话

@nimoc
Copy link

nimoc commented Jan 20, 2017

页面效果: https://markrun.github.io/markrun-docsify/

markdown: https://markrun.github.io/markrun-docsify/README.md

具体要编译什么样的代码可以看 https://github.com/markrun/markrun 的接口

@hifizz
Copy link
Author

hifizz commented Jan 20, 2017

@nimojs 哈哈!好,我先试试markrun。谢谢!

@hifizz
Copy link
Author

hifizz commented Jan 20, 2017

@QingWei-Li 不是写vue。。。这个项目不用vue。thx

@hifizz
Copy link
Author

hifizz commented Jan 21, 2017

markrun已经可以基本满足我的要求了。谢谢作者!
markrun

@hifizz hifizz closed this as completed Jan 21, 2017
@hangjob
Copy link

hangjob commented Jul 6, 2021

现在用好像不行呀,我引用的是cdn

@hangjob
Copy link

hangjob commented Jul 6, 2021

@hifizz 你是咋实现的,有demo楚楚嘛

@nimoc
Copy link

nimoc commented Jul 6, 2021

@hangjob
markrun 之前发布忘记dist了,现在已经恢复 demo 可以打开了.
原理是markdown编译时将特定语法的内容转换为script并执行.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants