From 29606788f53b4e8831d3f812cc379bee804a14d2 Mon Sep 17 00:00:00 2001 From: jwinnie Date: Mon, 29 Nov 2021 16:16:23 -0800 Subject: Improve documentation and formatting --- gmi2html.awk | 68 +++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 31 deletions(-) (limited to 'gmi2html.awk') diff --git a/gmi2html.awk b/gmi2html.awk index 91f863c..42334ac 100755 --- a/gmi2html.awk +++ b/gmi2html.awk @@ -1,6 +1,6 @@ # gmi2html.awk # -# Copyright (c) 2021 Rodrigo S. Caņibano (dracometallium) +# Copyright (c) 2021 Rodrigo S. Canibano (dracometallium) # Copyright (c) 2021 Jeremy Potter (jwinnie) # # Permission is hereby granted, free of charge, to any person obtaining a copy of this @@ -16,27 +16,27 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# Usage: -# $ awk -f gmi2html.awk -- $1 $2 $3 < path/to/gmi > path/to/html -# -# Where: -# - $1 is the title of the site, used in -# - $2 is the path of the stylesheet, relative to the HTML document -# - $3 is the URL of the original Gemini site (it is linked to in the -# footer of the HTML site) +# usage: +# $ awk -f gmi2html.awk -- <title> <css> <url> < path/to/gmi > path/to/html # +# parameters: +# <title>: the title of the document, used in the HTML <title> +# <css>: relative path to a CSS stylesheet +# <url>: URL of the original Gemini document, linked in the footer # Begin HTML document BEGIN { - printf "<!DOCTYPE html>\ - <head>\ - <meta charset=\"utf-8\">\ - <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\ - <link rel=\"stylesheet\" type=\"text/css\" href=\"%s\">\ - <title>%s\ - \ - ", ARGV[2], ARGV[1] - pre = 0 + printf "\ +\ +\ +\ +\ +\ +%s\ +\ +", ARGV[2], ARGV[1] + + pre = 0 list = 0 } @@ -70,12 +70,13 @@ BEGIN { /\* / { # Detect if this is the first item in # the list. If so, start a new