• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Widdershin/markdown-doctest: Test all the code in your markdown docs!

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

Widdershin/markdown-doctest

开源软件地址(OpenSource Url):

https://github.com/Widdershin/markdown-doctest

开源编程语言(OpenSource Language):

TypeScript 52.5%

开源软件介绍(OpenSource Introduction):

npm version Build Status Greenkeeper badge


markdown-doctest

Test all the code in your markdown docs!

Why on earth?

As an open source developer, there are few things more embarrassing than a user opening an issue to inform you that your README example is broken! With markdown-doctest, you can rest easy knowing that your example code is actually runnable.

Installation

Just npm install markdown-doctest and run markdown-doctest. It will run all of the Javascript code examples tucked away in your markdown, and let you know if any blow up.

Okay, how do I use it?

Let's try it on this repo!

var a = 5;

var b = 10;

console.log(a + c);

There's a problem with that example. markdown-doctest finds it for us:

$ markdown-doctest
x..

Failed - README.md:32:17
evalmachine.<anonymous>:7
console.log(a + c);
                ^

ReferenceError: c is not defined

Awesome! No excuse for broken documentation ever again, right?


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap