Skip to content

Commit f1494c6

Browse files
author
George Moutsopoulos
committed
docs and update
1 parent dd9f6a2 commit f1494c6

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

Readme.org

+11
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,17 @@ This does not register an annotator with the ~org-annotate-code-info-alist~. One
105105
("i" "Insert file to index" plain #'org-annotate-index-capture-finding-location "%?")
106106
#+end_src
107107
You can then start building an index with descriptions of your files in each directory.
108+
** projects
109+
To start using
110+
#+begin_src
111+
(require 'org-annotate-index)
112+
#+end_src
113+
This will add hierarchical nodes based on the folders and subfolders relative to a projectile root. Besides a custom id that is used for identifying the nodes, a DIR property is also set so that you can use ~org-attach~. To use it with ~org-capture~ add this to the templates
114+
#+begin_src
115+
("f" "Insert file to index" plain #'org-annotate-projects-capture-finding-location "%?")
116+
#+end_src
117+
Alternatively, you can use ~org-annotate-projects-create~. The folders are saved by default in a single ~projects.org~ in the root folder, which you can visit with ~org-annotate-projects-visit-org-file~.
118+
108119
* Similar Packages
109120
If you know of similar packages, please let me know
110121
- ~org-annotate-file~ is similar, but ~org-annotate-code~ is presently configurable

org-annotate-projects.el

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
(defcustom org-annotate-projects-org-file "projects.org" "Org file for projects")
2121

2222
(defun org-annotate-projects-get-project-root ()
23-
(or org-annotate-projects-root (projectile-project-root)))
23+
(expand-file-name (or org-annotate-projects-root (projectile-project-root))))
2424

2525
(defun org-annotate-projects-get-org-file ()
2626
(concat (org-annotate-projects-get-project-root) "/" org-annotate-projects-org-file))
@@ -35,8 +35,8 @@
3535
(buffer-file-name))
3636
(t
3737
(buffer-file-name))))))
38-
(expand-file-name (read-directory-name "Add folder to projects: " this-dir)
39-
(org-annotate-projects-get-project-root))))
38+
(directory-file-name (file-relative-name (read-directory-name "Add folder to projects: " this-dir)
39+
(org-annotate-projects-get-project-root)))))
4040

4141
(defun org-annotate-code-cumulate-mapconcat (sequence seperator)
4242
"On the SEQUENCE of strings (a b c) creates (a a/b a/b/c)."
@@ -54,7 +54,7 @@
5454
(let ((wspfolder (org-annotate-projects-get-folder)))
5555
(mapcar (lambda (node) (list :id (org-link-make-string (concat "file:" node))
5656
:heading (car (last (split-string node "/")))
57-
:properties (list (cons "DIR" (org-link-make-string (concat "file:" node))))))
57+
:properties (list (cons "DIR" node))))
5858
(org-annotate-projects-cumulate-mapconcat (split-string wspfolder "/")))))
5959

6060

0 commit comments

Comments
 (0)