Re: [O] Renaming of +NAME for code blocks to in HTML export, no longer user defined

2016-01-21 Thread Nicolas Goaziou
Hello,

Adam Aviv  writes:

> Interesting. I don't know if it is a bug, though, as this seems intentional
> and matches my experience. The idea being that if you want to label
> something, you use the :name tag, but this will make it so the second item
> is evaluated, producing a unique identifier. The unique identifier is then
> assigned instead of the :name tag. If it was an, OR, however, then every
> element block would get a label, and that might be suboptimal given that
> not every block is referenced later.

That's correct.

> I would still like to be able to add my own name tags, but understand why
> this might have been changed to avoid to blocks having the same label.

That and the fact that one might introduce forbidden characters in the
name (e.g., ask the user to know about forbidden characters in the
target format). The generic names are pretty safe.

Anyway, what about using special blocks to generate custom ?

  #+attr_html: :property whatever
  #+begin_something
  ...
  #+end_something


Regards,

-- 
Nicolas Goaziou



Re: [O] Renaming of +NAME for code blocks to in HTML export, no longer user defined

2016-01-21 Thread Adam Aviv
On Thu, Jan 21, 2016 at 4:20 AM, Nicolas Goaziou 
wrote:

> That and the fact that one might introduce forbidden characters in the
> name (e.g., ask the user to know about forbidden characters in the
> target format). The generic names are pretty safe.
>
> Anyway, what about using special blocks to generate custom ?
>
>   #+attr_html: :property whatever
>   #+begin_something
>   ...
>   #+end_something
>
>
Thanks for the feedback. All of that makes sense. Is there really a
+begin_somthing tag? Or are you referring to any general tag? Sorry for my
obtuseness.

I'll look into the :property issue: I think that'd properly work for my
needs.


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


Re: [O] Renaming of +NAME for code blocks to in HTML export, no longer user defined

2016-01-05 Thread Adam Aviv
On Mon, Jan 4, 2016 at 1:29 PM, Nick Dokos  wrote:

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

Interesting. I don't know if it is a bug, though, as this seems intentional
and matches my experience. The idea being that if you want to label
something, you use the :name tag, but this will make it so the second item
is evaluated, producing a unique identifier. The unique identifier is then
assigned instead of the :name tag. If it was an, OR, however, then every
element block would get a label, and that might be suboptimal given that
not every block is referenced later.

I would still like to be able to add my own name tags, but understand why
this might have been changed to avoid to blocks having the same label.


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


Re: [O] Renaming of +NAME for code blocks to in HTML export, no longer user defined

2016-01-04 Thread Nick Dokos
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