More capture functions, add (non-working?) theme colours for fic export

master
trémeur 10 months ago
parent 6971e1848c
commit 5137914290

@ -47,6 +47,17 @@
(insert "* games\n** beaten")) (insert "* games\n** beaten"))
(insert "\n** beaten")))) (insert "\n** beaten"))))
(defun findhundred ()
"Find or create heading for completed games"
(filedate)
(goto-char (point-min))
(if (not (search-forward "** completed" nil t))
(if (not (search-forward "* games" nil t))
(progn
(goto-char (point-max))
(insert "* games\n** completed"))
(insert "\n** completed"))))
(defun findobtained () (defun findobtained ()
"Find or create heading for acquired games" "Find or create heading for acquired games"
(filedate) (filedate)
@ -142,10 +153,17 @@
theensemble) theensemble)
(defun setvenue () (defun setvenue ()
"Get the venue where a performance happened"
(setq venues (s-split "\n" (f-read "~/Documents/drive/admin/emacs/venues.txt") t)) (setq venues (s-split "\n" (f-read "~/Documents/drive/admin/emacs/venues.txt") t))
(setq thevenue (completing-read "Venue: " venues)) (setq thevenue (completing-read "Venue: " venues))
thevenue) thevenue)
(defun setconsole ()
"Get the console a game is played on"
(setq consoles (s-split "\n" (f-read "~/Documents/drive/admin/emacs/consoles.txt") t))
(setq theconsole (completing-read "Console: " consoles))
theconsole)
(defun bookcalc () (defun bookcalc ()
"Read in or calculate position in book" "Read in or calculate position in book"
(setq ispageno (y-or-n-p "Calculate percentage from page number?")) (setq ispageno (y-or-n-p "Calculate percentage from page number?"))
@ -178,8 +196,8 @@
"* %^{Title} (%^{Year})%(therating)" "* %^{Title} (%^{Year})%(therating)"
:jump-to-captured t) :jump-to-captured t)
("g" "Beat game" entry ("g" "Beat game" entry
(file+function "" findgame) (file+function "" findbeaten)
"* %^{Title}%(therating)" "* %^{Title} (%setconsole)"
:jump-to-captured t) :jump-to-captured t)
("m" "Musical performance" entry ("m" "Musical performance" entry
(file+function "" findperf) (file+function "" findperf)
@ -187,11 +205,11 @@
:jump-to-captured t) :jump-to-captured t)
("n" "Gameplay progress" entry ("n" "Gameplay progress" entry
(file+function "" findgaming) (file+function "" findgaming)
"* %^{Title}\n%?" "* %^{Title} (%(setconsole))\n%?"
:jump-to-captured t) :jump-to-captured t)
("o" "Obtained game" entry ("o" "Obtained game" entry
(file+function "" findobtained) (file+function "" findobtained)
"* %^{Title}" "* %^{Title} (%(setconsole))"
:jump-to-captured t) :jump-to-captured t)
("p" "Visited place" entry ("p" "Visited place" entry
(file+function "" findvisited) (file+function "" findvisited)
@ -200,6 +218,10 @@
("r" "Reading progress" entry ("r" "Reading progress" entry
(file+function "" findreading) (file+function "" findreading)
"* %^{Author} /%^{Title}/\n%(bookcalc)%?" "* %^{Author} /%^{Title}/\n%(bookcalc)%?"
:jump-to-captured t)
("1" "Completed game" entry
(file+function "" findhundred)
"* %^{Title} (%setconsole)"
:jump-to-captured t))) :jump-to-captured t)))
(global-set-key (kbd "C-c c") #'org-capture))) (global-set-key (kbd "C-c c") #'org-capture)))

@ -69,7 +69,7 @@
(while (re-search-forward "\\[fn:\\([0-9]*\\):\\([^•]*\\)•\\]" nil t) (while (re-search-forward "\\[fn:\\([0-9]*\\):\\([^•]*\\)•\\]" nil t)
(replace-match "@@html:<label for=\"\\1\" class=\"margin-toggle sidenote-number\"></label><input type=\"checkbox\" id=\"\\1\" class=\"margin-toggle\"/><span class=\"sidenote\">@@@@latex:\\\\footnote{@@\\2@@html:</span>@@@@latex:}@@")) (replace-match "@@html:<label for=\"\\1\" class=\"margin-toggle sidenote-number\"></label><input type=\"checkbox\" id=\"\\1\" class=\"margin-toggle\"/><span class=\"sidenote\">@@@@latex:\\\\footnote{@@\\2@@html:</span>@@@@latex:}@@"))
(let ((user-full-name "Tré") (let ((user-full-name "Tré")
(org-html-head "<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\"/><link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin/><link href=\"https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,700;1,400;1,700&display=swap\" rel=\"stylesheet\"/><link rel=\"stylesheet\" href=\"/fic/tufte.css\"/><link rel=\"stylesheet\" href=\"/home/mdd/Documents/drive/proj/fic-archive/build/tufte.css\"/>") (org-html-head "<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\"/><link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin/><link href=\"https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,700;1,400;1,700&display=swap\" rel=\"stylesheet\"/><link rel=\"stylesheet\" href=\"/fic/tufte.css\"/><link rel=\"stylesheet\" href=\"/home/mdd/Documents/drive/proj/fic-archive/build/tufte.css\"/><meta name=\"theme-color\" media=\"(prefers-color-scheme: light)\" content=\"#fffff8\" /><meta name=\"theme-color\" media=\"(prefers-color-scheme: dark)\" content=\"#151515\" />")
(org-export-with-author t) (org-export-with-author t)
(org-latex-default-class "memoir")) (org-latex-default-class "memoir"))
(org-html-export-to-html) (org-html-export-to-html)

Loading…
Cancel
Save