Skip to content
forked from lunny/html2md

convert html to markdown, fork of github.com/lunny/html2md

Notifications You must be signed in to change notification settings

uncluttered/html2md

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Html2md is a Go library for converting html to markdown.

Installation

If you have gopm installed,

gopm get github.com/lunny/html2md

Or

go get github.com/lunny/html2md

Usage

  • Html2md already has some built-in html tag rules. For basic use:
    md := html2md.Convert(html)
  • If you want to add your own rules, you can
   html2md.AddRule(&html2md.Rule{
       patterns: []string{"hr"},
	   tp:       Void,
	   replacement: func(innerHTML string, attrs []string) string {
			return "\n\n* * *\n"
		},
   })

or

html2md.AddConvert(func(content string) string {
    return strings.ToLower(content)
})

Docs

LICENSE

BSD License http://creativecommons.org/licenses/BSD/

About

convert html to markdown, fork of github.com/lunny/html2md

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%