emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Babel] Difficult to follow code execution in HTML exported file
@ 2010-11-26 10:59 Sébastien Vauban
  2010-11-26 20:33 ` Eric Schulte
  0 siblings, 1 reply; 4+ messages in thread
From: Sébastien Vauban @ 2010-11-26 10:59 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

#+TITLE:     Tables don't have their name exported
#+DATE:      2010-11-26
#+LANGUAGE:  en_US

* Abstract

Chunks of code are exported to HTML with their parameters, such as table
names. But *tables aren't exported with their name*.

* Playing with data and code

Here is one table:

#+tblname: numbers-1
|        1 |
|        2 |
|       45 |
|     test |
| 3.141592 |

Another one is here:

#+tblname: numbers-2
|       21 |
|       22 |
|      245 |
|    test2 |
| 23.14159 |

When applying the following chunk of code to some data (find who is
=numbers-1=!):

#+srcname: add-type
#+begin_src emacs-lisp :var data=numbers-1 :exports both
(mapcar
 (lambda (line)
   (let ((number (car line)))
     (list number (type-of number))))
 data)
#+end_src

I get the following results:

#+results: add-type
#+BEGIN_RESULT
|        1 | integer |
|        2 | integer |
|       45 | integer |
|     test | string  |
| 3.141592 | float   |
#+END_RESULT

* Explanation

In HTML, I can't entirely follow the explanation, as the code's parameter
(here: =numbers-1=) is not visible anywhere: *tables don't have their name
exported*...

I well see that the chunk of code is called on table =numbers-1=, but I don't
which one of the two tables it is.

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [Babel] Difficult to follow code execution in HTML exported file
  2010-11-26 10:59 [Babel] Difficult to follow code execution in HTML exported file Sébastien Vauban
@ 2010-11-26 20:33 ` Eric Schulte
  2010-11-26 23:04   ` Sébastien Vauban
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Schulte @ 2010-11-26 20:33 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: emacs-orgmode

Hi Seb,

The title of your email mentions code execution, but the body seems to
focus on export of table names.  I'll reply to the latter and my
apologies if I've missed something related to the former.

Table names have existed in Org-mode since before the existence of
active code blocks, and I don't think they have ever been exported, so
the export of table names would be a Org-mode wide feature request.  I
imagine that such a change would meet with some resistance, at least I
know I would not want all of my table names exported by default.  Is
there a reason you don't just add the table name manually?  e.g.

Numbers-1
#+tblname: numbers-1
|        1 |
|        2 |
|       45 |
|     test |
| 3.141592 |

Hope this helps -- Eric

Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:

> #+TITLE:     Tables don't have their name exported
> #+DATE:      2010-11-26
> #+LANGUAGE:  en_US
>
> * Abstract
>
> Chunks of code are exported to HTML with their parameters, such as table
> names. But *tables aren't exported with their name*.
>
> * Playing with data and code
>
> Here is one table:
>
> #+tblname: numbers-1
> |        1 |
> |        2 |
> |       45 |
> |     test |
> | 3.141592 |
>
> Another one is here:
>
> #+tblname: numbers-2
> |       21 |
> |       22 |
> |      245 |
> |    test2 |
> | 23.14159 |
>
> When applying the following chunk of code to some data (find who is
> =numbers-1=!):
>
> #+srcname: add-type
> #+begin_src emacs-lisp :var data=numbers-1 :exports both
> (mapcar
>  (lambda (line)
>    (let ((number (car line)))
>      (list number (type-of number))))
>  data)
> #+end_src
>
> I get the following results:
>
> #+results: add-type
> #+BEGIN_RESULT
> |        1 | integer |
> |        2 | integer |
> |       45 | integer |
> |     test | string  |
> | 3.141592 | float   |
> #+END_RESULT
>
>
> * Explanation
>
> In HTML, I can't entirely follow the explanation, as the code's parameter
> (here: =numbers-1=) is not visible anywhere: *tables don't have their name
> exported*...
>
> I well see that the chunk of code is called on table =numbers-1=, but I don't
> which one of the two tables it is.
>
> Best regards,
>   Seb

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

* Re: [Babel] Difficult to follow code execution in HTML exported file
  2010-11-26 20:33 ` Eric Schulte
@ 2010-11-26 23:04   ` Sébastien Vauban
  2010-11-26 23:23     ` Eric Schulte
  0 siblings, 1 reply; 4+ messages in thread
From: Sébastien Vauban @ 2010-11-26 23:04 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Eric,

