Skip to content
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

如何使md支持代码运行,文档需要带运行示例的 #21

Open
Freewayy opened this issue Mar 15, 2019 · 4 comments
Open

如何使md支持代码运行,文档需要带运行示例的 #21

Freewayy opened this issue Mar 15, 2019 · 4 comments

Comments

@Freewayy
Copy link

如题

@jaywcjlove
Copy link
Owner

安装下面步骤就可以初始化一个工程。

npm install rdoc -g   # 安装工具
# /usr/local/bin/rdoc -> /usr/local/lib/node_modules/rdoc/.bin/rdoc.js
# /usr/local/bin/rdoc-cli -> /usr/local/lib/node_modules/rdoc/.bin/rdoc.js

rdoc init my-project  # 初始化项目
# 也可以使用 rdoc-cli 命令,跟 rdoc 命令是一样的
# 增加 用 rdoc-cli 命令,目的是解决 Mac 系统自带的 Ruby 命令 rdoc 冲突

cd my-project && npm start # 进入工程,启动服务

@Freewayy
Copy link
Author

Freewayy commented Mar 18, 2019

谢谢您的回复,应该是我没表述清楚,我的意思是,我是想在md文档里加入可运行的react代码示例

@jaywcjlove
Copy link
Owner

@Freewayy 自己制作主题,将转换 React的代码加入即可,默认没有加入进去,是因为 @babel/standalone 体积太大了。

这里就有个实例,https://github.com/uiwjs/uiw 文档网站几乎一样的原理。

@Freewayy
Copy link
Author

@jaywcjlove 非常感谢,需要的正是这个

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

No branches or pull requests

2 participants