diff options
author | bptato <nincsnevem662@gmail.com> | 2023-12-10 18:29:12 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-12-10 18:34:27 +0100 |
commit | f4d895c0c619dd098239fd30c4ba9d68b9caebc6 (patch) | |
tree | a8815e9a9de29c5690270e803d82ad2a365e6c9b /src/config | |
parent | c85dfb6a369ea1e9fc4b1f4cd7dba2b9d7b75483 (diff) | |
download | chawan-f4d895c0c619dd098239fd30c4ba9d68b9caebc6.tar.gz |
Add support for gemini by default, update readme
No need to leave gemini support in the bonus folder. Still TODO: proxy support.
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/config.nim | 23 |
1 files changed, 17 insertions, 6 deletions
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 = |