emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Interpreter/shell prompts when exporting code blocks?
@ 2013-07-26 14:14 Brett Viren
  2013-07-26 15:24 ` Eric Schulte
  2013-07-26 15:33 ` Rick Frankel
  0 siblings, 2 replies; 3+ messages in thread
From: Brett Viren @ 2013-07-26 14:14 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 947 bytes --]

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 #2: Type: application/pgp-signature, Size: 197 bytes --]

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

end of thread, other threads:[~2013-07-26 15:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-26 14:14 Interpreter/shell prompts when exporting code blocks? Brett Viren
2013-07-26 15:24 ` Eric Schulte
2013-07-26 15:33 ` Rick Frankel

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