html2gmi/README.md

53 lines
2 KiB
Markdown
Raw Normal View History

2020-08-01 05:10:13 -04:00
# html2gmi
2020-07-31 06:08:27 -04:00
A command line application to convert HTML to GMI (Gemini text/gemini), written in Go.
A simple wrapper around the Go library https://github.com/LukeEmmet/html2gemini
## Usage
```
html2gmi <flags>
2020-08-26 15:47:36 -04:00
Usage of html2gmi.exe:
-m, --citationMarkers Use footnote style citation markers
-c, --citationStart int Start citations from this index (default 1)
-i, --input string Input path. Otherwise uses stdin
-l, --linkEmitFrequency int Emit gathered links through the document after this number of paragraphs (default 2)
-n, --numberedLinks Number the links
-o, --output string Output path. Otherwise uses stdout
-v, --version Find out what version of html2gmi you're running
2020-07-31 06:08:27 -04:00
```
2020-08-21 03:23:17 -04:00
## Remarks
2020-07-31 06:08:27 -04:00
* linkEmitFrequency - this flag determines the frequency of the output of link lists. For example 1 means any links from the previous paragraph are emitted after each paragraph. 2, would mean they are emitted every two paragraphs and so on. Any gathered links are always emitted before a new heading.
* citationStart - this flag determines the start index of the links. By default this is 1, so the first link is labelled "[1]", but you can set this as required.
2020-08-26 15:44:24 -04:00
* citationMarkers - use a numbered marker in the text to indicate the location of the citation, [1], [2] etc.
* numberedLinks - number the links with a reference number [1], [2] etc. Certain command line Gemini clients may automatically add these, in which case you can omit them.
2020-07-31 06:08:27 -04:00
2020-08-26 15:44:24 -04:00
Simple tables will be displayed as preformatted content. Complex tables may not look perfect.
2020-07-31 06:08:27 -04:00
2020-08-26 15:44:24 -04:00
You can pipe content in from other applications, for example utilities that download HTML from the web.
2020-07-31 06:08:27 -04:00
2020-08-26 15:44:24 -04:00
To strip out cruft, use an HTML sanitiser before passing the content to this app.
2020-08-21 03:23:17 -04:00
## Building
Compile using Go.
Retrieve the package using Go get
```
go get github.com/LukeEmmet/html2gmi
```
Build the binary using Go build
```
go build github.com/LukeEmmet/html2gmi
```