summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Rische <leon.rische@me.com>2020-01-15 14:11:55 +0100
committerLeon Rische <leon.rische@me.com>2020-01-15 14:11:55 +0100
commit95bf087522765291bd3eb8f98fffc30193a6fc69 (patch)
treed62e014fd595b833df7253af61b1ed3cd76f5d93
parent4e835f6ba1ec0fb42b95463e87cf81cd0153414c (diff)
Add & document default hydra
-rw-r--r--README.org51
-rw-r--r--org-fc-hydra.el17
2 files changed, 52 insertions, 16 deletions
diff --git a/README.org b/README.org
index ffb460e..4ee5dfb 100644
--- a/README.org
+++ b/README.org
@@ -101,15 +101,34 @@ in the review data table in awk..
To avoid these issues, all timestamps added or used by org-fc are
ISO8601 formatted (e.g. =2020-01-15T11:58:12=) using *UTC0* as the
timezone.
-** TODO Getting Started
+** Getting Started
Before using this package, a few variables have to be set:
-- ~org-fc-directories~ :: list of directories to search for flashcards
- ~org-fc-source-path~ :: should be set to the absolute path of the
+- ~org-fc-directories~ :: list of directories to search for flashcards
cloned repository
+- ~org-fc-review-history-file~ :: where to store the review history
-*** TODO Example setup using =use-package=
-*** TODO Basic Hydra
+Here is how that could look like using [[https://github.com/jwiegley/use-package/][use-package]]:
+
+#+begin_src emacs-lisp
+ (use-package org-fc
+ :load-path "~/src/org-fc"
+ :config
+ (setq org-fc-source-path "~/src/org-fc/")
+ (setq org-fc-directories '("~/org"))
+ (setq org-fc-review-history-file "~/org/fc_reviews.tsv"))
+#+end_src
+*** Default Hydra
+[[file:org-fc-hydra.el]] defines a hydra for accessing commonly used
+org-fc commands and for marking headlines as flashcards.
+
+It can be loaded and bound to a hotkey like this:
+
+#+begin_src emacs-lisp
+ (require 'org-fc-hydra)
+ (global-set-key (kbd "C-c f") 'org-fc-hydra/body)
+#+end_src
*** TODO Demo File
A file demonstrating all card types is included.
~M-x org-fc-demo~ starts a review of this file.
@@ -124,13 +143,13 @@ Review data (ease, interval in days, box, due date) is stored in a table
in a drawer inside the card.
#+begin_src org
-:REVIEW_DATA:
-| position | ease | box | interval | due |
-|----------+------+-----+----------+------------------------|
-| 2 | 2.65 | 6 | 107.13 | 2020-04-07T01:01:00 |
-| 1 | 2.65 | 6 | 128.19 | 2020-04-29T06:44:00 |
-| 0 | 2.95 | 6 | 131.57 | 2020-04-30T18:03:00 |
-:END:
+ :REVIEW_DATA:
+ | position | ease | box | interval | due |
+ |----------+------+-----+----------+------------------------|
+ | 2 | 2.65 | 6 | 107.13 | 2020-04-07T01:01:00 |
+ | 1 | 2.65 | 6 | 128.19 | 2020-04-29T06:44:00 |
+ | 0 | 2.95 | 6 | 131.57 | 2020-04-30T18:03:00 |
+ :END:
#+end_src
Review results are appended to a csv file to avoid cluttering the org
@@ -143,11 +162,11 @@ making statistics for how many cards were created in the last day /
week / month.
#+begin_src org
-:PROPERTIES:
-:ID: 4ffe66a7-7b5c-4811-bd3e-02b5c0862f55
-:FC_TYPE: normal
-:FC_CREATED: 2019-10-11T14:08:32
-:END:
+ :PROPERTIES:
+ :ID: 4ffe66a7-7b5c-4811-bd3e-02b5c0862f55
+ :FC_TYPE: normal
+ :FC_CREATED: 2019-10-11T14:08:32
+ :END:
#+end_src
Card types (should) implement a ~org-fc-type-...-init~ command that
diff --git a/org-fc-hydra.el b/org-fc-hydra.el
new file mode 100644
index 0000000..8bf108b
--- /dev/null
+++ b/org-fc-hydra.el
@@ -0,0 +1,17 @@
+(defhydra org-fc-hydra ()
+ ("m" org-fc-dashboard "Dashboard" :exit t)
+ ("r" org-fc-review-all "Start Review")
+ ("u" org-fc-update "Update Card")
+ ("t" org-fc-hydra-type/body "Init Type" :exit t)
+ ("q" nil "Quit" :exit t))
+
+(defhydra org-fc-hydra-type ()
+ ("n" org-fc-type-normal-init "Normal" :exit t)
+ ("t" org-fc-type-text-input-init "Text Input" :exit t)
+ ("d" org-fc-type-double-init "Double" :exit t)
+ ("d" (org-fc-type-cloze-init 'deletion) "Deletion" :exit t)
+ ("e" (org-fc-type-cloze-init 'enumeration) "Enum" :exit t)
+ ("x" (org-fc-type-cloze-init 'context) "Context" :exit t)
+ ("q" nil "Quit" :exit t))
+
+(provide 'org-fc-hydra)