feat: support org mode file links (#681)

* feat: support org-mode file links

Add a `:org-mode/insert-file-links` option to configuration.
This commit is contained in:
Tienson Qin
2020-11-18 07:27:40 -06:00
committed by GitHub
parent 85a1837004
commit 5d3b6322f5
8 changed files with 180 additions and 70 deletions

View File

@@ -27,6 +27,7 @@
(let [page (cond
(and (vector? block) (= "Link" (first block)))
(let [typ (first (:url (second block)))]
;; {:url ["File" "file:../pages/hello_world.org"], :label [["Plain" "hello world"]], :title nil}
(or
(and
(= typ "Search")
@@ -40,7 +41,11 @@
(and
(= typ "Complex")
(= (:protocol (second (:url (second block)))) "file")
(:link (second (:url (second block)))))))
(:link (second (:url (second block)))))
(and
(= typ "File")
(second (first (:label (second block)))))))
(and (vector? block) (= "Nested_link" (first block)))
(let [content (:content (last block))]