jgm / gitit

A wiki using HAppS, pandoc, and git
GNU General Public License v2.0
2.15k stars 226 forks source link

Support for accesskey shortcuts #684

Open rybak opened 1 year ago

rybak commented 1 year ago

Overview

Implementation of #609. See more details in the commit message of the first commit.

Notes

I didn't know where to put function accesskey, so there are two copies: one in Handlers.hs and one in Layout.hs. Perhaps it should go into src/Network/Gitit/Util.hs? It doesn't seem to have any code related to HTML generation at the moment.

I also don't know how exactly generation of default help page works, so I've just added new section "Keyboard shortcuts" to the bottom of data/Help.page. I wrote conservatively little about how keyboard shortcuts work, just referring the user to MediaWiki's manual, but I'm open to expanding the help text however you see fit.

Testing

I've tested every accesskey locally by running Gitit from the repository:

$ stack build && stack exec gitit -- -f my.config

I couldn't build the code as is (I get Prelude.chr: bad argument: 1644167202 at the very end of stack build), but applying #683 locally fixed this issue for me.

rybak commented 1 year ago

CI on Windows failed because of https://github.com/haskell-hvr/missingh/issues/59, it seems.

jgm commented 1 year ago

I'm trying to upgrade the stack resolver, but it looks like we're stuck until hoauth2 puts out a release that works on text >= 2. https://github.com/freizl/hoauth2/issues/174