Rewrite custom org link types
This should fix a few issues with links (like org-download links) resolving to the incorrect org-directory or org-id-attach-dir (because it's resolved too early). I've also simplified and refactored the API to make it easier to grok.
This commit is contained in:
parent
2c0935cb62
commit
6159068b4d
3 changed files with 54 additions and 36 deletions
|
@ -397,15 +397,15 @@ underlying, modified buffer. This fixes that."
|
|||
'("wolfram" . "https://wolframalpha.com/input/?i=%s")
|
||||
'("doom-repo" . "https://github.com/hlissner/doom-emacs/%s"))
|
||||
|
||||
(+org-def-link "org" org-directory)
|
||||
(+org-def-link "doom" doom-emacs-dir)
|
||||
(+org-def-link "doom-docs" doom-docs-dir)
|
||||
(+org-def-link "doom-modules" doom-modules-dir)
|
||||
(+org-define-basic-link "org" 'org-directory)
|
||||
(+org-define-basic-link "doom" 'doom-emacs-dir)
|
||||
(+org-define-basic-link "doom-docs" 'doom-docs-dir)
|
||||
(+org-define-basic-link "doom-modules" 'doom-modules-dir)
|
||||
|
||||
;; Allow inline image previews of http(s)? urls or data uris
|
||||
(org-link-set-parameters "http" :image-data-fun #'+org-image-link)
|
||||
(org-link-set-parameters "https" :image-data-fun #'+org-image-link)
|
||||
(org-link-set-parameters "img" :image-data-fun #'+org-inline-data-image)
|
||||
(org-link-set-parameters "http" :image-data-fun #'+org-http-image-data-fn)
|
||||
(org-link-set-parameters "https" :image-data-fun #'+org-http-image-data-fn)
|
||||
(org-link-set-parameters "img" :image-data-fun #'+org-inline-image-data-fn)
|
||||
|
||||
;; Add support for youtube links + previews
|
||||
(require 'org-yt nil t))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue