Hi organistas.

I'd like to have my executable code blocks get exported to HTML/LaTeX
with some prompt prefixed to each line of code but still let the blocks
themselves remain executable in their given language.  Is there already
a nice way to do this?

For example, if there was something like a "prompt" header to specify
what should get prefixed on export then something like...

#+prompt: $ 
#+BEGIN_SRC sh :results none :exports code
mkdir mymod
touch mymod/__init__.py
#+END_SRC

#+prompt: >>> :indent ...
#+BEGIN_SRC python :results none :exports code
import mymod
def myfun():
    mymod.something()
#+END_SRC

...would export something resembling:

$ mkdir mymod
$ touch mymod/__init__.py

>>> import mymod
>>> def myfun():
...     mymod.something()


For HTML export, some stylesheet magic which allows any cut-and-paste to
ignore the prefixed prompt would be icing on an already tasty cake.

-Brett.

Attachment: pgpi4jxziOuQp.pgp
Description: PGP signature

Reply via email to