emacs-orgmode@gnu.org archives
 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: Mon, 20 Jun 2016 14:52:37 +0200	[thread overview]
Message-ID: <87fus82fai.fsf@saiph.selenimh> (raw)
In-Reply-To: <CAAX25XD+4kDzEEW=dMRWEzYkJwjafOUNbnups_nd2CGbUoz=3w@mail.gmail.com> (timor's message of "Mon, 20 Jun 2016 10:18:51 +0200")

Hello,

timor <timor.dd@gmail.com> writes:

> Ok, if I understand you correctly, implementing the mechanism akin to
> the latex one, setting a new variable `org-html-prefer-user-labels` would
> change the relevant exported HTML for the following piece of org:
>
> ----------------------
> #+NAME: test_fun
> #+BEGIN_SRC js :exports code
> function test_fun() {
>
> } #+END_SRC
>
> Link to [[test_fun]]
>
> #+CAPTION: Caption of Another Test Fun
> #+NAME: another_test_fun
> #+BEGIN_SRC js
> function another_test_fun() {
>
> }
> #+END_SRC
>
> Link to [[another_test_fun]] -----------------------
>
> from
>
> #+BEGIN_EXAMPLE html
>
>   <pre class="src src-js" id="orgsrcblock1">
>   ...
>   </pre>
>
>   <pre class="src src-js" id="orgsrcblock2">
>   ...
>   </pre>
>
>   Link to <a href="#orgsrcblock1">1</a>
>
>   Link to <a href="#orgsrcblock2">1</a>
>
> #+END_EXAMPLE
>
> to
>
> #+BEGIN_EXAMPLE html
>
>   <pre class="src src-js" id="test_fun">
>   ...
>   </pre>
>
>   <pre class="src src-js" id="another_test_fun">
>   ...
>   </pre>
>
>   Link to <a href="#test_fun">1</a>
>
>   Link to <a href="#another_test_fun">1</a>
>
> #+END_EXAMPLE

Correct.

> Looking at `org-html-link`, `org-export-get-reference` is only called
> to get the _internal_ reference.  That works perfectly fine already, and I am
> quite happy with the way org mode generates labels/ids for the exported
> code.  That should, however, have no influence of the link description
> (called `desc` in the code in `org-html-link`), which is the thing
> that I actually want to change?

They have no influence over the link description (which is "1" in both
cases, as you noticed). If you want to change the description, simply
provide one:

  [[test_fun][whatever]]

Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2016-06-20 12:52 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
2016-06-20  8:18       ` timor
2016-06-20 12:52         ` Nicolas Goaziou [this message]
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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87fus82fai.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 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).