emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Renaming of +NAME for code blocks to in HTML export, no longer user defined
@ 2016-01-04 18:04 Adam Aviv
  2016-01-04 18:29 ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Aviv @ 2016-01-04 18:04 UTC (permalink / raw)
  To: Emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1427 bytes --]

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 <iostream> (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:

<pre class="src src-c++" id="helloworld.cpp">

I can then use the id tag and CSS to have it float next to the code like
this:

[image: 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:

<pre class="src src-c++" id="orgsrcblock1">

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 <div> tag around the src code that will get
exported?

Thanks!

adam



-- 
Adam J. Aviv, PhD
*Asst. Professor*
*Computer Science*
*U.S. Naval Academy*
*(410) 293- 6655*

[-- Attachment #1.2: Type: text/html, Size: 2482 bytes --]

[-- Attachment #2: Screenshot 2016-01-04 12.53.57.png --]
[-- Type: image/png, Size: 40401 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-21 14:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-04 18:04 Renaming of +NAME for code blocks to in HTML export, no longer user defined Adam Aviv
2016-01-04 18:29 ` Nick Dokos
2016-01-05 16:44   ` Adam Aviv
2016-01-21  9:20     ` Nicolas Goaziou
2016-01-21 14:21       ` Adam Aviv

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).