all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: timor <timor.dd@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: HTML Export of Links to Source Blocks seems broken
Date: Fri, 17 Jun 2016 13:56:01 +0200	[thread overview]
Message-ID: <87r3bwvxke.fsf@saiph.selenimh> (raw)
In-Reply-To: <CAAX25XDAETVCrUp=PR7humTDDL2cDTbS5muWESGLb6s3h6YwKQ@mail.gmail.com> (timor's message of "Fri, 17 Jun 2016 12:46:26 +0200")

Hello,

timor <timor.dd@gmail.com> 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

  reply	other threads:[~2016-06-17 11:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16 10:18 HTML Export of Links to Source Blocks seems broken timor
2016-06-17  7:51 ` Nicolas Goaziou
2016-06-17 10:46   ` timor
2016-06-17 11:56     ` Nicolas Goaziou [this message]
2016-06-20  8:18       ` timor
2016-06-20 12:52         ` Nicolas Goaziou
2016-06-20 13:07           ` timor
2016-06-20 20:23             ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r3bwvxke.fsf@saiph.selenimh \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=timor.dd@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.