From 636c524df3b521334c93624d6b4bdde6c5af8146 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 7 Jul 2009 13:20:25 +0200 Subject: [PATCH] HTML export: Show UP and HOME links if defined org-export-html-link-up and org-export-html-link-home are now also inserted into normal HTML export, above the page title. --- lisp/ChangeLog | 5 +++++ lisp/org-html.el | 30 +++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9382b17e6..ec75024f3 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-07-07 Carsten Dominik + + * org-html.el (org-export-html-home/up-format): New option. + (org-export-as-html): Insert the up and HOME links. + 2009-07-06 Carsten Dominik * org-html.el (org-export-as-html): Insert the title into the diff --git a/lisp/org-html.el b/lisp/org-html.el index fc34a2971..5788093e5 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -221,6 +221,19 @@ CSS classes, then this prefic can be very useful." :group 'org-export-html :type 'string) +(defcustom org-export-html-home/up-format + "
+ UP + | + HOME +
" + "Snippet used to insert the HOME and UP links. This is a format, +the first %s will receive the UP link, the second the HOME link. +If both `org-export-html-link-up' and `org-export-html-link-home' are +empty, the entire snippet will be ignored." + :group 'org-export-html + :type 'string) + (defcustom org-export-html-toplevel-hlevel 2 "The level for level 1 headings in HTML export. This is also important for the classes that will be wrapped around headlines @@ -608,6 +621,12 @@ PUB-DIR is set, use this as the publishing directory." (file-name-sans-extension (file-name-nondirectory buffer-file-name))) "UNTITLED")) + (link-up (and (plist-get opt-plist :link-up) + (string-match "\\S-" (plist-get opt-plist :link-up)) + (plist-get opt-plist :link-up))) + (link-home (and (plist-get opt-plist :link-home) + (string-match "\\S-" (plist-get opt-plist :link-home)) + (plist-get opt-plist :link-home))) (dummy (setq opt-plist (plist-put opt-plist :title title))) (html-table-tag (plist-get opt-plist :html-table-tag)) (quote-re0 (concat "^[ \t]*" org-quote-string "\\>")) @@ -724,6 +743,7 @@ PUB-DIR is set, use this as the publishing directory." +%s %s @@ -744,7 +764,15 @@ lang=\"%s\" xml:lang=\"%s\"> "") (or charset "iso-8859-1")) - language language (org-html-expand title) + language language + (if (or link-up link-home) + (concat + (format org-export-html-home/up-format + (or link-up link-home) + (or link-home link-up)) + "\n") + "") + (org-html-expand title) (or charset "iso-8859-1") date author description keywords style))