emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Custom entry IDs in HTML export


From: Carsten Dominik
Subject: Re: [Orgmode] Custom entry IDs in HTML export
Date: Fri, 27 Mar 2009 17:16:16 +0100

Hi Daniel,

On Mar 27, 2009, at 1:47 PM, Daniel Clemente wrote:


Hi, this may have been reported before; however I didn't find it in the FAQ.

I would like to choose which ID each heading will have when they are exported to HTML. For instance, I want the table of contents to link to the anchor #tutorials instead of #sec-1.4.1. In this way, external links won't depend on the section ordering. It is also more expressive semantically.

 At the moment the best I know of is:

** TODO heading
#<<target>>

 This is exported as:
: <h3 id="sec-1.1"><a name="target" id="target"></a><span class="section-number-3">1.1</span> <span class="todo TODO"> TODO</ span> heading </h3>

 But I want:
: <h3 id="target"><span class="section-number-3">1.1</span> <span class="todo TODO"> TODO</span> heading </h3>

This would require you to assign custom targets to each and
every node.  This is why Org used generic section-number based IDs
as the basic id of the link, an provides any additional names
a anchors so that they can be targets as well. In particular, if
you give an entry an ID, this ID will also become an anchor
in the heading so that you can link to it.  I guess it does not
matter if the link points to the h3 element, or to an anchor
inside the heading right?

So you can use links with any names you like.

True, the table of contents does link to section numbers still.

I guess, with some work, we could reorganize the link storage
in a way that a user-given target of an ID become the preferred
hrefs and that section numbers will only be used when there is
not alternative.....

hmmmm.  How important is this.?

- Carsten


- Carsten





Since entries can already have IDs (I mean the property "ID", obtained by C-c l for instance), this could now be easier to implement. As an extreme solution: If org-mode used exactly that ID to link to the entry, I wouldn't mind changing the entry ID overall in my files so that they have meaningful names instead of random data. Maybe I wouldn't even mind having an HTML ID called b9c1a93e-2af4-4a41- bfe3-8d2bd62c0614… (if it starts with a letter, it's still a valid ID).


In case it's too complex to do this in org, do you know of some script to replace the IDs after export?


 Thanks,

Daniel


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode





reply via email to

[Prev in Thread] Current Thread [Next in Thread]