From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: HTML Export of Links to Source Blocks seems broken Date: Fri, 17 Jun 2016 13:56:01 +0200 Message-ID: <87r3bwvxke.fsf@saiph.selenimh> References: <874m8sxngx.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDsNj-0000Qp-FX for emacs-orgmode@gnu.org; Fri, 17 Jun 2016 07:56:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDsNd-0005WK-HW for emacs-orgmode@gnu.org; Fri, 17 Jun 2016 07:56:14 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:35714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDsNd-0005W6-BP for emacs-orgmode@gnu.org; Fri, 17 Jun 2016 07:56:09 -0400 In-Reply-To: (timor's message of "Fri, 17 Jun 2016 12:46:26 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: timor Cc: emacs-orgmode@gnu.org Hello, timor 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