emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: ~jackkamm <jackkamm@git.sr.ht>
To: emacs-orgmode@gnu.org
Cc: yantar92@posteo.net
Subject: [PATCH worg] ob-doc-python: Use ":results file link" for returning filenames
Date: Thu, 13 Jul 2023 20:08:22 -0700	[thread overview]
Message-ID: <168930549025.22836.5898372423288499122-0@git.sr.ht> (raw)

From: Jack Kamm <jackkamm@gmail.com>

The correct usage for returng filenames as paths is to use the link
header arg.  This updates the ob-doc-python examples to follow this
convention now.  See also:
https://list.orgmode.org/87ttu95xst.fsf@localhost/
---
 org-contrib/babel/languages/ob-doc-python.org | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/org-contrib/babel/languages/ob-doc-python.org b/org-contrib/babel/languages/ob-doc-python.org
index 7ee29be5..1012ba56 100644
--- a/org-contrib/babel/languages/ob-doc-python.org
+++ b/org-contrib/babel/languages/ob-doc-python.org
@@ -190,12 +190,12 @@ ret
 ** Graphics
 
 To return plots, save the figure to a file, return the filename, and
-set the header argument =:results file=.
+set the header argument =:results file link=.
 
 For example:
 
 #+begin_example
-#+begin_src python :session :results file
+#+begin_src python :session :results file link
 import matplotlib
 import matplotlib.pyplot as plt
 fig=plt.figure(figsize=(3,2))
@@ -244,7 +244,7 @@ syntax, but to hide the inserted code during export.
 ,#+end_src
 
 ,#+header: :noweb strip-export
-,#+begin_src python :results value file :session :exports both
+,#+begin_src python :results value file link :session :exports both
   import matplotlib, numpy
   import matplotlib.pyplot as plt
   fig=plt.figure(figsize=(4,2))
@@ -327,7 +327,7 @@ return(data[val])
 
   - Plotting
 #+begin_example
-#+begin_src python :results file
+#+begin_src python :results file link
 import matplotlib, numpy
 matplotlib.use('Agg')
 import matplotlib.pyplot as plt
-- 
2.38.5


             reply	other threads:[~2023-07-17 12:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-14  3:08 ~jackkamm [this message]
2023-07-14  8:57 ` [PATCH worg] ob-doc-python: Use ":results file link" for returning filenames Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=168930549025.22836.5898372423288499122-0@git.sr.ht \
    --to=jackkamm@git.sr.ht \
    --cc=emacs-orgmode@gnu.org \
    --cc=jackkamm@gmail.com \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).