From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Custom entry IDs in HTML export Date: Fri, 27 Mar 2009 17:16:16 +0100 Message-ID: <6BF0FCBC-4343-4B8C-9A16-F4B9AC9B0F48@gmail.com> References: <87myb7w2s9.fsf@CPU107.opentrends.net> Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LnFo8-0003Bh-PL for emacs-orgmode@gnu.org; Fri, 27 Mar 2009 13:25:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LnFo4-00037b-U7 for emacs-orgmode@gnu.org; Fri, 27 Mar 2009 13:25:28 -0400 Received: from [199.232.76.173] (port=60443 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LnFo4-00037Y-PQ for emacs-orgmode@gnu.org; Fri, 27 Mar 2009 13:25:24 -0400 Received: from mail-ew0-f160.google.com ([209.85.219.160]:62657) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LnFo4-000696-9B for emacs-orgmode@gnu.org; Fri, 27 Mar 2009 13:25:24 -0400 Received: by ewy4 with SMTP id 4so1230618ewy.42 for ; Fri, 27 Mar 2009 10:25:23 -0700 (PDT) In-Reply-To: <87myb7w2s9.fsf@CPU107.opentrends.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Daniel Clemente Cc: org-mode mailing list 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 =20= > the FAQ. > > I would like to choose which ID each heading will have when they =20 > are exported to HTML. For instance, I want the table of contents to =20= > link to the anchor #tutorials instead of #sec-1.4.1. In this way, =20 > external links won't depend on the section ordering. It is also more =20= > expressive semantically. > > At the moment the best I know of is: > > ** TODO heading > #<> > > This is exported as: > :

class=3D"section-number-3">1.1 = TODO span> heading

> > But I want: > :

1.1 class=3D"todo TODO"> TODO heading

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", =20 > obtained by C-c l for instance), this could now be easier to =20 > implement. > As an extreme solution: If org-mode used exactly that ID to link to =20= > the entry, I wouldn't mind changing the entry ID overall in my files =20= > so that they have meaningful names instead of random data. Maybe I =20 > wouldn't even mind having an HTML ID called b9c1a93e-2af4-4a41-=20 > bfe3-8d2bd62c0614=85 (if it starts with a letter, it's still a valid =20= > ID). > > > In case it's too complex to do this in org, do you know of some =20 > script to replace the IDs after export? > > > Thanks, > > Daniel > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode