1 #+title: Universal Language
2 #+author: Richard Westhaver
3 #+email: ellis@rwest.io
4 #+setupfile: ../clean.theme
7 :ID: e63d129f-9024-4cd8-9e2c-77f4bc614663 10 This document is for contributors and curious readers. It is a loose
11 specification which describes the fundamental rules of how we write in
12 prose, documentation, and other contexts.
14 All sources we write attempt to comply to this specification but it is
15 never
/strictly/ enforced. If there is a reason to not comply with a
16 rule, it is already broken.
19 Every investigation, including the present one, has to be communicated
20 from one person to another by means of language. It is expedient to
21 begin our study by calling attention to this obvious fact, by giving a
22 name to the language being used, and by being explicit about a few of
23 its features. We shall call the language being used the
24 U-Language. [...] There would be no point in calling attention to it,
25 if it were not for the fact that language is more intimately related
26 to our job than of most others. -- [[https://iep.utm.edu/haskell-brooks-curry/][Haskell Curry]]
29 In this document, we will be calling attention to our own
30 language - examining it, and describing how it works.
32 Our job is to solve problems. Hard problems preferred. So we ought to
33 pay close attention to the language we use because it brings the
34 reader and writer
/closer/ to the problem at hand.
36 We are primarily concerned with
/written languages/ like the one
37 you're reading now. We will skip past the obvious details - English is
38 our primary form of communication for example. The line you are
39 reading currently is a sentence which is part of a paragraph.
43 :ID: 98a02bb2-3f39-49c6-898a-68ccd8f3cbe1 45 [[https://www.gnu.org/software/emacs/][GNU Emacs]] is our text editor, so naturally
[[https://orgmode.org/][Org Mode]] is our word
48 If you are already familiar with Emacs and Org-Mode, I recommend
49 opening the source of this document in Emacs and following along.
51 If not, I recommend browsing through the
[[https://orgmode.org/worg/][Worg resources]], but we won't
52 be getting too deep into tribal hacker knowledge of Emacs.
57 :ID: 236227a5-b30c-4548-8cad-360428d74d67 59 Our
*U-Language* is colloquially termed
*ulang*. Each section of this
60 document describes an Org syntax component and how it is used in our
64 :ID: 88bf1177-b5b7-4945-8bdc-5229803e617e 66 [[https://orgmode.org/manual/Emphasis-and-Monospace.html][Text Emphasis]] in Org covers the range you would expect from any other
69 #+begin_src org :results replace 78 #+RESULTS: org-emphasis
86 - Text emphasis markers
/may/ appear in code comments as long as they do
87 not cause any conflicts with the host language, although they
/should/ 88 be restricted to the
=Commentary= section.
89 - ~code~ may sometimes be written instead with
=verbatim= emphasis -
90 the distinction is only important for specific export backends which
91 support it - see
[[https://emacs.stackexchange.com/a/77822][this thread]] for details.
94 :ID: 7ecaec5d-c656-44e1-8fad-185915655cee 96 Org
[[https://orgmode.org/guide/Hyperlinks.html][Links]] are wrapped in brackets like so:
100 [[LINK][DESCRIPTION]]
101 ;; or without description
105 - LINK is a URI like https://google.com
106 - DESCRIPTION is optional
110 :ID: a867de82-8558-4277-b9d6-b5d3226f73d1 112 [[https://orgmode.org/manual/Internal-Links.html][Internal Links]] 115 :ID: 6aedc026-36d0-4763-adc8-8ae1a79f1b3e 117 Org has built-in support for many different types of
[[https://orgmode.org/guide/Hyperlinks.html#External-Links-1][External Links]],
118 which are URL-like locators. We also define some custom link types
119 which are used throughout our documentation
/and/ code.
123 :ID: ed035298-f7fa-4726-ad58-2d542323bb61 125 In Org, headings can be summarize as any line starting with a star:
=* 126 H1=. Headings can be nested or 'demoted' by prepending another star:
138 This is a useful pattern which we apply outside of Org - most commonly
139 in our code comments.
141 In our source code, we use the comment character instead of a star:
142 #+name: lisp-headings
145 (print "H1") ;; just an inline comment
152 #+name: rust-headings
164 :ID: 2cadda9a-22a3-4b42-ad4e-d7a774f74cba 167 TODO keywords are often used to keep track of the state of a
[[https://orgmode.org/manual/TODO-Items.html][TODO 168 Item]], but may also be
[[https://orgmode.org/manual/TODO-Extensions.html][extended]] to support a variety of stateful item
169 types beyond just simple tasks.
171 We
/do not/ specify any
173 The following keywords form the simple set of task states.
193 :ID: a7ae1b2a-559e-46e9-8cab-33e39a218288 195 [[https://orgmode.org/manual/Tags.html][Tags]] are used liberally throughout our documents. They are simple
196 strings usually following a headline as a
=:=-separated list.
198 A tag can be any text without newlines, although it is recommended to
199 treat them as unique identifiers and usage of whitespace is
200 discouraged (but not disallowed).
203 ,* foobar :tag1:tag2:@home:!today
207 :ID: b686dbc5-3505-49d7-b66a-0772bcf1a726 209 Some of ourtags are prefixed with a character which indicates a
210 special tag category:
211 - =@= :: location-tag
\\ 212 A
/location tag/ refers to some context-dependent named point in
213 space, such as a user's home address, a popular fast food
214 restaurant, or a specific room found in most houses.
215 - =@home=,
=@taco-bell=,
=@bedroom= 216 - =!= :: timestamp-tag
\\ 217 /Timestamp tags/ refer to some point in time, often named for
218 convenience. You may use literal
[[https://orgmode.org/manual/Timestamps.html][Timestamps]] too. Timestamp tags
219 should not
/directly reference/ scheduling information, doing so is
221 - =!now=,
=!christmas=,
=!someday= 222 - =#= :: anchor-tag
\\ 223 An
/anchor tag/ implies a link to the object identified by some
[[id:3944c851-e46c-4d75-b8f5-07b5c052177a][ID]].
224 - =#readme=,
=#a7ae1b2a-559e-46e9-8cab-33e39a218288=,
=#custom-id= 227 :ID: 174a993b-a5dc-4324-b4f8-dda8101a55b7 229 [[https://orgmode.org/manual/Properties-and-Columns.html][Properties]] are key:value pairs which are associated with a heading or
230 file and stored in a dedicated
[[https://orgmode.org/manual/Drawers.html][Drawer]].
233 ,* WIP do stuff :@lab:
235 :CREATED: <2024-08-24 Sat 19:09>
236 :ID: 62da3982-7a83-4b27-ab7e-55949fd3e2a3
242 :ID: 3944c851-e46c-4d75-b8f5-07b5c052177a 244 Org supports two built-in identifier properties:
245 - ID :: Unique, machine-generated
246 - CUSTOM_ID :: User-defined
248 These IDs don't add any information for the reader - the IDs are used
249 to index and associate headings. All headings are assigned an ID
250 automatically which should never be changed.
252 CUSTOM_IDs are for convenience and extensions, but are rarely
253 necessary given the many ways of identifying a headline.
256 :ID: 27141c7a-e903-4909-890f-b496716a48ba 258 File keywords, also known as
[[https://orgmode.org/manual/In_002dbuffer-Settings.html][In-Buffer Settings]] are similar to
259 properties in the sense that they are key/value pairs, but they only
260 appear at the top of a file before any content and use a different
264 ,#+title: some file title
266 ,#+PROPERTY DESCRIPTION assigning a property via file keyword
270 :DESCRIPTION: just a property, not a file keyword
276 :ID: be4c4c52-4353-45df-b2ab-1e72f392008d 278 Org
[[https://orgmode.org/manual/Tables.html][Tables]] offer some pretty advanced spreadsheet capabilities which
279 we won't delve into here. Plain tables can be identified in documents by lines
280 starting with the
=|= character:
281 #+begin_src org :results replace 282 | col1 | col2 | col3 |
283 |------+------+------|
288 | col1 | col2 | col3 | 289 |------+------+------| 294 :ID: d5a09bc6-07de-4812-ab2e-f5ead1e0d8a7 296 Org
[[https://orgmode.org/manual/Blocks.html][Blocks]] consist of a body wrapped in a pair of lines which look
297 like
[[id:27141c7a-e903-4909-890f-b496716a48ba][File Keywords]] prepended with
=BEGIN_= and
=END_=.
299 Simple blocks such as
=example= and
=center= only have a special
300 meaning during publishing:
301 #+begin_src org :results replace drawer 303 this is an example block
307 this is a centered block
314 this is an example block 318 this is a centered block 323 :ID: 0784d230-95b0-4135-a52f-6be4e2d5d80a 325 [[https://orgmode.org/manual/Working-with-Source-Code.html][Code Blocks]] are used to embed source code into a document. They always
326 start with
=#+BEGIN_SRC= and end with
=#+END_SRC=:
328 #+begin_src org :results replace drawer 329 ,#+begin_src emacs-lisp
330 (message "an emacs-lisp code block inside an org document")
336 #+begin_src emacs-lisp 337 (message "an emacs-lisp code block inside an org document") 341 You can embed virtually any type of source code in side a code block,
342 execute it in-place, and control how both the source code and results
343 are presented in the document. Source code blocks may also be
344 collected in a
[[file:babel.org][Library of Babel]] and re-used across many documents.
348 :ID: 8898387c-2c84-4f56-80ee-d03daebd0990 350 [[https://orgmode.org/manual/Dynamic-Blocks.html][Dynamic Blocks]] as the name implies are blocks with contents that are
351 dynamically updated. These blocks always begin with
=#+BEGIN:= 352 followed by a space, the name of the dynamic block and any parameter
353 values, and end with
=#+END:=. The dynamic block name is taken from
354 the name of a function which matches
=org-dblock-write:NAME=. This
355 function is called with the parameter values and replaces the body of
358 The only built-in dynamic block is the
=clocktable=:
359 #+begin_src org :results replace drawer 361 ,#+CAPTION: Clock summary at [2024-09-06 Fri 15:23]
363 |--------------+--------|
364 | *Total time* | *0:00* |
371 #+CAPTION: Clock summary at [2024-09-06 Fri 15:23] 373 |--------------+--------| 374 | *Total time* | *0:00* | 378 Dynamic blocks are designed for user extension and are a powerful tool
379 to programatically summarize information.