From f4d895c0c619dd098239fd30c4ba9d68b9caebc6 Mon Sep 17 00:00:00 2001 From: bptato Date: Sun, 10 Dec 2023 18:29:12 +0100 Subject: Add support for gemini by default, update readme No need to leave gemini support in the bonus folder. Still TODO: proxy support. --- src/config/config.nim | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/config/config.nim b/src/config/config.nim index eef04f52..42ffafdd 100644 --- a/src/config/config.nim +++ b/src/config/config.nim @@ -352,12 +352,22 @@ proc getMailcap*(config: Config): tuple[mailcap: Mailcap, errs: seq[string]] = let configDir = getConfigDir() / "chawan" #TODO store this in config? const gopherPath0 = ChaPath("${%CHA_LIBEXEC_DIR}/gopher2html -u $MAILCAP_URL") let gopherPath = gopherPath0.unquote().get - var mailcap = @[MailcapEntry( - mt: "text", - subt: "gopher", - cmd: gopherPath, - flags: {HTMLOUTPUT} - )] + const geminiPath0 = ChaPath("${%CHA_LIBEXEC_DIR}/gmi2html") + let geminiPath = geminiPath0.unquote().get + var mailcap = @[ + MailcapEntry( + mt: "text", + subt: "gopher", + cmd: gopherPath, + flags: {HTMLOUTPUT} + ), + MailcapEntry( + mt: "text", + subt: "gemini", + cmd: geminiPath, + flags: {HTMLOUTPUT} + ) + ] var errs: seq[string] var found = false for p in config.external.mailcap: @@ -399,6 +409,7 @@ proc getMimeTypes*(config: Config): MimeTypes = const DefaultURIMethodMap = parseURIMethodMap(""" finger: cgi-bin:cha-finger?%s +gemini: cgi-bin:gmifetch?%s """) proc getURIMethodMap*(config: Config): URIMethodMap = -- cgit