emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org exports broken ID links
@ 2024-08-30 10:07 Rudolf Adamkovič
  2024-08-31 15:14 ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Rudolf Adamkovič @ 2024-08-30 10:07 UTC (permalink / raw)
  To: emacs-orgmode

REPRODUCTION STEPS:

  1. `emacs -Q'
  
  2. Create a file `test.org' with the following content:
  
     * Foo :noexport:
     :PROPERTIES:
     :ID: xxx
     :END:
     
     * Bar
     [[id:xxx][Foo]]
  
  3. Export the file as HTML using (`C-c C-e h o').

EXPECTED:

  The export stops due to a broken link, as per

    `org-export-with-broken-links'.

ACTUAL:

  Org produces an HTML file with a link that points to nowhere.

NOTES:

  `ox-texinfo' exports the link as

    @uref{file://test.org,Foo}

  which is even worse.

Rudy
-- 
"I love deadlines.  I love the whooshing noise they make as they go by."
--- Douglas Adams, The Salmon of Doubt, 2002

Rudolf Adamkovič <rudolf@adamkovic.org> [he/him]
http://adamkovic.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org exports broken ID links
  2024-08-30 10:07 Org exports broken ID links Rudolf Adamkovič
@ 2024-08-31 15:14 ` Ihor Radchenko
  2024-08-31 21:01   ` Rudolf Adamkovič
  0 siblings, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2024-08-31 15:14 UTC (permalink / raw)
  To: Rudolf Adamkovič; +Cc: emacs-orgmode

Rudolf Adamkovič <rudolf@adamkovic.org> writes:

> REPRODUCTION STEPS:
> ...
>      * Foo :noexport:
>      :PROPERTIES:
>      :ID: xxx
>      :END:
>      
>      * Bar
>      [[id:xxx][Foo]]
>   
>   3. Export the file as HTML using (`C-c C-e h o').
>
> EXPECTED:
>
>   The export stops due to a broken link, as per
>
>     `org-export-with-broken-links'.
>
> ACTUAL:
>
>   Org produces an HTML file with a link that points to nowhere.

That link is not broken - it points to a file containing the linked
heading. It just happens to be the same Org file.

The same mechanism is applied when you export a file with id: link that
points to _another_ Org file - the link will be created to that Org file.

Not a bug.
Canceled.

If you want a feature controlling whether to export fuzzy/id links to
Org files, feel free to open a feature request.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org exports broken ID links
  2024-08-31 15:14 ` Ihor Radchenko
@ 2024-08-31 21:01   ` Rudolf Adamkovič
  2024-09-01 13:15     ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Rudolf Adamkovič @ 2024-08-31 21:01 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> That link is not broken - it points to a file containing the linked
> heading. It just happens to be the same Org file.

I am struggling to understand.

The link points to a heading that is not exported due to its `noexport'
tag.  How is that not a "broken link", especially from the point of view
of the user who is exporting the document, given the customization is
named `org-export-with-broken-links'?

P.S. I am not arguing against your view; rather, I am trying to
understand your explanation with perfect clarity, to learn.

Rudy
-- 
"It is far better to have a question that can't be answered than an
answer that can't be questioned."  --- Carl Sagan

Rudolf Adamkovič <rudolf@adamkovic.org> [he/him]
http://adamkovic.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org exports broken ID links
  2024-08-31 21:01   ` Rudolf Adamkovič
@ 2024-09-01 13:15     ` Ihor Radchenko
  2024-09-03 23:15       ` Rudolf Adamkovič
  0 siblings, 1 reply; 6+ messages in thread
From: Ihor Radchenko @ 2024-09-01 13:15 UTC (permalink / raw)
  To: Rudolf Adamkovič; +Cc: emacs-orgmode

Rudolf Adamkovič <rudolf@adamkovic.org> writes:

> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> That link is not broken - it points to a file containing the linked
>> heading. It just happens to be the same Org file.
>
> I am struggling to understand.
>
> The link points to a heading that is not exported due to its `noexport'
> tag.  How is that not a "broken link", especially from the point of view
> of the user who is exporting the document, given the customization is
> named `org-export-with-broken-links'?

In

> `ox-texinfo' exports the link as
> 
>     @uref{file://test.org,Foo}

the link points to the test.org file. It is not broken - the relevant
heading is present in the .org file even though it is absent in the
exported .texi file.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org exports broken ID links
  2024-09-01 13:15     ` Ihor Radchenko
@ 2024-09-03 23:15       ` Rudolf Adamkovič
  2024-09-08 17:57         ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Rudolf Adamkovič @ 2024-09-03 23:15 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> In
>
>> `ox-texinfo' exports the link as
>> 
>>     @uref{file://test.org,Foo}
>
> the link points to the test.org file. It is not broken - the relevant
> heading is present in the .org file even though it is absent in the
> exported .texi file.

Oh, I see now.  OMG, I would have never guessed that!

[It definitely is not intuitive.]

Either way, thank you for re-explaining. :)

Rudy
-- 
"Thinking is a momentary dismissal of irrelevancies."
--- Richard Buckminster Fuller, 1969

Rudolf Adamkovič <rudolf@adamkovic.org> [he/him]
http://adamkovic.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Org exports broken ID links
  2024-09-03 23:15       ` Rudolf Adamkovič
@ 2024-09-08 17:57         ` Ihor Radchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Ihor Radchenko @ 2024-09-08 17:57 UTC (permalink / raw)
  To: Rudolf Adamkovič; +Cc: emacs-orgmode

Rudolf Adamkovič <rudolf@adamkovic.org> writes:

>>> `ox-texinfo' exports the link as
>>> 
>>>     @uref{file://test.org,Foo}
>>
>> the link points to the test.org file. It is not broken - the relevant
>> heading is present in the .org file even though it is absent in the
>> exported .texi file.
>
> Oh, I see now.  OMG, I would have never guessed that!
>
> [It definitely is not intuitive.]

Depends.
Consider, for example, subtree export with subtree containing links to
the rest of the Org file. Then, it makes more sense, I think.

> Either way, thank you for re-explaining. :)

I actually spoke too soon.

     * Foo :noexport:
     :PROPERTIES:
     :ID: xxx
     :END:

     * Bar
     [[id:xxx][Foo]]

does produce invalid link in the html export.

More specifically, it first produces .org link, but then
`org-html-link-org-files-as-html' comes into play, and HTML exporter
assumes that the whole original .org file has been exported, converting
the link back into internal html link.

So...
Confirmed.

However, the fix would be more or less easy just for links to the
current .org file. It is not clear what to do with links to external org
files - we have no information whether the link target (or even the
linked org file) is exported or not.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-08 17:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-30 10:07 Org exports broken ID links Rudolf Adamkovič
2024-08-31 15:14 ` Ihor Radchenko
2024-08-31 21:01   ` Rudolf Adamkovič
2024-09-01 13:15     ` Ihor Radchenko
2024-09-03 23:15       ` Rudolf Adamkovič
2024-09-08 17:57         ` Ihor Radchenko

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).