[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] HTML Export of Links to Source Blocks seems broken
From: |
Nicolas Goaziou |
Subject: |
Re: [O] HTML Export of Links to Source Blocks seems broken |
Date: |
Fri, 17 Jun 2016 13:56:01 +0200 |
Hello,
timor <address@hidden> writes:
> Why is the link text set to "1" in both cases?
This is just a nonsensical number because Org does not know what to
number. If you want to number source blocks, you need to add a caption
to them.
> Thanks for the pointer. I tried to see the effect of that variable,
> but I noticed that for latex export, a \ref{orgsrcblock1} tag is
> created, although the listing in the exported latex code does not
> provide a "target" to link to at all.
If `org-latex-prefer-user-labels' is non-nil, no \ref{orgsrcblock1} is
created.
> I was more thinking along the lines of treating internal links to
> named blocks in the same way that external links in HTML export are
> treated:
> For [[http://some/url]], the link text is simply set to the target,
> the target being the external web page.
> For [[some_named_block]] the link text should then also be the name of
> the target, in that case the target being the source block.
I think the way to go is to create an equivalent to
`org-latex-prefer-user-labels' and to turn it off by default.
It boils down to creating a wrapper around `org-export-get-reference',
e.g. `org-html--reference' and replace it in the file.
It should also be tested when cross-referencing data in a published
project.
Regards,
--
Nicolas Goaziou