From mboxrd@z Thu Jan 1 00:00:00 1970 From: Diego Zamboni Subject: Re: Quoting a REPL session in an org document Date: Fri, 20 Apr 2018 12:48:54 +0200 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_C9BF1FC8-448A-48D3-9893-22C8D9B0EE7B" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9Tc0-0004TG-TV for emacs-orgmode@gnu.org; Fri, 20 Apr 2018 06:49:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9Tbw-0007cq-Uo for emacs-orgmode@gnu.org; Fri, 20 Apr 2018 06:49:52 -0400 Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]:36789) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9Tbw-0007cd-GH for emacs-orgmode@gnu.org; Fri, 20 Apr 2018 06:49:48 -0400 Received: by mail-wr0-x229.google.com with SMTP id m26-v6so3927882wrb.3 for ; Fri, 20 Apr 2018 03:49:48 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Dov Grobgeld Cc: Diego Zamboni , emacs-orgmode --Apple-Mail=_C9BF1FC8-448A-48D3-9893-22C8D9B0EE7B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Dov, I think the easiest way is to use a SRC block with a mode that = understands the iPython-REPL format - this would give you not only = syntax highlighting, but also the possibility of executing code from = Org-mode using org-babel. A quick search reveals two likely candidates: https://github.com/millejoh/emacs-ipython-notebook = Org-mode integration: = http://millejoh.github.io/emacs-ipython-notebook/#org-mode-integration = https://github.com/gregsexton/ob-ipython/ = Best, =E2=80=94Diego > On 20 Apr 2018, at 11:27, Dov Grobgeld wrote: >=20 > Hello, >=20 > I wonder if there is a "standard" way of quoting a REPL session in an = org document. Right now I'm using #example, but I wonder if there is = something richer. The ideal would be to get something that is syntax = aware so that anything after the "prompt" is syntax highlighted. >=20 > Here is an example of a session that I would like to include literally = in my document: >=20 > $ ipython > Python 2.7.14 (default, Mar 14 2018, 13:36:31) > Type "copyright", "credits" or "license" for more information. > IPython 5.3.0 -- An enhanced Interactive Python. > ? -> Introduction and overview of IPython's features. > %quickref -> Quick reference. > help -> Python's own help system. > object? -> Details about 'object', use 'object??' for extra details. > In [1]: import pandas as pd > In [2]: df =3D pd.read_csv('/tmp/foo.csv') > In [3]: df > Out[3]: > Animal Weight Color > 0 Bear 200 Brown > 1 Cat 5 Orange > 2 Dog 10 Black&White > In [4]: >=20 > I would e.g. like this to look as follows in the exported document = (but with colored selectable text, not through an image!): >=20 > > =E2=80=8B > Thanks in advance! > Dov --Apple-Mail=_C9BF1FC8-448A-48D3-9893-22C8D9B0EE7B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Hi Dov,

I think the = easiest way is to use a SRC block with a mode that understands the = iPython-REPL format - this would give you not only syntax highlighting, = but also the possibility of executing code from Org-mode using = org-babel. A quick search reveals two likely candidates:

= Org-mode integration: http://millejoh.github.io/emacs-ipython-notebook/#org-mode-inte= gration

Best,
=E2=80=94Diego


On 20 Apr 2018, at 11:27, Dov Grobgeld <dov.grobgeld@gmail.com> wrote:

Hello,

I wonder if there is a = "standard" way of quoting a REPL session in an org document. Right now = I'm using #example, but I wonder if there is something richer. The ideal = would be to get something that is syntax aware so that anything after = the "prompt" is syntax highlighted.

Here is an example of a = session that I would like to include literally in my document:

$ ipython
Python 2.7.14 = (default, Mar 14 2018, 13:36:31)
Type "copyright", = "credits" or "license" for more information.
IPython 5.3.0 = -- An enhanced Interactive Python.
?         -> = Introduction and overview of IPython's features.
%quickref = -> Quick reference.
help      = -> Python's own help system.
object?   -> = Details about 'object', use 'object??' for extra details.
In= [1]: import pandas as pd
In [2]: df =3D = pd.read_csv('/tmp/foo.csv')
In [3]: df
Out[3]:
  Animal  = Weight        Color
0   Bear     = 200        Brown
1    Cat       = 5       Orange
2    Dog      = 10  Black&White
In [4]:

I would e.g. like this = to look as follows in the exported document (but with colored selectable = text, not through an image!):

<foo.png>
=E2=80=8B
Thanks in advance!
Dov

= --Apple-Mail=_C9BF1FC8-448A-48D3-9893-22C8D9B0EE7B--