commit 565829ea1a7e27d2df6f8260e3e2d3c870e3bba9
parent c9bcf0cb7824fd39e810a45394bc0a157185e5a1
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Fri, 11 Sep 2020 22:10:55 -0700
Tweak output
for plain-text the body is no longer indented.
for html the author is put inside a header tag.
for html if the link field is missing it is replaced with '#`.
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/scripts/.local/bin/sfeed.awk b/scripts/.local/bin/sfeed.awk
@@ -13,13 +13,15 @@ function basename(path) {
function plain(title, author, content) {
gsub(/\\n/, "\n", content);
gsub(/\\t/, " ", content);
- gsub("\n", "\n\t", content);
- printf "%s\nby %s\n\n\t%s\n", title, author, content
+ printf "%s\nby %s\n\n%s\n", title, author, content
}
function html(title, link, author, content) {
gsub(/\\[nt]/, " ", content);
- printf "<article><header><h1><a href=%s>%s</a></h1><address>by %s</address></header>%s</article>\n", link, title, author, content
+ if (link == "") {
+ link = "#";
+ }
+ printf "<article><header><h1><a href=\"%s\">%s</a></h1><h2><address>by %s</address></h2></header>%s</article>\n", link, title, author, content
}
{