emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [ox-html] Why are dedicated targets automatically renamed?


From: Sébastien Brisard
Subject: Re: [O] [ox-html] Why are dedicated targets automatically renamed?
Date: Mon, 1 Feb 2016 20:59:05 +0100

Hello,

thanks for your answer!

>
>> I have noticed that org-mode now renames dedicated targets. More
>> precisely, the following org file
>>
>> ===== beginning of a.org =====
>>   - <<item1>>Item 1
>>   - <<item2>>Item 2
>> ===== end of a.org =====
>>
>> gets exported to html as
>>
>> ===== beginning of a.html (extract) =====
>> <body>
>> <div id="content">
>> <ul class="org-ul">
>> <li><a id="orgtarget1"></a>Item 1</li>
>> <li><a id="orgtarget2"></a>Item 2</li>
>> </ul>
>> </div>
>> <div id="postamble" class="status">
>> <p class="author">Author: Sébastien Brisard</p>
>> <p class="date">Created: 2016-01-21 Thu 07:38</p>
>> <p class="creator"><a
>> href="http://www.gnu.org/software/emacs/";>Emacs</a> 24.5.1 (<a
>> href="http://orgmode.org";>Org</a> mode 8.3.3)</p>
>> <p class="validation"><a
>> href="http://validator.w3.org/check?uri=referer";>Validate</a></p>
>> </div>
>> </body>
>> ===== end of a.html =====
>>
>> Notice that the targets were renamed item1 -> orgtarget1 and item2 ->
>> orgtarget2. Why is that?
>
> It allows using any kind of character for a target without knowing
> HTML's forbidden ones.
>

Yes, that's what I found on this ML, but I am not sure I follow the logics.

>> With org-publish, it messes up links across files.
>
> What do you mean? <<...>> are internal targets, and by no mean meant to
> link across documents.
>

Oh really? It does work, though. I use this feature on my blog to link
to bibrefs that are in another page. Links like

 [[file:../pages/references.org::#TARI2008][Tariel et al., 2008]]

get exported correctly. Only, the HTML target name is orgtargetXX.
Which means that if I add a new bibliographic reference in the
references.org file, I need to reexport the whole website, rather than
the pages that have changed.

But, if I understand correctly, I should not be using this kind of links anyway?

>> Is there an option that allows to preserve the user's target name on
>> export?
>
> No, there isn't. "ox-latex" provides one, but not "ox-html". Note that
> custom ID are always preserved, tho.
>
Yeah, I have explored a solution using custom IDs. They don't work
with lists, though (I use description lists for my references). Then I
need to define every new bib entry as a header. It's doable, and if
you confirm that what I do at the moment should not be working at all,
then I will switch to this option.

Best,
Sébastien




reply via email to

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