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 6MXTD/eO7WJpJAAAbAwnHQ (envelope-from ) for ; Fri, 05 Aug 2022 23:43:19 +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 SM7PD/eO7WIgYwAA9RJhRA (envelope-from ) for ; Fri, 05 Aug 2022 23:43:19 +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 A41E839137 for ; Fri, 5 Aug 2022 23:43:18 +0200 (CEST) Received: from localhost ([::1]:51612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oK56D-0001kx-LU for larch@yhetil.org; Fri, 05 Aug 2022 17:43:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oK55X-0001kl-0y for emacs-orgmode@gnu.org; Fri, 05 Aug 2022 17:42:35 -0400 Received: from out1.migadu.com ([2001:41d0:2:863f::]:31898) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oK55T-0002L9-Gx for emacs-orgmode@gnu.org; Fri, 05 Aug 2022 17:42:34 -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=1659735747; 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=IYHlxTuptiSX8uysmOZKcQUN2xD0Z7Vcu6tIyZ9Kiio=; b=MrOXNn6H+hBTnalZGcnZwIG/hdrWhtXevO8jmwQVa+o+NvAnEczwLV3fL5ztjq3Gi/55lH mVorS+/LAdge+JcyozqT5KhSLjLmevSdGlDqItS9FPCuuq1Sd4XCW2nDTjmyjhuTcTbxvl DgLxUeEx3IrYalIEh13zg7Pftv2UNUU= From: Joseph Turner To: emacs-orgmode@gnu.org Cc: yantar92@gmail.com, Joseph Turner Subject: [PATCH] org-contrib/babel/languages/ob-doc-plantuml.org: ASCII output Date: Fri, 5 Aug 2022 14:42:14 -0700 Message-Id: <20220805214214.25723-1-joseph@breatheoutbreathe.in> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2001:41d0:2:863f::; envelope-from=joseph@breatheoutbreathe.in; helo=out1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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=1659735799; 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=IYHlxTuptiSX8uysmOZKcQUN2xD0Z7Vcu6tIyZ9Kiio=; b=HldXLabeEP5n6kteTBd+y3ubs+ifIp6RFEI+9MUNE/DoW7IrdvYLnqf4/qMUEubGuBaIUV PHLAyxyB/c/+xb80P7rMwfAAYHTKAFjHpKzk0Pe3t8849ysUSJVTFoewqLXVV/ZO+UvR+l Xs33lXlSev+cVqc+AeMgjVe7KkMMskMezEmKB5H5/6ZDd/XvsdF7uqE/hR/wK34uLY81K0 6LieAig2jVeNwcWXW9S8uJPE3Gqe6T6Qv33uQthyLjpL11PLOtVBgVMS4VyyCSj6Zp9Hjl 8EugnoDfAy/WeL2l6Jw0IjPS3cniehJNQG+vFldaZtkyLLJ+kztAHO1gXvzrxw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659735799; a=rsa-sha256; cv=none; b=QqjR45anFcMUq2ro5vpRhbxGPH6Uavg+QkNkniXVgOEDRQr4dnWrKhmVzJngQMURgFIQ8b aV+iKSmU/05LJX3WRmH53/1FQkKjZYg2gdOBtFu1EXPt6zteP69PIlWAl/b+zwL8aiYwRq 1ApJdqo5ysboHyyJ0XPtYruerE2aAKxcD5C5mTDtz4pl9+OCEii+lBwgtCYyOtpGchrbuP URDRR5cJ7fBgQzfoQDAkiZnMVyY5KUTfWA3twMhSiU5jm1UrffA38vNQjduG++Av6R4O76 pFAx1fUjLJs+7aUMERD7Y4Z1iHoOVpDjAsPxaYnto0MuL5AQKRJsA2E7Q5ZwOg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=breatheoutbreathe.in header.s=key1 header.b=MrOXNn6H; 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: -5.70 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=breatheoutbreathe.in header.s=key1 header.b=MrOXNn6H; 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: A41E839137 X-Spam-Score: -5.70 X-Migadu-Scanner: scn0.migadu.com X-TUID: boMdnowYADzv Document the new functionality of ob-plantuml to insert ASCII diagrams directly in the buffer. --- This patch documents the changes made here: https://lists.gnu.org/archive/html/emacs-orgmode/2022-08/msg00110.html .../babel/languages/ob-doc-plantuml.org | 55 +++++++++++++++---- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/org-contrib/babel/languages/ob-doc-plantuml.org b/org-contrib/babel/languages/ob-doc-plantuml.org index ec347de4..2bd46861 100644 --- a/org-contrib/babel/languages/ob-doc-plantuml.org +++ b/org-contrib/babel/languages/ob-doc-plantuml.org @@ -49,9 +49,13 @@ 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 three 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 or +- a connection to a remote [[https://github.com/plantuml/plantuml-server][PlantUML server]] + +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 @@ -59,8 +63,9 @@ for [[https://github.com/skuro/plantuml-mode#integration-with-org-mode][integrat 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 or to =server= to +access =PlantUML= non-locally. 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