[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Reference cannot be resolved without publishing
From: |
Alan Schmitt |
Subject: |
Re: [O] Reference cannot be resolved without publishing |
Date: |
Mon, 14 Dec 2015 13:01:54 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) |
Hello Nicolas,
On 2015-12-12 10:01, Nicolas Goaziou <address@hidden> writes:
> Hello,
>
> Alan Schmitt <address@hidden> writes:
>
>> I have the following files I want to export to html:
>>
>> common.org:
>> #+TITLE: Unison Binaries
>> #+OPTIONS: toc:nil num:nil
>> #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style.css" />
>>
>> * sidebar
>> :PROPERTIES:
>> :CUSTOM_ID: sidebar
>> :HTML_CONTAINER_CLASS: container-sidebar
>> :END:
>>
>> - [[file:index.org::#OSX][Mac OS X]]
>>
>> index.org (extract)
>> #+INCLUDE: "common.org"
>>
>> * body
>> :PROPERTIES:
>> :CUSTOM_ID: mainbody
>> :HTML_CONTAINER_CLASS: container-mainbody
>> :END:
>>
>> ** Unison Binaries
>>
>> *** Mac OS X
>> :PROPERTIES:
>> :CUSTOM_ID: OSX
>> :END:
>>
>> When I try to export index.org to index.html, I get:
>>
>> Reference "#OSX" in file "index.org" cannot be resolved without
>> publishing
>>
>> What does it mean? And why can't the reference be resolved? Should I not
>> use CUSTOM_ID for relative links?
>
> Usually, Org cannot resolve an external link if it doesn't know about
> the external file, i.e., if it doesn't publish it.
I see.
> HTML export is a special case because resolving custom-id links is
> trivial (the back-end doesn't alter them). So I guess we can use that to
> make it work in this special case, even though it will fail in other
> back-ends.
>
> I pushed the change in master. Let me know if it works for you.
It almost works: the generated html uses two '#' instead of one:
<li><a href="index.html##OSX">Mac OS X</a></li>
Should I remove the '#' from the link?
Thanks a lot,
Alan
--
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ (Updated December 13, 2015, Mauna Loa Obs.): 401.31 ppm
signature.asc
Description: PGP signature