mirror of
https://github.com/vale981/boon
synced 2025-03-04 09:01:39 -05:00
more cheatsheets
This commit is contained in:
parent
5b789a6017
commit
c29d8a0f9e
9 changed files with 44 additions and 23 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -21,3 +21,4 @@ TAGS
|
|||
/colemak.tex
|
||||
/qwerty.pdf
|
||||
/qwerty.tex
|
||||
*.tex
|
||||
|
|
2
Makefile
2
Makefile
|
@ -1,3 +1,5 @@
|
|||
all: sheets
|
||||
|
||||
emacs ?= emacs
|
||||
|
||||
sheets: colemak.pdf qwerty.pdf qwertz.pdf workman.pdf
|
||||
|
|
|
@ -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
|
||||
[](http://stable.melpa.org/#/boon)),
|
||||
|
|
|
@ -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")))
|
||||
|
|
|
@ -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
|
||||
|
|
BIN
colemak.pdf
BIN
colemak.pdf
Binary file not shown.
BIN
qwerty.pdf
BIN
qwerty.pdf
Binary file not shown.
BIN
qwertz.pdf
Normal file
BIN
qwertz.pdf
Normal file
Binary file not shown.
BIN
workman.pdf
Normal file
BIN
workman.pdf
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue