4 The Universal Language)}}}
6 This document describes a
*U-Language* as described by the late great
10 Every investigation, including the present one, has to be communicated
11 from one person to another by means of language. It is expedient to
12 begin our study by calling attention to this obvious fact, by giving a
13 name to the language being used, and by being explicit about a few of
14 its features. We shall call the language being used the
15 U-Language. [...] There would be no point in calling attention to it,
16 if it were not for the fact that language is more intimately related
17 to our job than of most others.
24 As the title suggest we refer to our
*U-Language* as
25 ulang. When I say something along the lines of "Please refer to
26 [[*Hyperlinks][ulang.Hyperlinks]]", I am referencing the section named
/Links/ of this
29 Each section of this document describes an element of the ulang. It is
30 recommended to skim through the top-level sections (
[[Org-mode][Org-mode]] and
31 [[Elements][Elements]]) and review the element sub-headings as needed.
37 :CUSTOM_ID: 98a02bb2-3f39-49c6-898a-68ccd8f3cbe1 39 [[https://www.gnu.org/software/emacs/][GNU Emacs]] is our text editor, so naturally
[[https://orgmode.org/][Org Mode]] is our
42 If you are already familiar with Emacs and org-mode, I recommend
43 opening the source file of this document in Emacs and following along.
45 If not, I recommend browsing through the
[[https://orgmode.org/worg/][Worg resources]], but we won't
46 be getting too deep into tribal hacker knowledge of Emacs. The choice
47 of Org is arbitrary and the concepts here would apply to other formats
48 (LaTeX, Markdown, etc).
52 :CUSTOM_ID: 22474039-5c18-4179-82aa-a6731e6313a2 54 - State "TODO" from [2023-11-05 Sun 19:21]
56 =Org-mode= the application depends on Emacs (it's written in Emacs
57 Lisp) but that doesn't mean we need to. To solve the issue of
58 interoperability between different systems, we are developing a tool
59 called
[[https://lab.rwest.io/comp/core/-/tree/branch/default/lisp/lib/organ][organ]]. The purpose of
=organ= is to provide an external API for
60 Org documents that doesn't depend on GNU Emacs.
62 If we were designing a
/personal/ note-taking system, I would argue
63 that we don't need this tool. The problem is it's
/not/ personal - we
64 have a much wider intended audience and need to present information in
65 many different ways. This means thinking about hundreds to thousands
66 of documents instead of tens, about processing those documents into a
67 full-text search database, and reducing cost along the way.
69 Emacs can do all of these things, but do you really want it to?
72 Let us first consider
/Org the syntax/.
74 Org syntax is much less popular than Markdown and lacks parsing
75 utilities in popular programming languages
[fn:1]. Regardless, we are
76 committed to it as a foundation because it is the most hackable
77 documentation engine available. With enough experience you can morph
78 Org into whatever documentation system that is needed.
81 As such, all documentation we write is done using
=Org syntax=. When
82 we refer to Org syntax we are referring to the vanilla syntax which
83 comes built-in with Emacs.
85 =Ulang syntax= is an extension of
=Org syntax=. If some feature of the
86 =Ulang= is undocumented, refer to
=Org syntax= for guidance.
88 [fn:1] The ecosystem is changing though, thanks to the dedication of
89 some excellent hackers:
[[https://github.com/karlicoss/orgparse][python]],
[[https://github.com/tecosaur/Org.jl][julia]] 93 :CUSTOM_ID: 4aa3ec2a-b360-43ae-b2d8-f9735f211290 95 This section documents the
/extensions/ made to
=Org syntax=. Each
96 sub-heading focuses on a pre-existing
=Org= element and describes
97 =Ulang= functionality included with
=ulang.el=.
101 :CUSTOM_ID: 2cadda9a-22a3-4b42-ad4e-d7a774f74cba 103 The ulang
*Keywords* are a superset of those defined by
[[https://datatracker.ietf.org/doc/html/rfc2119][RFC-2119]].
106 In many standards track documents several words are used to signify
107 the requirements in the specification. These words are often
108 capitalized. This document defines these words as they should be
109 interpreted in IETF documents. Authors who follow these guidelines
110 should incorporate this phrase near the beginning of their document:
112 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
113 NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
114 "OPTIONAL" in this document are to be interpreted as described in
119 1. MUST This word, or the terms "REQUIRED" or "SHALL", mean that the
120 definition is an absolute requirement of the specification.
122 2. MUST NOT This phrase, or the phrase "SHALL NOT", mean that the
123 definition is an absolute prohibition of the specification.
125 3. SHOULD This word, or the adjective "RECOMMENDED", mean that there
126 may exist valid reasons in particular circumstances to ignore a
127 particular item, but the full implications must be understood and
128 carefully weighed before choosing a different course.
130 4. SHOULD NOT This phrase, or the phrase "NOT RECOMMENDED" mean that
131 there may exist valid reasons in particular circumstances when the
132 particular behavior is acceptable or even useful, but the full
133 implications should be understood and the case carefully weighed
134 before implementing any behavior described with this label.
136 5. MAY This word, or the adjective "OPTIONAL", mean that an item is
137 truly optional. One vendor may choose to include the item because a
138 particular marketplace requires it or because the vendor feels that
139 it enhances the product while another vendor may omit the same item.
140 An implementation which does not include a particular option MUST be
141 prepared to interoperate with another implementation which does
142 include the option, though perhaps with reduced functionality. In the
143 same vein an implementation which does include a particular option
144 MUST be prepared to interoperate with another implementation which
145 does not include the option (except, of course, for the feature the
149 One of the important features of keywords is that we use them as Org
150 [[https://orgmode.org/manual/Workflow-states.html][Workflow states]]. You may use any of the keywords above or below as the
151 first word in a heading to signify a requirement or a workflow state:
153 6. TBD A task to be done at a later date.
155 7. TODO A task yet to be done.
157 8. WIP Work In Progress task.
159 9. NOTE Designates a note item.
161 10. DRAFT Designates a draft item.
163 11. DEAD Item that will not be completed.
165 12. DONE Completed task.
167 13. COMMENT A 'commented' item.
171 :CUSTOM_ID: cdb4976b-1d0d-49df-bfb1-3dbd5d99590e 173 Several
*global* [[https://orgmode.org/manual/Macro-Replacement.html][Org Macros]] are used throughout our documents. They are listed
174 here for convenience.
177 #+begin_src emacs-lisp :exports both :results replace pp 178 org-export-global-macros
181 #+RESULTS: ulang-macros
183 : "#+TITLE: $1\n#+AUTHOR: $2\n#+EMAIL: $3\n#+DESCRIPTION: $4\n#+SUBTITLE: $4\n#+OPTIONS: ^:nil toc:nil num:nil html-postamble:nil\n#+HTML_HEAD:
<link rel=\"stylesheet\" href=\"https://fonts.xz.style/serve/inter.css\"/>\n#+HTML_HEAD:
<link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.compiler.company/css/new.min.css\"/>\n#+HTML_HEAD:
<link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.compiler.company/css/night.css\"/>\n")
184 : ("opts" . "#+OPTIONS: $1\n"))
186 Macros
/are not expanded/ in source files - you will see them in the
187 form
={{{NAME(ARGS)}}}=. You will need the relevant macro definition
188 (in
=ulang.el=) in order to export ulang docs with the macros
192 The Org-mode
[[https://orgmode.org/manual/Link-Format.html][Link Format]] is used throughout the Ulang and needs little
195 #+begin_src emacs-lisp :results replace pp :exports both 200 : ("notmuch-tree" "notmuch-search" "notmuch" "man" "eww" "rmail" "mhe"
201 : "irc" "info" "gnus" "docview" "bibtex" "bbdb" "w3m" "doi" "id"
202 : "elfeed" "file+sys" "file+emacs" "shell" "news" "mailto" "https"
203 : "http" "ftp" "help" "file" "elisp")
206 For ease of use we have defined some special link handling abbrevs:
208 #+begin_src emacs-lisp :results replace pp :exports both 209 org-link-abbrev-alist
213 : (("vc" . "https:
//vc.compiler.company/%s")
214 : ("comp" . "https:
//compiler.company/%s")
215 : ("cdn" . "https:
//cdn.compiler.company/%s")
216 : ("packy" . "https:
//packy.compiler.company/%s")
217 : ("yt" . "https://youtube.com/watch?v=%s"))
220 [[https://orgmode.org/manual/Blocks.html][Blocks]] are a feature of vanilla Org-mode which are described in the
221 manual. We extend this functionality with
[[https://orgmode.org/manual/Dynamic-Blocks.html][Dynamic Blocks]]. The
222 important feature of these blocks is that their contents are updated
223 /dynamically/ by a user within an Org-mode document.
225 For example, typing
~C-c C-c~ on the block below dynamically generates
226 the standard clocktable for the current file.
228 To update all dynamic blocks in a document, use the
229 =org-dblock-update= ~C-c C-x C-u~ function.
232 #+CAPTION: Clock summary at [2023-11-25 Sat 15:26]
234 |--------------+--------| 235 | *Total time* | *0:00* | 238 #+begin_src emacs-lisp :results replace pp :exports both 239 org-dynamic-block-alist
243 : (("files" . ulang-dblock-insert-files)
244 : ("links" . ulang-dblock-insert-links)
245 : ("columnview" . org-columns-insert-dblock)
246 : ("clocktable" . org-clock-report))
250 :CUSTOM_ID: ulang-tables 253 Org
[[https://orgmode.org/manual/Tables.html][Tables]] are powerful but require many extensions to really
/feel/ 254 powerful. As they come in vanilla Emacs, they don't feel as good as
255 commercial spreadsheet-based software. The Ulang Table extensions add
256 some sane defaults and additional data-processing utilities to work
257 with tables in any text, not just Org docs.
259 A vanilla Org Table may look like this:
269 #+TBLFM: $2=$1+1::$3=$2+1
271 Just like in Excel, we can define a table outline like the one above
272 and use code to fill in the values with a formula:
=$2=$1+1::$3=$2+1=.
274 Unlike Excel, these tables can appear pretty much anywhere - including
277 Usually we prefer to use lisp to prepare our data and
278 populate complex tables, or no-nonsense keyboard commands for short
279 tables. This is done with a few functions in Org docs and the
=orgtbl= 280 minor-mode everywhere else.