"Eric Schulte" wrote:
> Sébastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>> #+TITLE:     Tables don't have their name exported
>>
>> Chunks of code are exported to HTML with their parameters, such as table
>> names. But *tables aren't exported with their name*.
>>
>> * Playing with data and code
>>
>> Here is one table:
>>
>> #+tblname: numbers-1
>> |        1 |
>> |        2 |
>> |       45 |
>> |     test |
>> | 3.141592 |
>>
>> Another one is here:
>>
>> #+tblname: numbers-2
>> |       21 |
>> |       22 |
>> |      245 |
>> |    test2 |
>> | 23.14159 |
>>
>> When applying the following chunk of code to some data (find who is
>> =numbers-1=!):
>>
>> #+srcname: add-type
>> #+begin_src emacs-lisp :var data=numbers-1 :exports both
>> (mapcar
>>  (lambda (line)
>>    (let ((number (car line)))
>>      (list number (type-of number))))
>>  data)
>> #+end_src
>>
>> I get the following results:
>>
>> #+results: add-type
>> #+BEGIN_RESULT
>> |        1 | integer |
>> |        2 | integer |
>> |       45 | integer |
>> |     test | string  |
>> | 3.141592 | float   |
>> #+END_RESULT
>
> The title of your email mentions code execution, but the body seems to
> focus on export of table names.  I'll reply to the latter and my
> apologies if I've missed something related to the former.

You're right that there is *not necessarily* execution per se, though the
function is well *executed* and outputs results in the example I gave.
And, imagine you read that page on Worg, you can't completely follow the
execution chain: the code refers to some data that is invisible in HTML. You
currently can't output that information...

My titles aren't orthogonal: if I'm clear, it's because table names are not
exported that it's difficult to understand how documented code has produced
the displayed results. If not yet done, put your mind in "literate
programming" documentation style, and "reproducible research". It really is
about exporting both data, code and results...


> Table names have existed in Org-mode since before the existence of
> active code blocks, and I don't think they have ever been exported, so
> the export of table names would be a Org-mode wide feature request.

OK.


> I imagine that such a change would meet with some resistance, at least I
> know I would not want all of my table names exported by default.

You name it... "by default", meaning such a behavior should be "switchable":
on or off.


> Is there a reason you don't just add the table name manually? e.g.
>
> Numbers-1
> #+tblname: numbers-1
> |        1 |
> |        2 |
> |       45 |
> |     test |
> | 3.141592 |

I'm not really enthousiast about solutions that would be manual.

On the contrary, even if table names were always exported, the name can easily
disappear from your documents with just a (very) little bit of CSS or LaTeX
code. In CSS, just apply "display: none" on the DIV, and you're done. I don't
really understand the resistance you're talking about, then.

To sum up, if the info is there, it's really easy to remove it (even
automatically!). If it's not there, it's quite a tedious task to add it
(manually)...

Do you understand the need I'm trying to express?

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: [Babel] Difficult to follow code execution in HTML exported file
  2010-11-26 23:04   ` Sébastien Vauban
@ 2010-11-26 23:23     ` Eric Schulte
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Schulte @ 2010-11-26 23:23 UTC (permalink / raw)
  To: Sébastien Vauban; +Cc: emacs-orgmode

Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:

>> I imagine that such a change would meet with some resistance, at least I
>> know I would not want all of my table names exported by default.
>
> You name it... "by default", meaning such a behavior should be "switchable":
> on or off.
>
>
>> Is there a reason you don't just add the table name manually? e.g.
>>
>> Numbers-1
>> #+tblname: numbers-1
>> |        1 |
>> |        2 |
>> |       45 |
>> |     test |
>> | 3.141592 |
>
> I'm not really enthousiast about solutions that would be manual.
>
> On the contrary, even if table names were always exported, the name can easily
> disappear from your documents with just a (very) little bit of CSS or LaTeX
> code. In CSS, just apply "display: none" on the DIV, and you're done. I don't
> really understand the resistance you're talking about, then.
>
> To sum up, if the info is there, it's really easy to remove it (even
> automatically!). If it's not there, it's quite a tedious task to add it
> (manually)...
>
> Do you understand the need I'm trying to express?
>

Yes, I understand the need you express and I agree that this would be a
useful addition to the export engine.  I'm not sure how the export or
table names (and probably other types of names including results and
maybe other Org-mode comments) would be toggled on and off however, but
perhaps someone better acquainted with the export engine than myself
would know.

Best -- Eric

>
> Best regards,
>   Seb

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

end of thread, other threads:[~2010-11-26 23:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-26 10:59 [Babel] Difficult to follow code execution in HTML exported file Sébastien Vauban
2010-11-26 20:33 ` Eric Schulte
2010-11-26 23:04   ` Sébastien Vauban
2010-11-26 23:23     ` Eric Schulte

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