From: Arun Isaac <theroarofthedragon@gmail.com>
To: Emacs orgmode <emacs-orgmode@gnu.org>
Subject: [PATCH] Implement RSS_FEED_URL option keyword
Date: Fri, 11 Dec 2015 02:50:19 +0530 [thread overview]
Message-ID: <87io4657cc.fsf@gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 573 bytes --]
Hi,
I have implemented a new option keyword, RSS_FEED_URL, for the RSS
exporter backend.
The RSS_FEED_URL goes into the atom:link element that identifies the
feed's own URL.
http://www.rssboard.org/rss-profile#namespace-elements-atom-link
Currently, the feed URL is assumed to be html-link-home or
publishing-directory concatenated with the output filename of the
feed. This need not necessarily be so. So, the RSS_FEED_URL option
keyword is introduced to let the user customize the feed URL.
Please review the patch and consider for inclusion.
Thanks,
Arun Isaac.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: rss-feed-url.patch --]
[-- Type: text/x-diff, Size: 2513 bytes --]
From c0447601cd77ae8877f7ea42bdadcc4179cd0113 Mon Sep 17 00:00:00 2001
From: Arun Isaac <theroarofthedragon@gmail.com>
Date: Fri, 11 Dec 2015 02:12:59 +0530
Subject: [PATCH] ox-rss: Implement RSS_FEED_URL option keyword
* contrib/lisp/ox-rss.el (org-rss-build-channel-info): Try to use the
specified RSS_FEED_URL option keyword as publink before resorting to
concatenating blogurl with output filename.
The RSS_FEED_URL goes into the atom:link element that identifies the
feed's own URL. Currently, the feed URL is assumed to be html-link-home
or publishing-directory concatenated with the output filename of the
feed. This need not always be so. So, the RSS_FEED_URL option keyword
is introduced to let the user customize the feed URL.
---
| 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
--git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
index 4cdfe0e..39fce30 100644
--- a/contrib/lisp/ox-rss.el
+++ b/contrib/lisp/ox-rss.el
@@ -31,10 +31,11 @@
;; `org-rss-export-as-rss' (temporary buffer) and `org-rss-export-to-rss'
;; (as a ".xml" file).
;;
-;; This backend understands two new option keywords:
+;; This backend understands three new option keywords:
;;
;; #+RSS_EXTENSION: xml
;; #+RSS_IMAGE_URL: http://myblog.org/mypicture.jpg
+;; #+RSS_FEED_URL: http://myblog.org/feeds/blog.xml
;;
;; It uses #+HTML_LINK_HOME: to set the base url of the feed.
;;
@@ -127,6 +128,7 @@ When nil, Org will create ids using `org-icalendar-create-uid'."
(:with-toc nil nil nil) ;; Never include HTML's toc
(:rss-extension "RSS_EXTENSION" nil org-rss-extension)
(:rss-image-url "RSS_IMAGE_URL" nil org-rss-image-url)
+ (:rss-feed-url "RSS_FEED_URL" nil nil t)
(:rss-categories nil nil org-rss-categories))
:filters-alist '((:filter-final-output . org-rss-final-function))
:translate-alist '((headline . org-rss-headline)
@@ -331,10 +333,11 @@ as a communication channel."
(image (url-encode-url (plist-get info :rss-image-url)))
(ifile (plist-get info :input-file))
(publink
- (concat (file-name-as-directory blogurl)
- (file-name-nondirectory
- (file-name-sans-extension ifile))
- "." rssext)))
+ (or (plist-get info :rss-feed-url)
+ (concat (file-name-as-directory blogurl)
+ (file-name-nondirectory
+ (file-name-sans-extension ifile))
+ "." rssext))))
(format
"\n<title>%s</title>
<atom:link href=\"%s\" rel=\"self\" type=\"application/rss+xml\" />
--
2.6.3
next reply other threads:[~2015-12-10 21:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-10 21:20 Arun Isaac [this message]
2015-12-10 21:33 ` [PATCH] Implement RSS_FEED_URL option keyword Arun Isaac
2015-12-26 14:00 ` Nicolas Goaziou
2015-12-26 14:49 ` Arun Isaac
2016-02-22 17:04 ` Arun Isaac
2016-02-25 9:11 ` Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87io4657cc.fsf@gmail.com \
--to=theroarofthedragon@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.