emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt <matt@excalamus.com>
To: "Thomas S. Dye" <tsd@tsdye.online>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>, Timothy <tecosaur@gmail.com>
Subject: Re: [PATCH] ob-shell-test, test-ob-shell and introduction
Date: Sat, 18 Dec 2021 02:03:13 -0500	[thread overview]
Message-ID: <17dcc5a0e3e.d8ca0ef6361712.4976360594738663013@excalamus.com> (raw)
In-Reply-To: <87bl1u49ru.fsf@tsdye.online>

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

 > Contributions to Worg aren't similarly restricted.  Feel free to 
 > push material there in the meantime.

Looks like the email finally got sent to the right person at my company. Who knows how long it will take for them to get the FSF disclaimer back to me...

Now that I'm on holiday, I've got a little more time to contribute to Worg. Here's a few patches showing what I've come up with. I'll finish it up in the next few days, hopefully.  Not sure if the patches are formed correctly,  sorry about that if not. It's late here and I wanted to show progress. I'll worry about those kinds of details later. :)

[-- Attachment #2: 0001-Draft-introduction-and-setup.patch --]
[-- Type: application/octet-stream, Size: 6862 bytes --]

From 0d12f927d049749f960a5b4385c1f8029e859a3b Mon Sep 17 00:00:00 2001
From: Matt <matt@excalamus.com>
Date: Sat, 18 Dec 2021 01:46:29 -0500
Subject: [PATCH] Draft introduction and setup

---
 org-contrib/babel/languages/ob-doc-shell.org | 141 ++++++++++++++++---
 1 file changed, 120 insertions(+), 21 deletions(-)

diff --git a/org-contrib/babel/languages/ob-doc-shell.org b/org-contrib/babel/languages/ob-doc-shell.org
index 46ce0a6f..825e17d2 100644
--- a/org-contrib/babel/languages/ob-doc-shell.org
+++ b/org-contrib/babel/languages/ob-doc-shell.org
@@ -2,7 +2,7 @@
 #+STARTUP:    align fold nodlcheck hidestars oddeven lognotestate hideblocks
 #+SEQ_TODO:   TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@)
 #+TAGS:       Write(w) Update(u) Fix(f) Check(c) noexport(n)
-#+TITLE:      Shell Source Code Blocks in Org Mode
+#+TITLE:      Shell Code Blocks in Babel
 #+AUTHOR:     Matt Trzcinski
 #+EMAIL:      matt[at]excalamus[dot]com
 #+LANGUAGE:   en
@@ -10,6 +10,9 @@
 #+HTML_LINK_HOME:  https://orgmode.org/worg/
 #+EXCLUDE_TAGS: noexport
 
+# TODO remove this
+#+options: toc:nil
+
 #+name: banner
 #+begin_export html
 <div id="subtitle" style="float: center; text-align: center;">
@@ -26,21 +29,21 @@
     <a href="https://packages.qa.debian.org/p/posh.html">posh</a>.
   </p>
   <p>
-    <a href="https://www.gnu.org/software/bash/">
-      <img src="https://tiswww.case.edu/php/chet/img/bash-logo-web.png"/>
-    </a>
-    <a href="https://www.zsh.org/">zsh</a>,
-      <img src="https://zsh.sourceforge.io/Images/wizard.gif"/>
-    </a>
-    <a href="https://fishshell.com/">fish</a>,
-      <img src="https://fishshell.com/assets/img/Terminal_Logo2_CRT_Flat.png"/>
-    </a>
-    <a href="http://www.kornshell.org/">ksh</a>,
-      <img src="http://www.kornshell.org/kornshell.gif"/>
-    </a>
-    <a href="https://www.mirbsd.org/mksh.htm">mksh</a>, and
-      <img src="https://www.mirbsd.org/pics/logo-grey.png"/>
-    </a>
+    <a href="https://www.gnu.org/software/bash/"><img width="180px"
+    src="https://tiswww.case.edu/php/chet/img/bash-logo-web.png"/></a>
+    
+    <a href="https://www.zsh.org/"><img width="150px"
+    src="https://zsh.sourceforge.io/Images/wizard.gif"/></a>
+
+    <a href="https://www.mirbsd.org/mksh.htm"><img width="150px"
+    src="https://www.mirbsd.org/pics/logo-grey.png"/></a>
+    
+    <a href="https://fishshell.com/"><img width="150px"
+    src="https://fishshell.com/assets/img/Terminal_Logo2_CRT_Flat.png"/></a>
+    
+    <a href="http://www.kornshell.org/"><img width="180px"
+    src="http://www.kornshell.org/kornshell.gif"/></a>
+
   </p>
 </div>
 #+end_export
@@ -63,12 +66,84 @@
   - [ ] Describe [[Other]] differences from supported languages
   - [ ] Provide brief [[Examples of Use][Examples of Use]]
 * Introduction
-  - Brief description of language.
-  - Range of typical uses within Org Mode.
+# - Brief description of language.
+A shell is a user interface for interacting with system services.
+File management, process execution, and operating system monitoring
+can all be done with a shell. Many shells are plain text only whereas
+some support graphics or are themselves fully graphical. Similarities
+exist between shells and, though standards exist (such as
+POSIX[fn:1]), there is no guarantee that what works in one shell will
+work in another. Each shell is a separate application.
+
+Shells often provide a programming language as well as access to
+system utilities, such as the GNU Core Utilities[fn:2]. Users can
+stitch utilities together or create their own.
+
+# - Range of typical uses within Org Mode.
+Org Babel lets users run commands[fn:3] in separate shells...
+
+: #+begin_src sh :results output
+:   echo PID: $$
+: #+end_src
+: 
+: #+RESULTS:
+: : PID: 9952
+: 
+: #+begin_src sh :results output 
+:   echo PID: $$
+: #+end_src
+: 
+: #+RESULTS:
+: : PID: 9990
+: 
+...or as part of a shared session.
+
+: #+begin_src sh :results output :session shared
+:   echo PID: $$
+:   export X=1
+: #+end_src
+: 
+: #+RESULTS:
+: : PID: 9742
+: 
+: #+begin_src sh :results output :session shared
+:   echo PID: $$
+:   echo X was set to $X
+: #+end_src
+: 
+: #+RESULTS:
+: : PID: 9742
+: : X was set to 1
+
+Shell blocks can run as standalone scripts or chained processes, be
+tangled, use args, work with stdin, have shebangs, and more.
+    
 * Requirements and Setup
-  - Installation and configuration of language software
-  - Emacs configuration
-  - Org-mode configuration (org-babel-do-load-languages)
+# - Installation and configuration of language software
+Org Babel can run many different shells, including [[https://www.gnu.org/software/bash/][sh]], [[https://www.gnu.org/software/bash/][bash]], [[https://www.zsh.org/][zsh]],
+[[https://fishshell.com/][fish]], [[https://www.grymoire.com/unix/csh.html][csh]], [[https://www.in-ulm.de/~mascheck/various/ash/][ash]], [[http://gondor.apana.org.au/~herbert/dash/][dash]], [[http://www.kornshell.org/][ksh]], [[https://www.mirbsd.org/mksh.htm][mksh]], and [[https://packages.qa.debian.org/p/posh.html][posh]].  The primary requirement is
+that the shell be installed on the system.
+
+# - Emacs configuration
+# - Org-mode configuration (org-babel-do-load-languages)
+Once the shell is installed on the system, the Org Babel shell
+language facility must be set to load[fn:4]:
+
+#+begin_example emacs-lisp
+;; active Babel languages
+(org-babel-do-load-languages
+ 'org-babel-load-languages
+ '((shell . t)))
+#+end_example
+
+*NOTE:* This is all that's needed, regardless of the shell you intend
+to use! The "shell" <lang> loads functionality for /all/ supported
+shells.  The car of =(shell . t)=, namely "shell", is the name of the
+Org Babel module that handles it, =ob-shell.el=.
+
+*NOTE:* The =ob-shell.el= module used to be named =ob-sh.el=. This was
+changed in Org 8.2[fn:5].
+
 * Babel Features for Language Source Code Blocks
 ** Header Arguments
    - Language-specific default values
@@ -84,3 +159,27 @@
   - Hello World!
   - Common uses
   - Links to tutorials and other resources
+
+* Footnotes
+
+[fn:1] https://opensource.com/article/19/7/what-posix-richard-stallman-explains
+
+[fn:2] https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_commands
+
+[fn:3] https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#index-_0024_0024
+
+[fn:4] https://orgmode.org/worg/org-contrib/babel/languages/index.html#configure
+
+[fn:5] https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/etc/ORG-NEWS#n3995 
+
+#+begin_example
+,* Version 8.2
+
+,** Incompatible changes
+,*** =ob-sh.el= renamed to =ob-shell=
+This may require two changes in user config.
+
+1. In =org-babel-do-load-languages=, change =(sh . t)= to =(shell . t)=.
+2. Edit =local.mk= files to change the value of =BTEST_OB_LANGUAGES=
+   to remove "sh" and include "shell".
+#+end_example
-- 
2.34.0


[-- Attachment #3: 0001-org-contrib-babel-languages-ob-doc-shell.org-Create-.patch --]
[-- Type: application/octet-stream, Size: 4295 bytes --]

From 682eb6bd14d7d7246e3f13517adcd9ffb1a38ae0 Mon Sep 17 00:00:00 2001
From: Matt <matt@excalamus.com>
Date: Mon, 22 Nov 2021 22:57:38 -0500
Subject: [PATCH] org-contrib/babel/languages/ob-doc-shell.org: Create file

* ob-doc-shell.org Create file.  Fill out links and images.
---
 org-contrib/babel/languages/ob-doc-shell.org | 86 ++++++++++++++++++++
 1 file changed, 86 insertions(+)
 create mode 100644 org-contrib/babel/languages/ob-doc-shell.org

diff --git a/org-contrib/babel/languages/ob-doc-shell.org b/org-contrib/babel/languages/ob-doc-shell.org
new file mode 100644
index 00000000..46ce0a6f
--- /dev/null
+++ b/org-contrib/babel/languages/ob-doc-shell.org
@@ -0,0 +1,86 @@
+#+OPTIONS:    H:3 num:nil toc:2 \n:nil ::t |:t ^:{} -:t f:t *:t tex:t d:(HIDE) tags:not-in-toc broken-links:nil
+#+STARTUP:    align fold nodlcheck hidestars oddeven lognotestate hideblocks
+#+SEQ_TODO:   TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@)
+#+TAGS:       Write(w) Update(u) Fix(f) Check(c) noexport(n)
+#+TITLE:      Shell Source Code Blocks in Org Mode
+#+AUTHOR:     Matt Trzcinski
+#+EMAIL:      matt[at]excalamus[dot]com
+#+LANGUAGE:   en
+#+HTML_LINK_UP:    index.html
+#+HTML_LINK_HOME:  https://orgmode.org/worg/
+#+EXCLUDE_TAGS: noexport
+
+#+name: banner
+#+begin_export html
+<div id="subtitle" style="float: center; text-align: center;">
+  <p>
+    Babel shell support, including: <a href="https://www.gnu.org/software/bash/">sh</a>,
+    <a href="https://www.gnu.org/software/bash/">bash</a>,
+    <a href="https://www.zsh.org/">zsh</a>,
+    <a href="https://fishshell.com/">fish</a>,
+    <a href="https://www.grymoire.com/unix/csh.html">csh</a>,
+    <a href="https://www.in-ulm.de/~mascheck/various/ash/">ash</a>,
+    <a href="http://gondor.apana.org.au/~herbert/dash/">dash</a>,
+    <a href="http://www.kornshell.org/">ksh</a>,
+    <a href="https://www.mirbsd.org/mksh.htm">mksh</a>, and
+    <a href="https://packages.qa.debian.org/p/posh.html">posh</a>.
+  </p>
+  <p>
+    <a href="https://www.gnu.org/software/bash/">
+      <img src="https://tiswww.case.edu/php/chet/img/bash-logo-web.png"/>
+    </a>
+    <a href="https://www.zsh.org/">zsh</a>,
+      <img src="https://zsh.sourceforge.io/Images/wizard.gif"/>
+    </a>
+    <a href="https://fishshell.com/">fish</a>,
+      <img src="https://fishshell.com/assets/img/Terminal_Logo2_CRT_Flat.png"/>
+    </a>
+    <a href="http://www.kornshell.org/">ksh</a>,
+      <img src="http://www.kornshell.org/kornshell.gif"/>
+    </a>
+    <a href="https://www.mirbsd.org/mksh.htm">mksh</a>, and
+      <img src="https://www.mirbsd.org/pics/logo-grey.png"/>
+    </a>
+  </p>
+</div>
+#+end_export
+
+* Template Checklist [4/12]                                        :noexport:
+  - [X] Revise #+TITLE:
+  - [X] Indicate #+AUTHOR:
+  - [X] Add #+EMAIL:
+  - [X] Revise banner source block [3/3]
+    - [X] Add link to a useful language web site
+    - [X] Replace "Language" with language name
+    - [X] Find a suitable graphic and use it to link to the language
+      web site
+  - [ ] Write an [[Introduction]]
+  - [ ] Describe [[Requirements and Setup][Requirements and Setup]]
+  - [ ] Replace "Language" with language name in [[Org Mode Features for Language Source Code Blocks][Babel Features for Language Source Code Blocks]]
+  - [ ] Describe [[Header Arguments][Header Arguments]]
+  - [ ] Describe support for [[Sessions]]
+  - [ ] Describe [[Result Types][Result Types]]
+  - [ ] Describe [[Other]] differences from supported languages
+  - [ ] Provide brief [[Examples of Use][Examples of Use]]
+* Introduction
+  - Brief description of language.
+  - Range of typical uses within Org Mode.
+* Requirements and Setup
+  - Installation and configuration of language software
+  - Emacs configuration
+  - Org-mode configuration (org-babel-do-load-languages)
+* Babel Features for Language Source Code Blocks
+** Header Arguments
+   - Language-specific default values
+   - Language-specific header arguments
+** Sessions
+   - Support or not
+   - Typical use for sessions
+** Result Types
+   - Which result types are supported?
+** Other
+   - Differences from other supported languages
+* Examples of Use
+  - Hello World!
+  - Common uses
+  - Links to tutorials and other resources
-- 
2.34.0


  reply	other threads:[~2021-12-18  7:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 18:37 Matt
2021-11-22 18:43 ` Timothy
2021-11-24 18:48   ` Matt
2021-12-02  9:39     ` Timothy
2021-12-06  3:50       ` Matt
2021-12-06  4:50         ` Thomas S. Dye
2021-12-18  7:03           ` Matt [this message]
2021-12-18 20:51             ` Thomas S. Dye
2021-12-31 17:04             ` Thomas S. Dye
2021-12-31 19:18               ` Matt
2021-12-31 22:11                 ` Thomas S. Dye
2022-01-02  4:32                   ` Matt
2022-01-02 18:57                     ` Thomas S. Dye
2022-01-05 17:12                 ` Max Nikulin
2022-01-06  3:47                   ` Matt
2022-01-07 16:18                     ` Max Nikulin
2021-11-22 19:08 ` Thomas S. Dye
2021-11-23  4:42   ` [PATCH] ob-doc-shell.org (was [PATCH] ob-shell-test, test-ob-shell and introduction) Matt
2021-11-23  4:59     ` Thomas S. Dye

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=17dcc5a0e3e.d8ca0ef6361712.4976360594738663013@excalamus.com \
    --to=matt@excalamus.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tecosaur@gmail.com \
    --cc=tsd@tsdye.online \
    /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).