File: test.org

package info (click to toggle)
org-make-toc 0.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 208 kB
  • sloc: sh: 918; lisp: 342; makefile: 32
file content (33 lines) | stat: -rw-r--r-- 2,151 bytes parent folder | download | duplicates (3)
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
* Tests

** Pcase

#+BEGIN_SRC elisp
  (with-current-buffer (find-buffer-visiting "~/src/org-make-toc/test/data.org")
    (let ((tree (cddr (org-element-parse-buffer 'headline))))
      (org-walk-tree-pcase tree)))
#+END_SRC

#+RESULTS:
| headline | Contents        | nil                                   |
| headline | A               | ((headline A2 nil) (headline A3 nil)) |
| headline | B               | ((headline B2 nil) (headline B3 nil)) |
| headline | Ignore-Children |                                       |
| headline | C               | ((headline C2 nil) (headline C3 nil)) |
| headline | Invalid         | nil                                   |

** Depth

#+BEGIN_SRC elisp
  (with-current-buffer (find-buffer-visiting "~/src/org-make-toc/test/data.org")
    (let ((tree (cddr (org-element-parse-buffer 'headline))))
      (org-make-toc--remove-ignored-entries tree)))
#+END_SRC

#+RESULTS:
| headline | (:title A)               | ((headline (:title nil) ((headline (:title Hmm) nil) (headline (:title Oho) nil))) (headline (:title A1) nil) (headline (:title A2) nil) (headline (:title A3) nil)) |
| headline | (:title B)               | ((headline (:title B1) nil) (headline (:title B2) nil) (headline (:title B3) nil))                                                                                   |
| headline | (:title Ignore-Children) |                                                                                                                                                                      |
| headline | (:title C)               | ((headline (:title C1) nil) (headline (:title C2) nil) (headline (:title C3) nil))                                                                                   |
| headline | (:title Invalid)         | nil                                                                                                                                                                  |
| headline | (:title nil)             | ((headline (:title nil) nil))                                                                                                                                        |