HTML转换工具 html2markdown

码农软件 · 软件分类 · Markdown开发包 · 2019-10-09 20:59:50

软件介绍

将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

本文地址:https://codercto.com/soft/d/16408.html

从问题到程序

从问题到程序

裘宗燕 / 机械工业出版社 / 2005-9-1 / 36.00元

本书以C作为讨论程序设计的语言,讨论了基本程序设计的各方面问题。书中给出程序实例时没有采用常见的提出问题,给出解答,再加些解释的简单三步形式,而是增加了许多问题的分析和讨论,以帮助读者认识程序设计过程的实质,理解从问题到程序的思考过程。书中还尽可能详尽地解释了许多与C语言和程序设计有关的问题。 本书适合作为高等院校计算机及相关专业的教材,也可供其他学习C程序设计语言的读者阅读。一起来看看 《从问题到程序》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具