forked from mirrors/org-mode
ox-publish: Allow linking to encrypted Org files
* lisp/ox-html.el (org-html-link): Convert .org.gpg file links to .html, in addition to previously performed .org -> .html convertion. (org-html-link-org-files-as-html): Update the docstring. * doc/org-manual.org (Publishing links): * etc/ORG-NEWS (Publishing now supports links to encrypted Org files): Document the new feature.
This commit is contained in:
parent
3b0c4ad207
commit
f99902ecdf
|
@ -16472,13 +16472,16 @@ Settings]]), however, override everything.
|
||||||
#+cindex: links, publishing
|
#+cindex: links, publishing
|
||||||
|
|
||||||
To create a link from one Org file to another, you would use something
|
To create a link from one Org file to another, you would use something
|
||||||
like =[[file:foo.org][The foo]]= or simply =[[file:foo.org]]= (see [[*External Links]]). When
|
like =[[file:foo.org][The foo]]= or simply =[[file:foo.org]]= (see
|
||||||
published, this link becomes a link to =foo.html=. You can thus
|
[[*External Links]]). When published, this link becomes a link to
|
||||||
interlink the pages of your "Org web" project and the links will work
|
=foo.html=. You can thus interlink the pages of your "Org web"
|
||||||
as expected when you publish them to HTML. If you also publish the
|
project and the links will work as expected when you publish them to
|
||||||
Org source file and want to link to it, use an =http= link instead of
|
HTML. If you also publish the Org source file and want to link to it,
|
||||||
a =file:= link, because =file= links are converted to link to the
|
use an =http= link instead of a =file:= link, because =file= links are
|
||||||
corresponding =.html= file.
|
converted to link to the corresponding =.html= file.
|
||||||
|
|
||||||
|
Links to encrypted Org files, like =[[file:foo.org.gpg]]= are also
|
||||||
|
supported.
|
||||||
|
|
||||||
You may also link to related files, such as images. Provided you are
|
You may also link to related files, such as images. Provided you are
|
||||||
careful with relative file names, and provided you have also
|
careful with relative file names, and provided you have also
|
||||||
|
|
|
@ -143,6 +143,12 @@ discouraged when working with Org files.
|
||||||
*** Clock table can now produce quarterly reports
|
*** Clock table can now produce quarterly reports
|
||||||
|
|
||||||
=:step= clock table parameter can now be set to =quarter=.
|
=:step= clock table parameter can now be set to =quarter=.
|
||||||
|
*** Publishing now supports links to encrypted Org files
|
||||||
|
|
||||||
|
Links to other published Org files are automatically converted to the
|
||||||
|
corresponding html links. Now, this feature is also available when
|
||||||
|
links point to encrypted Org files, like
|
||||||
|
=[[file:foo.org.gpg::Heading]]=.
|
||||||
|
|
||||||
*** Interactive commands now support escaping text inside comment blocks
|
*** Interactive commands now support escaping text inside comment blocks
|
||||||
|
|
||||||
|
|
|
@ -839,6 +839,8 @@ are directly put into a \"href\" tag in HTML. However, links to other Org files
|
||||||
(recognized by the extension \".org\") should become links to the corresponding
|
(recognized by the extension \".org\") should become links to the corresponding
|
||||||
HTML file, assuming that the linked Org file will also be converted to HTML.
|
HTML file, assuming that the linked Org file will also be converted to HTML.
|
||||||
|
|
||||||
|
Links to \"file.org.gpg\" are also converted.
|
||||||
|
|
||||||
When nil, the links still point to the plain \".org\" file."
|
When nil, the links still point to the plain \".org\" file."
|
||||||
:group 'org-export-html
|
:group 'org-export-html
|
||||||
:type 'boolean)
|
:type 'boolean)
|
||||||
|
@ -3066,12 +3068,13 @@ INFO is a plist holding contextual information. See
|
||||||
(lambda (raw-path info)
|
(lambda (raw-path info)
|
||||||
;; Treat links to `file.org' as links to `file.html', if
|
;; Treat links to `file.org' as links to `file.html', if
|
||||||
;; needed. See `org-html-link-org-files-as-html'.
|
;; needed. See `org-html-link-org-files-as-html'.
|
||||||
|
(save-match-data
|
||||||
(cond
|
(cond
|
||||||
((and (plist-get info :html-link-org-files-as-html)
|
((and (plist-get info :html-link-org-files-as-html)
|
||||||
(string= ".org"
|
(let ((case-fold-search t))
|
||||||
(downcase (file-name-extension raw-path "."))))
|
(string-match "\\(.+\\)\\.org\\(?:\\.gpg\\)?$" raw-path)))
|
||||||
(concat (file-name-sans-extension raw-path) dot html-ext))
|
(concat (match-string 1 raw-path) dot html-ext))
|
||||||
(t raw-path))))
|
(t raw-path)))))
|
||||||
(type (org-element-property :type link))
|
(type (org-element-property :type link))
|
||||||
(raw-path (org-element-property :path link))
|
(raw-path (org-element-property :path link))
|
||||||
;; Ensure DESC really exists, or set it to nil.
|
;; Ensure DESC really exists, or set it to nil.
|
||||||
|
|
Loading…
Reference in New Issue