All Projects → TruthHun → Html2md

TruthHun / Html2md

Licence: mit
html2markdown,converts html to markdown

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Html2md

React Markdown Preview
React component preview markdown text in web browser. The minimal amount of CSS to replicate the GitHub Markdown style.
Stars: ✭ 34 (-17.07%)
Mutual labels:  markdown
Grunt Md2html
Small Grunt MultiTask to convert Markdown files to HTML, supporting Grunt >= 1.0.0
Stars: ✭ 37 (-9.76%)
Mutual labels:  markdown
Mkdocs With Pdf
Generate a single PDF file from MkDocs repository.
Stars: ✭ 39 (-4.88%)
Mutual labels:  markdown
Advanced Javascript
Documentation based on John Resig's website on Advanced JavaScript
Stars: ✭ 35 (-14.63%)
Mutual labels:  markdown
Qlcommonmark
QuickLook generator for beautifully rendering CommonMark documents on macOS
Stars: ✭ 36 (-12.2%)
Mutual labels:  markdown
Recipes
A super minimal recipe website built on Markdown
Stars: ✭ 38 (-7.32%)
Mutual labels:  markdown
Markdownview
Android library to display markdown text.
Stars: ✭ 970 (+2265.85%)
Mutual labels:  markdown
Mdopen
View markdown files in the default browser
Stars: ✭ 42 (+2.44%)
Mutual labels:  markdown
Blankup Electron
Markdown editor with clarity +1, as a desktop application.
Stars: ✭ 37 (-9.76%)
Mutual labels:  markdown
Markdown Latex
A markdown parser for converting markdown to LaTeX written in PHP.
Stars: ✭ 40 (-2.44%)
Mutual labels:  markdown
Text Runner
Test runner for text
Stars: ✭ 35 (-14.63%)
Mutual labels:  markdown
Ods2md
Convert LibreOffice Calc Spreadsheets (*.ods) into Markdown tables.
Stars: ✭ 35 (-14.63%)
Mutual labels:  markdown
Markdownview
MarkdownView is an Android webview with the capablity of loading Markdown text or file and display it as HTML, it uses MarkdownJ and extends Android webview.
Stars: ✭ 993 (+2321.95%)
Mutual labels:  markdown
Gotenberg Go Client
Go client for the Gotenberg API
Stars: ✭ 35 (-14.63%)
Mutual labels:  markdown
Remark Boilerplate
A boilerplate to create presentations using remark, Gulp, Stylus and more.
Stars: ✭ 41 (+0%)
Mutual labels:  markdown
Wxparse
wxParse-微信小程序富文本解析自定义组件,支持HTML及markdown解析
Stars: ✭ 7,618 (+18480.49%)
Mutual labels:  markdown
Blink Mind React
A mind map library for react that based on immutable.js.
Stars: ✭ 38 (-7.32%)
Mutual labels:  markdown
Metalsmith
An extremely simple, pluggable static site generator.
Stars: ✭ 7,692 (+18660.98%)
Mutual labels:  markdown
Markdown2pdf
A simple library to convert markdown to pdf using Java
Stars: ✭ 41 (+0%)
Mutual labels:  markdown
Cv Maker
simple elegant markdown based resumes
Stars: ✭ 1,003 (+2346.34%)
Mutual labels:  markdown

html2md

convert html to markdown

在GitHub上搜了下HTML转markdown的工具,并按照star从高到低逐个试了下,感觉不怎么符合自己的预期,索性自己写一个。

HTML标签

并不是对所有的标签都做处理,比如preblockquotecode标签,这些没转成```> 或者是 `,因为markdown解析器解析不会有问题。

处理的标签

  • h1~h6
  • del
  • b
  • strong
  • i
  • em
  • dfn
  • var
  • cite
  • br
  • span
  • div
  • figure
  • p
  • article
  • nav
  • footer
  • header
  • section
  • table、thead、tbody、tr、th、td
  • ul、ol、li
  • hr

不作处理的标签

  • pre
  • blockquote
  • code

转化效果

为了测试转化效果,我分别从github.io、gitbook、readthedoc三个站点随便提取了个正文的HTML内容,然后并将其转成markdown,看了下效果,比较符合自己的预期。 当然,效果并不可能是100%的。

使用方法

go语言使用

  1. 安装 go get github.com/TruthHun/html2md
  2. 引入和调用
mdStr:=html2md.Convert(htmlStr)

其他

已经编译打包了win、mac和linux的64位的可执行文件,在bin目录下

windows使用:

html2md.exe input.html output.md

mac/linux使用:

html2md input.html output.md

其它语言,直接使用cmd调用二进制可执行文件对文档进行处理即可

支持我

如果您使用了当前包或程序,遇到问题,向我反馈就是对我最好的支持;如果项目帮到了您,给当前项目一个star,也是对我莫大的认可与支持。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].