emacs-orgmode
[Top][All Lists]
Advanced

[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: Mon, 20 Jun 2016 14:52:37 +0200

Hello,

timor <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]