From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id aKRBKviJ+GKQRQEAbAwnHQ (envelope-from ) for ; Sun, 14 Aug 2022 07:36:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GOFAKviJ+GIE0AAA9RJhRA (envelope-from ) for ; Sun, 14 Aug 2022 07:36:56 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 532C3DDDC for ; Sun, 14 Aug 2022 07:36:56 +0200 (CEST) Received: from localhost ([::1]:58282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oN6Ix-0000a3-FI for larch@yhetil.org; Sun, 14 Aug 2022 01:36:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oN6Gw-0000Zb-6Z for emacs-orgmode@gnu.org; Sun, 14 Aug 2022 01:34:51 -0400 Received: from out1.migadu.com ([91.121.223.63]:14738) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oN6Gt-0003Pg-GS for emacs-orgmode@gnu.org; Sun, 14 Aug 2022 01:34:49 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1660455284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ry9AaT2MszfLQY2sDfsfFW2nCjCTCkg4dWewIW5vXzw=; b=jC35mrovF7F05uX8SWHgMx+9ZLxF3jotLU/5x63j7m+2TDkskfA8EY6AsHjTvBHPttPnrI rLBGy497nlizVRTNUZEfe0evAol37j+r1eJ8oRofvOlgCZnUEkrd8L8y5Byx1N5REaO/Wo h7pYilAOf0Z1adzWcCVRrA3R8HAAx8A= From: Joseph Turner To: emacs-orgmode@gnu.org Cc: yantar92@gmail.com, Joseph Turner Subject: [PATCH v2] org-contrib/babel/languages/ob-doc-plantuml.org: ASCII output Date: Sat, 13 Aug 2022 22:34:30 -0700 Message-Id: <20220814053430.127852-1-joseph@breatheoutbreathe.in> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=91.121.223.63; envelope-from=joseph@breatheoutbreathe.in; helo=out1.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660455416; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=ry9AaT2MszfLQY2sDfsfFW2nCjCTCkg4dWewIW5vXzw=; b=RGG9wqNTzmezsC8eZVj8lTrSzF7z/oIVHsXbgAeIfppFTIYvN4u1wNvyOl0cdQTIFPm1NA OtJSetqHrColVXzQBQTQ9SZkPRPMTTyYDNDvxouDpejD17Dd5137XcSopUuRe4tuUmnBWX Lr7JNdjAfX+Yb5/7z0j5Xg5N9gHYqi4lO9cG6zg+6LRGo2A0Luk3Whp3aJhq2NrHXLVcEi APFpDH67nJ6kO62Q+Gk+zlxiIE5KkESuLWY3Dhi8x8KpZShu05AsaMOIGQkOkMaZuUjnNg 6aAtMoKTwKxqo4aXN0yf3NI+BXc4H+Tk1S0kqJoHzNPXiDw4idxB8XkRuE7EYA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660455416; a=rsa-sha256; cv=none; b=UYCTxJjyNY4qbE6JaW4Z45qc7Q5jKC+d+eWk4XnX458wI/53S9QcOT/aZcfVaXaCjFTuRT uuMlmTCbyGYDdpPlTbofeGOAaYSTnTmsbz7gA8dAPaRdJn3zFLkg+9UJdCCOqhoN/IU7wS TYiBYeCgiXdKbjMZTVPDVJIxB669rz94BBxIVnz8wzlU93pdY7c9s75BnowgumYRDTFnsq r1yOpKVONVkXuXuWGbrF6t8cdGcazjMOgFjgfaHcsYynAsbsTiLkffHKpM/R8Z6WSM44UZ 4XVU9peme6XSRtfONJJsvLnd/Q3yFS2/iki5z1LXiGnVnn2y9JC04txr0V3/Yg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=breatheoutbreathe.in header.s=key1 header.b=jC35mrov; dmarc=pass (policy=quarantine) header.from=breatheoutbreathe.in; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.46 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=breatheoutbreathe.in header.s=key1 header.b=jC35mrov; dmarc=pass (policy=quarantine) header.from=breatheoutbreathe.in; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 532C3DDDC X-Spam-Score: -2.46 X-Migadu-Scanner: scn1.migadu.com X-TUID: Yf5PuLaWZwno Document the new functionality of ob-plantuml to insert ASCII diagrams directly in the buffer. --- .../babel/languages/ob-doc-plantuml.org | 57 +++++++++++++++---- 1 file changed, 46 insertions(+), 11 deletions(-) diff --git a/org-contrib/babel/languages/ob-doc-plantuml.org b/org-contrib/babel/languages/ob-doc-plantuml.org index ec347de4..4ae3ca31 100644 --- a/org-contrib/babel/languages/ob-doc-plantuml.org +++ b/org-contrib/babel/languages/ob-doc-plantuml.org @@ -49,18 +49,23 @@ Diagram images can be generated in PNG, SVG, and LaTeX formats. =PlantUML= is integrated with [[https://plantuml.com/running][a wide variety of software applications]]. Babel is a [[https://plantuml.com/emacs][standard way to use PlantUML in Emacs]]. * Requirements and Setup -=PlantUML= requires a working [[https://www.java.com/en/download/][Java]] installation and access to the -=plantuml.jar= component. A working [[https://graphviz.org/][GraphViz]] installation is required -for many diagrams. +=PlantUML= blocks can be executed in one of two ways, requiring either + +- a working [[https://www.java.com/en/download/][Java]] installation and access to the =plantuml.jar= component or +- the =plantuml= executable available from your distribution's package manager + +A working [[https://graphviz.org/][GraphViz]] installation is required for many diagrams. Emacs has [[https://github.com/skuro/plantuml-mode][plantuml-mode]], a major mode for editing PlantUML sources. There are detailed [[https://github.com/skuro/plantuml-mode#installation][installation instructions]], as well as instructions -for [[https://github.com/skuro/plantuml-mode#integration-with-org-mode][integration with Org]]. +for [[https://github.com/skuro/plantuml-mode#integration-with-org-mode][integration with Org]]. While [[https://melpa.org/#/plantuml-mode][plantuml-mode]] does allow use of a +remote server to render the diagram, please note that =ob-plantuml= does +not currently support this functionality. You will likely want to set the variables =plantuml-jar-path= and =org-plantuml-jar-path= with the path to your local installation of -=PlantUML=. Alternatively, set the variable -=plantuml-default-exec-mode= to access =PlantUML= non-locally. +=PlantUML=. Alternatively, set the variable =plantuml-default-exec-mode= +to =executable= to use your local =plantuml= executable. Activate evaluation of =PlantUML= source code blocks by adding =plantuml= to =org-babel-load-languages=. @@ -77,15 +82,22 @@ Activate evaluation of =PlantUML= source code blocks by adding ** Header Arguments =PlantUML= code blocks default to =:results file= and =:exports results=. -=PlantUML= has these language-specific header arguments and one requirement: - - file :: =PlantUML= code blocks require that an output file be specified +If you wish to export the =PlantUML= code block to a file, you must +specify a =:file= header argument. Alternatively, if you set =:results= +to a value other than =file=, such as =:results verbatim=, then the ASCII +=PlantUML= output will be inserted into the buffer below the code block. + +=PlantUML= has these language-specific header arguments: - cmdline :: specify [[https://plantuml.com/command-line][command line arguments]] for =PlantUML= - java :: arguments for the =java= runtimes (JRE) ** Sessions =PlantUML= does not support sessions. ** Result Types -A =PlantUML= code block returns a link to the file it generates. - +When the =:file= header argument has been specified, =PlantUML= code +blocks return a link to the generated file. Alternatively, if +=:results= is set to a value other than =file=, then the generated ASCII +diagram will be inserted into the buffer. + * Examples of Use :PROPERTIES: :header-args:plantuml: :eval no-export @@ -119,7 +131,7 @@ b -> c ,#+end_src #+end_example -HTML output of the =PlantUML= code block: +PNG output of the =PlantUML= code block: #+begin_src plantuml :file images/theme-uml.png :exports both !theme spacelab a -> b @@ -130,3 +142,26 @@ b -> c #+RESULTS: [[file:images/theme-uml.png]] +Here is an example of ASCII output inserted directly into the buffer. + +The =PlantUML= code block in the Org buffer: +#+begin_example +,#+begin_src plantuml :results verbatim +Bob -> Alice : Hello World! +,#+end_src +#+end_example + +ASCII output of the =PlantUML= code block: +#+begin_src plantuml :results verbatim +Bob -> Alice : Hello World! +#+end_src + +#+RESULTS: +: ,---. ,-----. +: |Bob| |Alice| +: `-+-' `--+--' +: | Hello World! | +: |-------------->| +: ,-+-. ,--+--. +: |Bob| |Alice| +: `---' `-----' -- 2.37.0