[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] Interpreter/shell prompts when exporting code blocks?
From: |
Brett Viren |
Subject: |
[O] Interpreter/shell prompts when exporting code blocks? |
Date: |
Fri, 26 Jul 2013 10:14:42 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) |
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.
pgpeZ12LaXa9b.pgp
Description: PGP signature
- [O] Interpreter/shell prompts when exporting code blocks?,
Brett Viren <=