minor tweak to flag documentation and readme

This commit is contained in:
Luke Emmet 2020-08-21 08:01:57 +01:00
parent 7e3518c314
commit b6bc6f087c
2 changed files with 14 additions and 9 deletions

View File

@ -6,17 +6,22 @@ A simple wrapper around the Go library https://github.com/LukeEmmet/html2gemini
## Usage ## Usage
``` ```
html2gmi -i <inputfile> -o <outputfile> html2gmi <flags>
-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)
-o, --output string Output path. Otherwise uses stdout
-v, --version Find out what version of html2gmi you're running
``` ```
## Flags
-i \<inputfile\> specifies the file to be processed (Otherwise uses stdin)
-o \<outputfile\> specifies the output to be saved (Otherwise uses stdout)
## Remarks ## Remarks
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.
You can pipe content in from other applications, for example utilities that download HTML from the web. You can pipe content in from other applications, for example utilities that download HTML from the web.
To strip out cruft, you can use an HTML sanitiser before passing the content to this app. To strip out cruft, you can use an HTML sanitiser before passing the content to this app.

View File

@ -14,8 +14,8 @@ import (
var version = "0.2.1" var version = "0.2.1"
var ( var (
output = flag.StringP("output", "o", "", "Output path. Otherwise uses stdout\n") output = flag.StringP("output", "o", "", "Output path. Otherwise uses stdout")
input = flag.StringP("input", "i", "", "Input path. Otherwise uses stdin\n") input = flag.StringP("input", "i", "", "Input path. Otherwise uses stdin")
citationStart = flag.IntP("citationStart", "c", 1, "Start citations from this index") citationStart = flag.IntP("citationStart", "c", 1, "Start citations from this index")
linkEmitFrequency = flag.IntP("linkEmitFrequency", "l", 2, "Emit gathered links through the document after this number of paragraphs") linkEmitFrequency = flag.IntP("linkEmitFrequency", "l", 2, "Emit gathered links through the document after this number of paragraphs")
verFlag = flag.BoolP("version", "v", false, "Find out what version of html2gmi you're running") verFlag = flag.BoolP("version", "v", false, "Find out what version of html2gmi you're running")