html2markdownHTML转换工具
将HTML转化成Markdown的工具,增加了table的解析,以及更正了pre标签,此项目源于当时采集gitbook等类似平台的文章时使用!
安装
npm install h2m 注意:将项目的converters文件夹覆盖node_modules/h2m 的converters文件夹
如何使用
h2m(html[, options])
例子
var h2m = require('h2m') var md = h2m('<h1>Hello World</h1>') // md = '# Hello World'
选项
converter: the converter you can choose. now support CommonMark(default) and MarkdownExtra
overides: custom converter behavior:
h2m('<a href="http://www.baidu.com">h2m</a>', { overides: { a: function(node) { /** node is an object as the a tag: { name: "a", attrs: { href: 'http://www.baidu.com' }, md: 'h2m' } */ return `[This is an link element](${node.attrs.href})` } } } // output [This is an link element](http://www.baidu.com)
Support
h2m supports standard Markdown sytax: CommonMark now and Markdown Extra.
CommonMark
br
em
strong
code
a
img
hr
ul, ol
pre
div
p
blockquote
h1 ~ h6
Markdown Extra
Special Attributes for headers link and image
Fenced Code Blocks
dl, dt, dd Definition Lists
abbr Abbreviations
table
评论
treeifyarrToTree 转换工具
treeify.js-v0.0.3(MIT)treeify是将一个数组(每个元素包含相同的特定的规则)转换为一个树对象的工具。ConstructorParameterstreeify(data, id
treeifyarrToTree 转换工具
0
x-JsonConvertToolJSON 转换工具
JsonConvertTool是使用javafx开发的一款Json转换工具,目前支持Json转Xml、Json转Java实体类、Json转JavaPath、Json转C#实体类、Json转Excel、
x-JsonConvertToolJSON 转换工具
0
jsonpipeJSON 转换工具
jsonpipe是一个把JSON转换成基于行的UNIX友好格式的工具。jsonpipe用Python编写,因此最好使用pip以下命令安装:pipinstalljsonpipe请注意,它需要Python
jsonpipeJSON 转换工具
0
PostCSSCSS 转换工具
PostCSS是使用JS插件来转换CSS的工具,支持变量,混入,未来CSS语法,内联图像等等。PostCSS已经被许多大公司使用:谷歌,推特,阿里巴巴和Shopify。AutoprefixerPost
PostCSSCSS 转换工具
0