From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Renaming of +NAME for code blocks to in HTML export, no longer user defined Date: Mon, 04 Jan 2016 13:29:13 -0500 Message-ID: <87lh85b3ly.fsf@alphaville.usersys.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aG9sp-0006uH-FH for emacs-orgmode@gnu.org; Mon, 04 Jan 2016 13:29:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aG9sl-0003Ih-Eo for emacs-orgmode@gnu.org; Mon, 04 Jan 2016 13:29:31 -0500 Received: from plane.gmane.org ([80.91.229.3]:49844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aG9sl-0003HO-8o for emacs-orgmode@gnu.org; Mon, 04 Jan 2016 13:29:27 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aG9sj-0006Y2-GZ for emacs-orgmode@gnu.org; Mon, 04 Jan 2016 19:29:25 +0100 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 04 Jan 2016 19:29:25 +0100 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 04 Jan 2016 19:29:25 +0100 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Adam Aviv writes: > Hi all, > > I've been using org-mode for some time to manage a course website, and I developed a hack for source > blocking where if I use the +NAME tag for source doe like so: > > #+NAME: helloworld.cpp > #+BEGIN_SRC c++ -r > #include (ref:include) > > using namespace std; (ref:namespace) > > // Hello World in C++ > int main(int argc, char * argv[]){ >   cout << "Hello World" << endl; (ref:speak) > } > #+END_SRC > > Then I could retrieve the name tag in the HTML source via the id when exported, like so: > >
>
> I can then use the id tag and CSS to have it float next to the code like this:
>
> Inline image 1                           
>
> However, since I updated org-mode recently to version 8.3.2, the +NAME tagging is no longer user
> defined. Instead, it get's a generic, org defined name, such as orgsrcblock1. This means my little hack
> no longer works and I get something that looks like this in the HTML exporting:
>
> 
>
> I have two questions for the group:
>
> 1) Is there a way to overwrite the generic source block naming? Or turn off this feature somewhere? I
> can't seem to figure that out for myself. 
>
> 2) Is there another hack that someone can suggest? For example, is there a way to have a user defined
> 
tag around the src code that will get exported? > It may be a bug: the code (in org-html-src-block) looks like this (label (let ((lbl (and (org-element-property :name src-block) (org-export-get-reference src-block info)))) (if lbl (format " id=\"%s\"" lbl) "")))) and I'm wondering whether the "and" should be an "or". -- Nick