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 /colemak.tex
/qwerty.pdf /qwerty.pdf
/qwerty.tex /qwerty.tex
*.tex

View file

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

View file

@ -103,7 +103,7 @@ Installation
REQUIREMENTS REQUIREMENTS
- Emacs version >= 25.1 - 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 Install Boon (perhaps using
[![MELPA](http://stable.melpa.org/packages/boon-badge.svg)](http://stable.melpa.org/#/boon)), [![MELPA](http://stable.melpa.org/packages/boon-badge.svg)](http://stable.melpa.org/#/boon)),

View file

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

View file

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