emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Exporting in html with numeric references to headlines
@ 2019-07-15 17:16 Shérab
  2019-07-15 19:18 ` Bruno Barbier
  2019-07-15 22:54 ` Nick Dokos
  0 siblings, 2 replies; 5+ messages in thread
From: Shérab @ 2019-07-15 17:16 UTC (permalink / raw)
  To: emacs-orgmode

Dear all,

Assume the following document:

===

#+title: test1

* Introduction

Monads will be explained in chapter [[#monads]]

* Monads
  :PROPERTIES:
  :CUSTOM_ID: monads
  :END:

Welcome to the monads chapter.

===

When I export this to html, the paragraph in the introduction says:

Monads will be explained in chapter 2

with "2" being a link, which is what I am expecting. However the link
does not work and it seems the "#monads" anchor is actually not created.
I can also observe that the links in the table of contents do not seem
to work either.
Am I doing something wrong? I also tried different variations with
<<chap:monads>> but was not able to make anything work.

Many thanks in advance for any hint!

Shérab.

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

* Re: Exporting in html with numeric references to headlines
  2019-07-15 17:16 Exporting in html with numeric references to headlines Shérab
@ 2019-07-15 19:18 ` Bruno Barbier
  2019-07-16  6:13   ` Shérab
  2019-07-15 22:54 ` Nick Dokos
  1 sibling, 1 reply; 5+ messages in thread
From: Bruno Barbier @ 2019-07-15 19:18 UTC (permalink / raw)
  To: Shérab, emacs-orgmode


Hi Shérab,

Shérab <Sebastien.Hinderer@ens-lyon.org> writes:

> Dear all,
>
> Assume the following document:
>
> ===
>
> #+title: test1
>
> * Introduction
>
> Monads will be explained in chapter [[#monads]]
>
> * Monads
>   :PROPERTIES:
>   :CUSTOM_ID: monads
>   :END:
>
> Welcome to the monads chapter.
>
> ===
>
> When I export this to html, the paragraph in the introduction says:
>
> Monads will be explained in chapter 2
>
> with "2" being a link, which is what I am expecting. However the link
> does not work and it seems the "#monads" anchor is actually not created.
> I can also observe that the links in the table of contents do not seem
> to work either.
> Am I doing something wrong? I also tried different variations with
> <<chap:monads>> but was not able to make anything work.
>
> Many thanks in advance for any hint!
>

FWIW, I can not reproduce (org 9.2.3).

All links are created and are working; your document looks correct to
me.

Did you try with a longer document ? (your example is so small that
there is no display difference when clicking any links).


Bruno



> Shérab.

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

* Re: Exporting in html with numeric references to headlines
  2019-07-15 17:16 Exporting in html with numeric references to headlines Shérab
  2019-07-15 19:18 ` Bruno Barbier
@ 2019-07-15 22:54 ` Nick Dokos
  1 sibling, 0 replies; 5+ messages in thread
From: Nick Dokos @ 2019-07-15 22:54 UTC (permalink / raw)
  To: emacs-orgmode

Shérab <Sebastien.Hinderer@ens-lyon.org> writes:

> Dear all,
>
> Assume the following document:
>
> ===
>
> #+title: test1
>
> * Introduction
>
> Monads will be explained in chapter [[#monads]]
>
> * Monads
>   :PROPERTIES:
>   :CUSTOM_ID: monads
>   :END:
>
> Welcome to the monads chapter.
>
> ===
>
> When I export this to html, the paragraph in the introduction says:
>
> Monads will be explained in chapter 2
>
> with "2" being a link, which is what I am expecting. However the link
> does not work and it seems the "#monads" anchor is actually not created.
> I can also observe that the links in the table of contents do not seem
> to work either.
> Am I doing something wrong? I also tried different variations with
> <<chap:monads>> but was not able to make anything work.

As Bruno Barbier points out, you are probably OK: you just have to add
more stuff in the first chapter, so that when you click the link, the change
is visible.

Another way to see it is to look at the HTML file that is
produced: if that contains what you expect, then you should be
OK. That is a technique that is often useful in debugging export
problems, e.g. I often export to PDF (via LaTeX) and I look at the
produced LaTeX file (and sometimes tinker with it and process it
until I figure out what's wrong).

In this case, the HTML looks like this:

,----
| ...
| <div id="outline-container-org3629b2d" class="outline-2">
| <h2 id="org3629b2d"><span class="section-number-2">1</span> Introduction</h2>
| <div class="outline-text-2" id="text-1">
| <p>
| Monads will be explained in chapter <a href="#monads">2</a>
| </p>
| </div>
| </div>
| <div id="outline-container-org58a95fc" class="outline-2">
| <h2 id="monads"><span class="section-number-2">2</span> Monads</h2>
| <div class="outline-text-2" id="text-monads">
| <p>
| Welcome to the monads chapter.
| </p>
| </div>
| </div>
| ...
`----
which looks correct: the #monads href links the <h2 id="monads"> tag.
To test Bruno's hypothesis, I even added a bunch of

,----
| Lorem ipsum <br/>
`----

lines between the chapters right in the HTML file to make the second
chapter move down "below the fold" and see whether clicking the link
works: it did.

HTH.
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler

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

* Re: Exporting in html with numeric references to headlines
  2019-07-15 19:18 ` Bruno Barbier
@ 2019-07-16  6:13   ` Shérab
  2019-07-16 19:27     ` Bruno Barbier
  0 siblings, 1 reply; 5+ messages in thread
From: Shérab @ 2019-07-16  6:13 UTC (permalink / raw)
  To: emacs-orgmode

Dear Bruno and Nick,

Many thanks to both of you for having taken the time to respond to my
question.

Actually, my initial problem was in a larger document. There the links
didn't work but I now think it was because I did something wrong. When
writing to the list I wrote the toy example I sent and there, things
seemingly didn't work but for the reason you both pointed out, namely
that the document was too short. I did look at the generated HTML but
not properly enough, I am really sorry about the trouble.

Everything works fine now.

Thanks again for your kind assistance,

Shérab.

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

* Re: Exporting in html with numeric references to headlines
  2019-07-16  6:13   ` Shérab
@ 2019-07-16 19:27     ` Bruno Barbier
  0 siblings, 0 replies; 5+ messages in thread
From: Bruno Barbier @ 2019-07-16 19:27 UTC (permalink / raw)
  To: Shérab, emacs-orgmode


Hi Shérab,

Shérab <Sebastien.Hinderer@ens-lyon.org> writes:

> Dear Bruno and Nick,
>
> Many thanks to both of you for having taken the time to respond to my
> question.
>
> Actually, my initial problem was in a larger document. There the links
> didn't work but I now think it was because I did something wrong. When
> writing to the list I wrote the toy example I sent and there, things
> seemingly didn't work but for the reason you both pointed out, namely
> that the document was too short. I did look at the generated HTML but
> not properly enough, I am really sorry about the trouble.
>
> Everything works fine now.
>
> Thanks again for your kind assistance,
>

No trouble. Thanks for reporting back.

Bruno

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

end of thread, other threads:[~2019-07-16 18:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 17:16 Exporting in html with numeric references to headlines Shérab
2019-07-15 19:18 ` Bruno Barbier
2019-07-16  6:13   ` Shérab
2019-07-16 19:27     ` Bruno Barbier
2019-07-15 22:54 ` Nick Dokos

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