emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
   commit b7f5efdc4e1ed07f295d28a05fab3588c4194110 (patch)
   parent 8af710c41 Add a commentary: how to test org-e-latex.el.
     tree 402352c63f327b2a3919f7038b6aee143b386021
   author Bastien Guerry <bzg@altern.org>  2011-12-11 16:50:05 +0100
committer Bastien Guerry <bzg@altern.org>  2011-12-11 16:50:05 +0100

New option `org-export-html-headline-anchor-format'.

* org-html.el (org-export-html-headline-anchor-format): New
option.
(org-html-level-start): Use the new option.

This was requested by Alan L Tyree.
---
 lisp/org-html.el | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lisp/org-html.el b/lisp/org-html.el
index fa3811fb9..9527fcf49 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -355,6 +355,14 @@ CSS classes, then this prefix can be very useful."
   :group 'org-export-html
   :type 'string)
 
+(defcustom org-export-html-headline-anchor-format "<a name=\"%s\" id=\"%s\"></a>"
+  "Format for anchors in HTML headlines.
+It requires to %s: both will be replaced by the anchor referring
+to the headline (e.g. \"sec-2\").  When set to `nil', don't insert
+HTML anchors in headlines."
+  :group 'org-export-html
+  :type 'string)
+
 (defcustom org-export-html-preamble t
   "Non-nil means insert a preamble in HTML export.
 
@@ -2438,8 +2446,9 @@ When TITLE is nil, just close all open levels."
 	  (mapconcat (lambda (x)
 		       (setq x (org-solidify-link-text
 				(if (org-uuidgen-p x) (concat "ID-" x) x)))
-		       (format "<a name=\"%s\" id=\"%s\"></a>"
-			       x x))
+		       (if (stringp org-export-html-headline-anchor-format)
+			   (format org-export-html-headline-anchor-format x x)
+			 ""))
 		     extra-targets
 		     ""))
     (while (>= l level)


glossary
--------
Commit objects reference one tree, and zero or more parents.

Single parent commits can typically generate a patch in
unified diff format via `git format-patch'.

Multiple parents means the commit is a merge.

Root commits have no ancestor.  Note that it is
possible to have multiple root commits when merging independent histories.

Every commit references one top-level tree object.

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).