Skip to content

Commit fbd899d

Browse files
committed
- [#] update README
1 parent 09f5064 commit fbd899d

1 file changed

Lines changed: 108 additions & 46 deletions

File tree

README.md

Lines changed: 108 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,44 @@
1+
# html2md
2+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
3+
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
4+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
15

26
[![MIT License](http://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
37
[![GoDoc](https://godoc.org/github.com/suntong/html2md?status.svg)](http://godoc.org/github.com/suntong/html2md)
48
[![Go Report Card](https://goreportcard.com/badge/github.com/suntong/html2md)](https://goreportcard.com/report/github.com/suntong/html2md)
5-
[![travis Status](https://travis-ci.org/suntong/html2md.svg?branch=master)](https://travis-ci.org/suntong/html2md)
6-
[![PoweredBy WireFrame](https://github.com/go-easygen/wireframe/blob/master/PoweredBy-WireFrame-R.svg)](http://godoc.org/github.com/go-easygen/wireframe)
9+
[![Build Status](https://github.com/suntong/html2md/actions/workflows/go-release-build.yml/badge.svg?branch=master)](https://github.com/suntong/html2md/actions/workflows/go-release-build.yml)
10+
[![PoweredBy WireFrame](https://github.com/go-easygen/wireframe/blob/master/PoweredBy-WireFrame-B.svg)](http://godoc.org/github.com/go-easygen/wireframe)
711

8-
# TOC
12+
13+
14+
## TOC
915
- [html2md - HTML to Markdown converter](#html2md---html-to-markdown-converter)
1016
- [Usage](#usage)
1117
- [$ html2md](#-html2md)
12-
- [Examples](#examples)
13-
- [Simplest form](#simplest-form)
14-
- [Using goquery](#using-goquery)
18+
- [Examples](#examples)
19+
- [Simplest form](#simplest-form)
20+
- [Using goquery](#using-goquery)
1521
- [The options and plugins](#the-options-and-plugins)
16-
- [Testing the new table plugins](#testing-the-new-table-plugins)
17-
- [Download/Install](#downloadinstall)
18-
- [Download binaries](#download-binaries)
19-
- [Install Source](#install-source)
20-
- [Credits & Authors](#credits-&-authors)
22+
- [Testing the new table plugins](#testing-the-new-table-plugins)
2123
- [Credits](#credits)
22-
- [Similar Projects](#similar-projects)
23-
- [Author(s) & Contributor(s)](#author(s)-&-contributor(s))
24+
- [Credits](#credits-1)
25+
- [Similar Projects](#similar-projects)
2426

25-
# html2md - HTML to Markdown converter
27+
## html2md - HTML to Markdown converter
2628

2729
The `html2md` makes use of `github.com/JohannesKaufmann/html-to-markdown`
2830
to convert HTML into Markdown, which is using an [HTML Parser](https://github.com/PuerkitoBio/goquery) to avoid the use of `regexp` as much as possible, which can prevent some [weird cases](https://stackoverflow.com/a/1732454) and allows it to be used for cases where the input is totally unknown.
2931

3032
![gopher stading on top of a machine that converts a box of html to blocks of markdown](https://github.com/JohannesKaufmann/html-to-markdown/raw/master/logo.png)
3133

3234

33-
# Usage
35+
## Usage
3436

3537
### $ html2md
3638
```sh
3739
HTML to Markdown
38-
Version 0.2.01 built on 2020-08-08
39-
Copyright (C) 2020, Tong Sun
40+
Version 1.0.0 built on 2023-05-02
41+
Copyright (C) 2020-2023, Tong Sun
4042

4143
HTML to Markdown converter on command line
4244

@@ -60,6 +62,7 @@ Options:
6062
--opt-strong-delimiter Option StrongDelimiter
6163
--opt-link-style Option LinkStyle
6264
--opt-link-reference-style Option LinkReferenceStyle
65+
--opt-escape-mode Option EscapeMode
6366

6467
-A, --plugin-conf-attachment Plugin ConfluenceAttachments
6568
-C, --plugin-conf-code Plugin ConfluenceCodeBlock
@@ -73,9 +76,9 @@ Options:
7376
-Y, --plugin-youtube Plugin YoutubeEmbed
7477
```
7578

76-
# Examples
79+
### Examples
7780

78-
## Simplest form
81+
#### Simplest form
7982

8083
```md
8184
$ html2md -i https://github.com/suntong/html2md | head -3
@@ -84,7 +87,7 @@ $ html2md -i https://github.com/suntong/html2md | head -3
8487
[Homepage](https://github.com/)
8588
```
8689

87-
## Using goquery
90+
#### Using goquery
8891

8992
The most useful feature is to use and pass a [goquery](https://github.com/PuerkitoBio/goquery) selection to filter for the content you want.
9093

@@ -93,7 +96,7 @@ $ html2md -i https://github.com/JohannesKaufmann/html-to-markdown -s "div.Border
9396
```
9497

9598

96-
## The options and plugins
99+
### The options and plugins
97100

98101
Works as expected:
99102

@@ -113,7 +116,7 @@ $ echo 'Only <del>blue ones</del> <s> left</s>' | html2md -i --plugin-strikethro
113116
Only ~blue ones~ ~left~
114117
```
115118

116-
## Testing the new table plugins
119+
#### Testing the new table plugins
117120

118121
```sh
119122
$ cat $GOPATH/src/github.com/JohannesKaufmann/html-to-markdown/testdata/TestPlugins/table/input.html | html2md -i -T | head -6
@@ -146,47 +149,106 @@ $ cat $GOPATH/src/github.com/JohannesKaufmann/html-to-markdown/testdata/TestPlug
146149
+
147150
```
148151

149-
# Download/Install
150-
152+
## Credits
151153

152-
## Download binaries
153154

154-
- The latest binary executables are available right under the github release page
155-
https://github.com/suntong/html2md/releases
156-
as the result of the Continuous-Integration process.
157-
- I.e., they are built during every git tagged push, automatically by [GitHub Actions](https://github.com/features/actions), right from the source code, truely WYSIWYG.
158-
- The `.deb`, `.rpm` and `.apk` packages are readily available, as well as the executables for other Linux and Windows as well.
159-
- Pick & choose the binary executable that suits your OS and its architecture. E.g., for Linux, it would most probably be the `html2md_ver_linux_amd64.tar.gz` file.
160-
- Unzip it and put the executable somewhere in the PATH, after downloading it.
155+
### Credits
161156

157+
- [Johannes Kaufmann's html-to-markdown](https://github.com/JohannesKaufmann/html-to-markdown) that does the heavy lifting behind the scene.
162158

163-
## Install Source
159+
### Similar Projects
164160

165-
To install the source code instead:
161+
- [turndown (js)](https://github.com/domchristie/turndown), a very good library written in javascript.
162+
- [lunny/html2md](https://github.com/lunny/html2md), which is using [regex instead of goquery](https://stackoverflow.com/a/1732454), which exhibits a few edge cases which prompted `github.com/JohannesKaufmann/html-to-markdown`
163+
- [jaytaylor/html2text](https://github.com/jaytaylor/html2text), which is not converting to markdown but plain text.
166164

167-
```
168-
go install github.com/suntong/html2md@latest
165+
## Download/install binaries
166+
167+
- The latest binary executables are available
168+
as the result of the Continuous-Integration (CI) process.
169+
- I.e., they are built automatically right from the source code at every git release by [GitHub Actions](https://docs.github.com/en/actions).
170+
- There are two ways to get/install such binary executables
171+
* Using the **binary executables** directly, or
172+
* Using **packages** for your distro
173+
174+
### The binary executables
175+
176+
- The latest binary executables are directly available under
177+
https://github.com/suntong/html2md/releases/latest
178+
- Pick & choose the one that suits your OS and its architecture. E.g., for Linux, it would be the `html2md_verxx_linux_amd64.tar.gz` file.
179+
- Available OS for binary executables are
180+
* Linux
181+
* Mac OS (darwin)
182+
* Windows
183+
- If your OS and its architecture is not available in the download list, please let me know and I'll add it.
184+
- The manual installation is just to unpack it and move/copy the binary executable to somewhere in `PATH`. For example,
185+
186+
``` sh
187+
tar -xvf html2md_*_linux_amd64.tar.gz
188+
sudo mv -v html2md_*_linux_amd64/html2md /usr/local/bin/
189+
rmdir -v html2md_*_linux_amd64
169190
```
170191

171-
# Credits & Authors
172192

193+
### Distro package
173194

174-
## Credits
195+
- [Packages available for Linux distros](https://cloudsmith.io/~suntong/repos/repo/packages/) are
196+
* [Alpine Linux](https://cloudsmith.io/~suntong/repos/repo/setup/#formats-alpine)
197+
* [Debian](https://cloudsmith.io/~suntong/repos/repo/setup/#formats-deb)
198+
* [RedHat](https://cloudsmith.io/~suntong/repos/repo/setup/#formats-rpm)
175199

176-
- [Johannes Kaufmann's html-to-markdown](github.com/JohannesKaufmann/html-to-markdown) that does the heavy lifting behind the scene.
200+
The repo setup instruction url has been given above.
201+
For example, for [Debian](https://cloudsmith.io/~suntong/repos/repo/setup/#formats-deb) --
177202

178-
## Similar Projects
203+
### Debian package
179204

180-
- [turndown (js)](https://github.com/domchristie/turndown), a very good library written in javascript.
181-
- [lunny/html2md](https://github.com/lunny/html2md), which is using [regex instead of goquery](https://stackoverflow.com/a/1732454), which exhibits a few edge cases which prompted `github.com/JohannesKaufmann/html-to-markdown`
182-
- [jaytaylor/html2text](https://github.com/jaytaylor/html2text), which is not converting to markdown but plain text.
183205

184-
## Author(s) & Contributor(s)
206+
```sh
207+
curl -1sLf \
208+
'https://dl.cloudsmith.io/public/suntong/repo/setup.deb.sh' \
209+
| sudo -E bash
210+
211+
# That's it. You then can do your normal operations, like
212+
213+
sudo apt-get update
214+
apt-cache policy html2md
215+
216+
sudo apt-get install -y html2md
217+
```
218+
219+
## Install Source
220+
221+
To install the source code instead:
222+
223+
```
224+
go install github.com/suntong/html2md
225+
```
226+
227+
## Author
185228

186229
Tong SUN
187230
![suntong from cpan.org](https://img.shields.io/badge/suntong-%40cpan.org-lightgrey.svg "suntong from cpan.org")
188231

232+
_Powered by_ [**WireFrame**](https://github.com/go-easygen/wireframe)
189233
[![PoweredBy WireFrame](https://github.com/go-easygen/wireframe/blob/master/PoweredBy-WireFrame-Y.svg)](http://godoc.org/github.com/go-easygen/wireframe)
190-
_Powered by_ [**WireFrame**](https://github.com/go-easygen/wireframe), the _one-stop wire-framing solution_ for Go cli based projects, from start to deploy.
234+
the _one-stop wire-framing solution_ for Go cli based projects, from _init_ to _deploy_.
235+
236+
## Contributors ✨
237+
238+
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
239+
240+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
241+
<!-- prettier-ignore-start -->
242+
<!-- markdownlint-disable -->
243+
<table>
244+
<tr>
245+
<td align="center"><a href="https://github.com/suntong"><img src="https://avatars.githubusercontent.com/u/422244?v=4?s=100" width="100px;" alt=""/><br /><sub><b>suntong</b></sub></a><br /><a href="https://github.com/go-cc/cc2py2/commits?author=suntong" title="Code">💻</a> <a href="#ideas-suntong" title="Ideas, Planning, & Feedback">🤔</a> <a href="#design-suntong" title="Design">🎨</a> <a href="#data-suntong" title="Data">🔣</a> <a href="https://github.com/go-cc/cc2py2/commits?author=suntong" title="Tests">⚠️</a> <a href="https://github.com/go-cc/cc2py2/issues?q=author%3Asuntong" title="Bug reports">🐛</a> <a href="https://github.com/go-cc/cc2py2/commits?author=suntong" title="Documentation">📖</a> <a href="#blog-suntong" title="Blogposts">📝</a> <a href="#example-suntong" title="Examples">💡</a> <a href="#tutorial-suntong" title="Tutorials">✅</a> <a href="#tool-suntong" title="Tools">🔧</a> <a href="#platform-suntong" title="Packaging/porting to new platform">📦</a> <a href="https://github.com/go-cc/cc2py2/pulls?q=is%3Apr+reviewed-by%3Asuntong" title="Reviewed Pull Requests">👀</a> <a href="#question-suntong" title="Answering Questions">💬</a> <a href="#maintenance-suntong" title="Maintenance">🚧</a> <a href="#infra-suntong" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
246+
</tr>
247+
</table>
248+
249+
<!-- markdownlint-restore -->
250+
<!-- prettier-ignore-end -->
251+
252+
<!-- ALL-CONTRIBUTORS-LIST:END -->
191253

192-
All patches welcome.
254+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

0 commit comments

Comments
 (0)