diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2025-01-07 15:06:26 +0100 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2025-01-07 15:09:47 +0100 |
commit | 74184dd792fde977b7c55b159038ad0d8d7f3c7e (patch) | |
tree | cb0957dfd65977720df6cf25db72281eee9610a8 /gemini.filter.dpi | |
parent | 92d425cd9093667c056706945bd33231664bbd5f (diff) |
Add CSS style for gemini pages
Diffstat (limited to 'gemini.filter.dpi')
-rwxr-xr-x | gemini.filter.dpi | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gemini.filter.dpi b/gemini.filter.dpi index 44059d6..cb3e55f 100755 --- a/gemini.filter.dpi +++ b/gemini.filter.dpi @@ -25,6 +25,9 @@ serve_404() { render_gemini() { printf "Content-type: text/html\r\n\r\n" + printf "<!doctype html><html><head><style>\n" + cat ~/.dillo/dpi/gemini/style.css || true + printf "</style></head>\n" if command -v ansi2html >/dev/null then ansi2html else cat @@ -36,9 +39,7 @@ render_gemini() { return str } BEGIN { - print "<!doctype html><body><style>"\ - "h1, h2, h3 { margin: 0; }\n"\ - "</style>" + print "<body>" } { sub(/\r$/, "") @@ -77,7 +78,7 @@ render_gemini() { match($0, /^(#+[ \t]*)/) text = substr($0, RLENGTH+1) html = escape_html(text) - printf "<%s style=\"font:sans-serif\">%s</%s>\n", tag, html, tag + printf "<%s>%s</%s>\n", tag, html, tag next } /^>/ { @@ -117,7 +118,7 @@ render_gemini() { printf "<div>%s</div>\n", escape_html($0) } END { - print "</body>" + print "</body></html>" } ' } |