[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org cf93247473 6/8: ox-publish: Allow linking to encryp
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org cf93247473 6/8: ox-publish: Allow linking to encrypted Org files |
Date: |
Sun, 25 Sep 2022 05:57:49 -0400 (EDT) |
branch: externals/org
commit cf932474737798093051cf830286d578c3f8d3e6
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Bastien <bzg@gnu.org>
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.
---
doc/org-manual.org | 17 ++++++++++-------
etc/ORG-NEWS | 6 ++++++
lisp/ox-html.el | 15 +++++++++------
3 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/doc/org-manual.org b/doc/org-manual.org
index 5af0c61872..ab8a295e5f 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -16472,13 +16472,16 @@ Settings]]), however, override everything.
#+cindex: links, publishing
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
-published, this link becomes a link to =foo.html=. You can thus
-interlink the pages of your "Org web" project and the links will work
-as expected when you publish them to HTML. If you also publish the
-Org source file and want to link to it, use an =http= link instead of
-a =file:= link, because =file= links are converted to link to the
-corresponding =.html= file.
+like =[[file:foo.org][The foo]]= or simply =[[file:foo.org]]= (see
+[[*External Links]]). When published, this link becomes a link to
+=foo.html=. You can thus interlink the pages of your "Org web"
+project and the links will work as expected when you publish them to
+HTML. If you also publish the Org source file and want to link to it,
+use an =http= link instead of a =file:= link, because =file= links are
+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
careful with relative file names, and provided you have also
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 09e8e475ed..cab64317f3 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -143,6 +143,12 @@ discouraged when working with Org files.
*** Clock table can now produce quarterly reports
=: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
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 9024701aa3..d247635e23 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -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
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."
:group 'org-export-html
:type 'boolean)
@@ -3066,12 +3068,13 @@ INFO is a plist holding contextual information. See
(lambda (raw-path info)
;; Treat links to `file.org' as links to `file.html', if
;; needed. See `org-html-link-org-files-as-html'.
- (cond
- ((and (plist-get info :html-link-org-files-as-html)
- (string= ".org"
- (downcase (file-name-extension raw-path "."))))
- (concat (file-name-sans-extension raw-path) dot html-ext))
- (t raw-path))))
+ (save-match-data
+ (cond
+ ((and (plist-get info :html-link-org-files-as-html)
+ (let ((case-fold-search t))
+ (string-match "\\(.+\\)\\.org\\(?:\\.gpg\\)?$"
raw-path)))
+ (concat (match-string 1 raw-path) dot html-ext))
+ (t raw-path)))))
(type (org-element-property :type link))
(raw-path (org-element-property :path link))
;; Ensure DESC really exists, or set it to nil.
- [elpa] externals/org updated (3e9f98c691 -> ebbc2ffaab), ELPA Syncer, 2022/09/25
- [elpa] externals/org fd195266dd 4/8: lisp/org-macs.el: Minor docstring enhancements, ELPA Syncer, 2022/09/25
- [elpa] externals/org 1a8490b031 2/8: Remove request-assign-future.txt, ELPA Syncer, 2022/09/25
- [elpa] externals/org 0d8440f55d 7/8: * lisp/ox-html.el (org-html-doctype-alist): Fix system identifier for XHTML 1.1 DTD, ELPA Syncer, 2022/09/25
- [elpa] externals/org cf93247473 6/8: ox-publish: Allow linking to encrypted Org files,
ELPA Syncer <=
- [elpa] externals/org 36c27f11d9 1/8: lisp/ox.el: Add Persian/Farsi translation to `org-export-dictionary', ELPA Syncer, 2022/09/25
- [elpa] externals/org 235c72e31f 5/8: lisp/org.el: Do not skip loading org-loaddefs when using `eval-buffer', ELPA Syncer, 2022/09/25
- [elpa] externals/org ebbc2ffaab 8/8: Merge remote-tracking branch 'github/main', ELPA Syncer, 2022/09/25
- [elpa] externals/org 6b729e24f2 3/8: README_ELPA: Remove from the repository, ELPA Syncer, 2022/09/25