Brett Viren <b...@bnl.gov> writes: > 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.
I think the best solution here would be to apply your own custom CSS to the page, or possibly to post-process the code blocks with a custom export filter, see (info "(org)Advanced configuration"). Best, -- Eric Schulte http://cs.unm.edu/~eschulte