aboutsummaryrefslogtreecommitdiff
path: root/gemini-to-web
diff options
context:
space:
mode:
Diffstat (limited to 'gemini-to-web')
-rw-r--r--gemini-to-web/src/gemini_to_web/html.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/gemini-to-web/src/gemini_to_web/html.py b/gemini-to-web/src/gemini_to_web/html.py
index f23484d..a8a42ec 100644
--- a/gemini-to-web/src/gemini_to_web/html.py
+++ b/gemini-to-web/src/gemini_to_web/html.py
@@ -101,11 +101,13 @@ def pretty(s):
def cli_to_html():
import argparse
import sys
+ import textwrap
argument_parser = argparse.ArgumentParser()
argument_parser.add_argument("--feed-title")
argument_parser.add_argument("--feed-href")
argument_parser.add_argument("file", nargs="*")
+ argument_parser.add_argument("--css", type=pathlib.Path)
args = argument_parser.parse_args()
assert not bool(args.feed_title) ^ bool(args.feed_href), "--feed-title and --feed-href must be both present or both absent"
@@ -114,6 +116,9 @@ def cli_to_html():
if args.feed_href:
extra_head.append(htmlgenerator.LINK(rel="alternate", type="application/rss+xml", title=args.feed_title, href=args.feed_href))
+ if args.css:
+ extra_head.append(htmlgenerator.STYLE("\n" + textwrap.indent(args.css.read_text(), " "*6).rstrip() + "\n" + " "*4))
+
def convert(input_):
gemtext = parser.parse(input_)
gemtext = list(gemtext)