more cheatsheets

This commit is contained in:
Jean-Philippe Bernardy 2019-08-25 22:37:45 +02:00
parent 5b789a6017
commit c29d8a0f9e
9 changed files with 44 additions and 23 deletions

1
.gitignore vendored
View file

@ -21,3 +21,4 @@ TAGS
/colemak.tex
/qwerty.pdf
/qwerty.tex
*.tex

View file

@ -1,3 +1,5 @@
all: sheets
emacs ?= emacs
sheets: colemak.pdf qwerty.pdf qwertz.pdf workman.pdf

View file

@ -103,7 +103,7 @@ Installation
REQUIREMENTS
- Emacs version >= 25.1
- Qwerty, Qwertz or Colemak layout (Workman version partially implemented).
- Qwerty, Qwertz or Colemak layout (Workman version partially implemented -- contributions welcome).
Install Boon (perhaps using
[![MELPA](http://stable.melpa.org/packages/boon-badge.svg)](http://stable.melpa.org/#/boon)),

View file

@ -15,17 +15,18 @@
(concat
"["
(-reduce (lambda (x y) (concat x "," y))
(--map (let* ((b (lookup-key map (make-vector 1 it)))
(mn (boon-mnemonic-noformat b map)))
(format "(%d,(%S,\"%S\"))" it mn
(cond ((symbolp b) b))))
(-concat
(-iterate '1+ ?A 26)
(-iterate '1+ ?a 26)
'(?\; ?: ?- ?' ?, ?. ?< ?> ?/ ?? 32 ?\")
)))
(-non-nil
(--map (let ((b (lookup-key map (make-vector 1 it))))
(when b
(format "(%d,(%S,\"%S\"))" it (boon-mnemonic-noformat b map)
(cond ((symbolp b) b)))))
(-concat
(-iterate '1+ ?A 26)
(-iterate '1+ ?a 26)
'(?\; ?: ?- ?' ?, ?. ?< ?> ?/ ?? 32 ?\" )))))
"]"))
(defun boon-dump-cheatsheet (flavour)
"Dump cheatcheat info for FLAVOUR."
(let ((el (concat "boon-" flavour ".el")))

View file

@ -89,19 +89,20 @@ dropR n = reverse . drop n . reverse
keyHalf :: [(String, (TeX, Argument, TeX))]
-> String -> TexDiagram Object
keyHalf kmInfo k = case lookup k kmInfo of
Nothing -> error $ "key (" ++ k ++ ") not found in keymap."
Just (act,arg,mnem) -> do
up <- using (fill (argColor arg)) $ draw $ box "keyHalf"
upK <- label "k" $ textSize Huge $ sans $ textual $ k
upT <- label "scr" $ varwidth "45pt" $ sans $ textSize ScriptSize $ act
m <- (label "mnem" $ sans $ textSize Tiny $ mnem)
m # SW .=. up # SW
up # E .=. upT # E
up # W .=. upK # W
width up === constant keySize
height up === constant (keySize / 2)
return up
keyHalf kmInfo k = do
let (act,arg,mnem) = case lookup k kmInfo of
Nothing -> (mempty,Reserved,mempty)
Just (act,arg,mnem) -> (act,arg,mnem)
up <- using (fill (argColor arg)) $ draw $ box "keyHalf"
upK <- label "k" $ textSize Huge $ sans $ textual $ k
upT <- label "scr" $ varwidth "45pt" $ sans $ textSize ScriptSize $ act
m <- (label "mnem" $ sans $ textSize Tiny $ mnem)
m # SW .=. up # SW
up # E .=. upT # E
up # W .=. upK # W
width up === constant keySize
height up === constant (keySize / 2)
return up
keyDiagram :: [(String, (TeX, Argument, TeX))] -> String -> Diagram TeX Tex Object
@ -207,6 +208,22 @@ main = do
,rightHandK = [["y","u","i","o","p",""]
,["h","j","k","l",";","'"]
,["n","m",",",".","/",""]]}
"qwertz" -> cs
{leftHandK = [["q","w","e","r","t"]
,["a","s","d","f","g"]
,["y","x","c","v","b"]]
,rightHandK = [["z","u","i","o","p",""]
,["h","j","k","l","ö","ä"]
,["n","m",";",":","-",""]]}
"workman" -> cs
{leftHandK = [["q","d","r","w","b"]
,["a","s","h","t","g"]
,["z","x","m","c","v"]]
,rightHandK = [["j","f","u","p","k",";"]
,["y","n","e","o","i","'"]
,["k","l",",",".","/",""]]}
renderTex Plain flavor (docu cs')
docu :: CheatSheet -> TeX

Binary file not shown.

Binary file not shown.

BIN
qwertz.pdf Normal file

Binary file not shown.

BIN
workman.pdf Normal file

Binary file not shown.