summaryrefslogtreecommitdiff
path: root/docs/installation.org
blob: 59ba39b09662803d8d232393b47ffad9447fed69 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#+TITLE: Installation
#+DATE: [2020-08-05 Wed 15:31]
#+KEYWORDS: fc

Before using this package, ~org-fc-directories~ should be set to the
directory to search for org files containing flashcards.

The file used to store the review history can be customized with
~org-fc-review-history-file~ and defaults to ~/path/to/config/org-fc-reviews.tsv~.

This package is not (yet) available on MELPA / ELPA,
to install it, clone the repository (e.g. to ~src/org-fc/~)
and follow the setup instructions.

* Dependencies
Org-fc has been tested with org-mode version 9.3.6 and gawk version
5.1.0. You can check your versions with ~M-x org-version~
and ~gawk -V~.

- The =gawk= extension of =awk= for extracting review data from =.org= files
- =find= for finding all org files in the ~org-fc-directories~
- =xargs= for processing files in parallel
** Linux / UNIX
=find= and =xargs= should be included in most distributions, =gawk=
can be installed from source or using your package manager of choice.

Examples:
- =pacman -S gawk= (Arch Linux)
- =apt-get install gawk= (Ubuntu, Debian, ...)
- =yum install gawk= (CentOS)

For more information, see [[https://www.gnu.org/software/gawk/manual/html_node/Installation.html][gawk manual - Installation]].
** MacOS
On MacOS all dependencies can be installed using [[https://www.macports.org/][macports]] or [[https://brew.sh/][homebrew]].
=find= and =xargs= are part of the =findutils= package.

- =port install gawk findutils=
- =brew install gawk findutils=

You might have to adjust your =$PATH= to make sure Emacs can find all
relevant binaries.

#+BEGIN_SRC
  export PATH="/opt/local/libexec/gnubin:/opt/local/bin:$PATH"
#+END_SRC

For more information, refer to the documentation of macports /
homebrew.
* Manual Installation
#+begin_src bash
  cd ~/src/
  git clone https://git.sr.ht/~l3kn/org-fc
#+end_src

#+BEGIN_SRC emacs-lisp
  (add-to-list 'load-path "~/src/org-fc/")

  (require 'org-fc)
  (require 'org-fc-hydra)

  (setq org-fc-directories '("~/org/"))
#+END_SRC
* Setup with [[https://github.com/jwiegley/use-package/][use-package]]
Assuming you've manually cloned the repository.

#+BEGIN_SRC emacs-lisp :eval no-export
  (use-package hydra)
  (use-package org-fc
    :load-path "~/src/org-fc"
    :custom (org-fc-directories '("~/org/"))
    :config
    (require 'org-fc-hydra))
#+END_SRC

Or, using [[https://github.com/raxod502/straight.el/][straight.el]]:

#+BEGIN_SRC emacs-lisp :eval no-export
  (use-package hydra)
  (use-package org-fc
    :straight
    (org-fc
     :type git :repo "https://git.sr.ht/~l3kn/org-fc"
     :files (:defaults "awk" "demo.org"))
    :custom
    (org-fc-directories '("~/org/"))
    :config
    (require 'org-fc-hydra))
#+END_SRC

Note that in this case, you don't have to clone the repository.
* Setup with [[https://github.com/raxod502/straight.el/][straight.el]]
#+BEGIN_SRC emacs-lisp :eval no-export
  (straight-use-package 'hydra)
  (straight-use-package
   '(org-fc
     :type git :repo "https://git.sr.ht/~l3kn/org-fc"
     :files (:defaults "awk" "demo.org")
     :custom (org-fc-directories '("~/org/"))
     :config
     (require 'org-fc-hydra)))
#+END_SRC

* Setup with [[https://github.com/syl20bnr/spacemacs/][spacemacs]]
You don't need to manually clone the repository,
just put this in your =.spacemacs=:

#+BEGIN_SRC emacs-lisp :eval no-export
  ;; ...
  dotspacemacs-additional-packages
  '((org-fc
     :location (recipe :fetcher git
                       :url "https://git.sr.ht/~l3kn/org-fc"
                       :files (:defaults "awk" "demo.org"))))
  ;; ...
  (defun dotspacemacs/user-config ()
    ;; ...
    ;; Org-fc
    (use-package hydra)
    (require 'org-fc-hydra)
    (setq org-fc-directories '("~/org/"))
    ;; ...
    )
#+END_SRC