Showing posts with label org-mode. Show all posts
Showing posts with label org-mode. Show all posts

Thursday, March 31, 2022

Capture

-- Capture Backgrounder --

Org-capture is global, may be called from anywhere in Emacs.

Calling org-capture displays a buffer which accepts notes.

Closing the buffer saves those notes.

Org-capture is customizable as to
     the types of notes
     where the notes are saved

 

-- Capture By Example --
(Six steps.)

1) Invoke Org-Capture
     via "M-x org-capture"
     there is no default key binding but one can be set

Emacs presents you with a menu like this...


  [t] Task
  [C] Customize
  [q] Abort

2) Create A New Task

Select "t" from the menu shown above, and you get an org-mode buffer that looks like...


    Capture buffer. Finish 'C-c C-c', refile 'C-c C-w', abort 'C-c C-k'.
    *** TODO
      [2022-03-01 Tue]
    [[file:~/../foo.org]]

3) Enter The Note’s Text Following The "TODO"

4) Save And Exit
     via "C-c C-c"
     Emacs saves the new task
     the default storage location is "~/.notes"
     this can also be customized

Saved notes look like...


  Tasks
  ** TODO Test
    [2022-02-10 Thu]
    [[file:~/Lib/2022-DEV/11-Org-Doc/Howardism--Capturing/01-Notes/org-capture.org::
      *Example][Example]] Totally bogus.
  ** TODO Foo
    [2022-02-10 Thu]
  [[file:~/Lib/2022-DEV/11-Org-Doc/Howardism--Capturing/01-Notes/org-capture.org::
    *Customizing][Customizing]]

5) To Customize Capture...
     select "C" for "Customize org-capture-templates"
     you get an org-mode buffer that contains a whole bunch of stuff (see below)

6) To Abort, Select "q"
     and then it does
     so, nothing to see here

 

-- Capture Commands --

From org manual (v 9.5, section 10.1.2, "Using capture")

M-x org-capturedisplay the capture templates menu
C-c C-c (org-capture-finalize)resume at previous location
C-c C-w (org-capture-refile)refile the note to a different place
C-c C-k (org-capture-kill)abort capture & resume at previous location
C-u M-x org-capturevisit the target location of a capture template
C-u C-u M-x org-capturevisit the last stored capture item in its buffer

 

-- Others --

org-capture-goto-last-stored


  interactive compiled Lisp function

  takes user to the location where the last capture note was store

org-capture


  is an interactive compiled Lisp function: (- org-capture &optional GOTO
  KEYS) used to capture something

  This will let you select a template from '- org-capture-templates', and then
  file the newly captured information.

  The text is immediately inserted at the target location, and an indirect buffer
  is shown where you can edit it.

  Pressing 'C-c C-c' brings you back to the previous state of Emacs, so that you
  can continue your work.

  When called interactively with a 'C-u' prefix argument GOTO, don’t capture
  anything, just go to the file/headline where the selected template stores its
  notes.

  With a 'C-u C-u' prefix argument, go to the last note stored.

  When called with a 'C-0' (zero) prefix, insert a template at point.

  When called with a 'C-1' (one) prefix, force prompting for a date when a
  datetree entry is made.

  ELisp programs can set KEYS to a string associated with a template in '-
  org-capture-templates'. In this case, interactive selection will be bypassed.

  If '- org-capture-use-agenda-date' is non-nil, capturing from the agenda will
  use the date at point as the default date. Then, a 'C-1' prefix will tell the
  capture process to use the HH:MM time of the day at point (if any) or the
  current HH:MM time.

org-capture-finalize


  is an interactive compiled Lisp function: (- org-capture-finalize &optional
  STAY-WITH-CAPTURE) to finalize the capture process

  with prefix argument STAY-WITH-CAPTURE, jump to the location of the captured
  item after finalizing

org-capture-goto-last-stored


  is an interactive compiled Lisp function: (- org-capture-goto-last-stored)

  go to the location where the last capture note was stored

org-capture-goto-target


  is an interactive compiled Lisp function: (- org-capture-goto-target
  &optional TEMPLATE-KEY)

  go to the target location of a capture template. The user is queried for the
  template

org-capture-kill


  is an interactive compiled Lisp function: (- org-capture-kill)

  abort the current capture process

org-capture-mode


  is an interactive compiled Lisp function: (- org-capture-mode &optional ARG)

  is a minor mode for special key bindings in a capture buffer

  turning on this mode runs the normal hook '- org-capture-mode-hook'

org-capture-refile


  is an interactive compiled Lisp function: (- org-capture-refile)

  finalize the current capture and then refile the entry

  refiling is done from the base buffer, because the indirect buffer is then
  already gone any prefix argument will be passed to the refile command

org-capture-string


  is an interactive compiled Lisp function: (- org-capture-string STRING
  &optional KEYS)

  capture STRING with the template selected by KEYS

 

-- Customizing Capture --

 

Change Where Notes Are Stored


  (setq org-default-notes-file "~/pathname/filename.org")

 

Customize The Templates

Each has at least 3 parts.

  1. a key binding to select a particular template
  2. a destination file, and sections in that file, like heading, sub-heading, list item, etc
  3. a formatting template to handle routine details

 

Template Customizing By Example

The following adds a "w" (work-related) task in addition to the "t" (task)


  (add-to-list 'org-capture-templates
                   '("w" "Work-related Task"  entry
                     (file "~/pathname/notes/work.org")
                     " TODO %?" :empty-lines 1))

and the following re-adds the default, so both the "t" option and the "w" option show up


  (add-to-list 'org-capture-templates
                   '("t" "Personal Task"  entry
                     (file org-default-notes-file)
                     " TODO %?" :empty-lines 1))

 

Using More Than One Template

(from Org Manual 9.5, 10.1.3 Capture templates p107-113)

One template is for general TODO entries.
     under the heading 'Tasks'
     filed at '~/org/gtd.org'
     its hotkey is "t"

The other is for capturing journal entries.
     in a "date tree"
     filed at '~/../journal.org'
     its hotkey is "j"

Pressing "t" from the capture menu has Org create a task entry for a "TODO" item. Likewise for "j" and corresponding "journal" entries.

 

Org Documentation For Template Customizing

The text block below is exactly what emacs presents when user runs "M-x org-capture" and selects "C" for "customize".

The bits in "[Brackets]" below are displayed by emacs as its version of buttons (just so you know).


  For help using this buffer, see Easy Customization in the Emacs manual.

                                            [Search]

  Operate on all settings in this buffer:
  [Revert...]  [Apply]  [Apply and Save]

   Org Capture Templates:
  [INS]
     [State] : STANDARD.
     Templates for the creation of new entries. Hide

     Each entry is a list with the following items:

     keys         The keys that will select the template, as a string, characters
                  only, for example "a" for a template to be selected with a
                  single key, or "bt" for selection with two keys.  When using
                  several keys, keys using the same prefix key must be together
                  in the list and preceded by a 2-element entry explaining the
                  prefix key, for example

                          ("b" "Templates for marking stuff to buy")

                  The "C" key is used by default for quick access to the
                  customization of the template variable.  But if you want to use
                  that key for a template, you can.

     description  A short string describing the template, will be shown during
                  selection.

     type         The type of entry.  Valid types are:
                    entry       an Org node, with a headline.  Will be filed
                                as the child of the target entry or as a
                                top-level entry.
                    item        a plain list item, will be placed in the
                                first plain list at the target
                                location.
                    checkitem   a checkbox item.  This differs from the
                                plain list item only is so far as it uses a
                                different default template.
                    table-line  a new line in the first table at target location.
                    plain       text to be inserted as it is.

     target       Specification of where the captured item should be placed.
                  In Org files, targets usually define a node.  Entries will
                  become children of this node, other types will be added to the
                  table or list in the body of this node.

                  Most target specifications contain a file name.  If that file
                  name is the empty string, it defaults to 'org-default-notes-file'.
                  A file can also be given as a variable or as a function called
                  with no argument.  When an absolute path is not specified for a
                  target, it is taken as relative to 'org-directory'.

                  Valid values are:

                  (file "path/to/file")
                      Text will be placed at the beginning or end of that file

                  (id "id of existing Org entry")
                      File as child of this entry, or in the body of the entry

                  (file+headline "path/to/file" "node headline")
                      Fast configuration if the target heading is unique in the file

                  (file+olp "path/to/file" "Level 1 heading" "Level 2" ...)
                      For non-unique headings, the full outline path is safer

                  (file+regexp  "path/to/file" "regexp to find location")
                      File to the entry matching regexp

                  (file+olp+datetree "path/to/file" "Level 1 heading" ...)
                      Will create a heading in a date tree for today’s date.
                      If no heading is given, the tree will be on top level.
                      To prompt for date instead of using TODAY, use the
                      :time-prompt property.  To create a week-tree, use the
                      :tree-type property.

                  (file+function "path/to/file" function-finding-location)
                      A function to find the right location in the file

                  (clock)
                     File to the entry that is currently being clocked

                  (function function-finding-location)
                     Most general way: write your own function which both visits
                     the file and moves point to the right location

     template     The template for creating the capture item.  If you leave this
                  empty, an appropriate default template will be used.  See below
                  for more details.  Instead of a string, this may also be one of

                      (file "/path/to/template-file")
                      (function function-returning-the-template)

                  in order to get a template from a file, or dynamically
                  from a function.

     The rest of the entry is a property list of additional options.  Recognized
     properties are:

      :prepend            Normally newly captured information will be appended at
                          the target location (last child, last table line,
                          last list item...).  Setting this property will
                          change that.

      :immediate-finish   When set, do not offer to edit the information, just
                          file it away immediately.  This makes sense if the
                          template only needs information that can be added
                          automatically.

      :jump-to-captured   When set, jump to the captured entry when finished.

      :empty-lines        Set this to the number of lines the should be inserted
                          before and after the new item.  Default 0, only common
                          other value is 1.

      :empty-lines-before Set this to the number of lines the should be inserted
                          before the new item.  Overrides :empty-lines for the
                          number lines inserted before.

      :empty-lines-after  Set this to the number of lines the should be inserted
                          after the new item.  Overrides :empty-lines for the
                          number of lines inserted after.

      :clock-in           Start the clock in this item.

      :clock-keep         Keep the clock running when filing the captured entry.

      :clock-resume       Start the interrupted clock when finishing the capture.
                          Note that :clock-keep has precedence over :clock-resume.
                          When setting both to t, the current clock will run and
                          the previous one will not be resumed.

      :time-prompt        Prompt for a date/time to be used for date/week trees
                          and when filling the template.

      :tree-type          When 'week', make a week tree instead of the month tree.

      :unnarrowed         Do not narrow the target buffer, simply show the
                          full buffer.  Default is to narrow it so that you
                          only see the new stuff.

      :table-line-pos     Specification of the location in the table where the
                          new line should be inserted.  It should be a string like
                          "II-3", meaning that the new line should become the
                          third line before the second horizontal separator line.

      :kill-buffer        If the target file was not yet visited by a buffer when
                          capture was invoked, kill the buffer again after capture
                          is finalized.

     The template defines the text to be inserted.  Often this is an
     Org mode entry (so the first line should start with a star) that
     will be filed as a child of the target headline.  It can also be
     freely formatted text.  Furthermore, the following %-escapes will
     be replaced with content and expanded:

       %[pathname] Insert the contents of the file given by
                   'pathname'.  These placeholders are expanded at the very
                   beginning of the process so they can be used to extend the
                   current template.
       %(sexp)     Evaluate elisp '(sexp)' and replace it with the results.
                   Only placeholders pre-existing within the template, or
                   introduced with %[pathname] are expanded this way.  Since this
                   happens after expanding non-interactive %-escapes, those can
                   be used to fill the expression.
       %<...>      The result of format-time-string on the ... format specification.
       %t          Time stamp, date only.  The time stamp is the current time,
                   except when called from agendas with 'M-x org-agenda-capture' or
                   with 'org-capture-use-agenda-date' set.
       %T          Time stamp as above, with date and time.
       %u, %U      Like the above, but inactive time stamps.
       %i          Initial content, copied from the active region.  If %i is
                   indented, the entire inserted text will be indented as well.
       %a          Annotation, normally the link created with 'org-store-link'.
       %A          Like %a, but prompt for the description part.
       %l          Like %a, but only insert the literal link.
       %c          Current kill ring head.
       %x          Content of the X clipboard.
       %k          Title of currently clocked task.
       %K          Link to currently clocked task.
       %n          User name (taken from the variable 'user-full-name').
       %f          File visited by current buffer when org-capture was called.
       %F          Full path of the file or directory visited by current buffer.
       %:keyword   Specific information for certain link types, see below.
       %^g         Prompt for tags, with completion on tags in target file.
       %^G         Prompt for tags, with completion on all tags in all agenda files.
       %^t         Like %t, but prompt for date.  Similarly %^T, %^u, %^U.
                   You may define a prompt like: %^{Please specify birthday}t.
                   The default date is that of %t, see above.
       %^C         Interactive selection of which kill or clip to use.
       %^L         Like %^C, but insert as link.
       %^{prop}p   Prompt the user for a value for property 'prop'.
       %^{prompt}  Prompt the user for a string and replace this sequence with it.
                   A default value and a completion table ca be specified like this:
                   %^{prompt|default|completion2|completion3|...}.
       %?          After completing the template, position cursor here.
       %\1 ... %\N Insert the text entered at the nth %^{prompt}, where N
                   is a number, starting from 1.

     Apart from these general escapes, you can access information specific to the
     link type that is created. For example, calling 'org-capture' in emails or in
     Gnus will record the author and the subject of the message, which you can
     access with "%:from" and "%:subject", respectively. Here is a complete list
     of what is recorded for each link type.

     Link type               |  Available information
     ------------------------+------------------------------------------------------
     bbdb                    |  %:type %:name %:company
     vm, wl, mh, mew, rmail, |  %:type %:subject %:message-id
     gnus                    |  %:from %:fromname %:fromaddress
                             |  %:to   %:toname   %:toaddress
                             |  %:fromto (either "to NAME" or "from NAME")
                             |  %:date %:date-timestamp (as active timestamp)
                             |  %:date-timestamp-inactive (as inactive timestamp)
     gnus                    |  %:group, for messages also all email fields
     eww, w3, w3m            |  %:type %:url
     info                    |  %:type %:file %:node
     calendar                |  %:type %:date

     When you need to insert a literal percent sign in the template,
     you can escape ambiguous cases with a backward slash, e.g., \%i.
  Groups: Org Capture

And that is all we have for today.

 


See tabs at the top for definitions and books.
Have anything worth adding? Then try sosayseff+nosey@nullabigmail.com
Me? Recently confused by life. Like starting in kindergarten.

Wednesday, February 23, 2022

Sorting Org-Mode Tables

Start with any old table containing data.


  | fi     | fi     | fo    | fum |  
  | doodle | doodle | doole | dum |  
  | one    | fi     | fo    | fum |  
  | three  | fi     | fo    | fum |  
  | 7      | fi     | fo    | fum |  
  | cero   | fi     | fo    | fum |  

Say you want to sort it. Hmmm.

OK. So, to do that...

Put the cursor into the target column.

Press "C-c ^"

Follow the prompts to get the right sort of sort, which can be one of...

[a]lphabetic
[A]lphabetic (reverse)
[n]umeric
[N]umeric (reverse)
[t]ime (old to new)
[T]ime (new to old)

 

  
  Alphabetic Sort On First Column
  | 7      | fi     | fo    | fum |
  | cero   | fi     | fo    | fum |
  | doodle | doodle | doole | dum |
  | fi     | fi     | fo    | fum |
  | one    | fi     | fo    | fum |
  | three  | fi     | fo    | fum |

 

  
  Reverse Alphabetic Sort
  | three  | fi     | fo    | fum |
  | one    | fi     | fo    | fum |
  | fi     | fi     | fo    | fum |
  | doodle | doodle | doole | dum |
  | cero   | fi     | fo    | fum |
  | 7      | fi     | fo    | fum |
            

 

  
  Numeric Sort On First Column
  | fi     | fi     | fo    | fum |
  | doodle | doodle | doole | dum |
  | one    | fi     | fo    | fum |
  | three  | fi     | fo    | fum |
  | cero   | fi     | fo    | fum |
  | 7      | fi     | fo    | fum |
  

 

  
  Reverse Numeric Sort
  | 7      | fi     | fo    | fum |
  | fi     | fi     | fo    | fum |
  | doodle | doodle | doole | dum |
  | one    | fi     | fo    | fum |
  | three  | fi     | fo    | fum |
  | cero   | fi     | fo    | fum |
  

Pretty cool.

Inspiration from "Pragmatic Emacs", Sorting An Org-Mode Table

 


See tabs at the top for definitions and books.
Have anything worth adding? Then try sosayseff+nosey@nullabigmail.com
Me? Don't remember.

Wednesday, February 16, 2022

Table Me

Well then, I'm learning all about Emacs Org-Mode. It's fun.

I'm a relative newcomer to Emacs, having first installed it on Windows in 1998. And having used it since, almost daily, as they say, but now it's time to make it whistle. I could say "make it sing", but I'm not sure I'll live that long, so a little toot is all I'm hoping for.

One thing about Emacs though — the deeper you get into it, the harder it is to back out. And the more sense it makes. That's two things, not one, which is not unusual in the Emacs world, so I guess that might be a good sign.

Org-Mode can do handy things with tables, and it isn't that hard to make happen. Here is a quick howto.

Method 01

  • Start with a one-line grid of data. Let's say in "n" different categories.
  • Manually separate each category with "|" characters, with one at the start of the line and another at the end of the line, and another between categories.
  • When you arrive at the end of the line, press "TAB", not "RETURN".
  • You now have a one-row, n-column table, where the last entry is the "nth" and comes before the line-ending "|", and a new, empty row below that.
  • Continue with this until you are done entering data.
  • You now have a table with column separators but no row separators.

  
  Let's do one row by two columns.
  |   |   |

  Add another row by hitting "TAB" at the end of
  the first line.
  |   |   |
  |   |   |

  Add row separators and another line.
  |---+---|
  |   |   |
  |---+---|
  |   |   |
  |   |   |

You can add row separators by pressing "TAB" to convert a line beginning with "|-" to a horizontal row separator, or you can put the cursor on a table row and press "C-c -" to do the same. ("C-c -" means "press and hold the control key while pressing 'c', then press '-'.")

Method 02

  • Start by finding an empty region of the buffer you're in. (You'll need a bit of free space for the table.)
  • Press "C-c |".
  • Emacs prompts for the table size (like "5x2")
  • Use default if that works, or enter the size you'll need.
  • I normally start with one row and "n" columns, where "n" is, of course, how many columns I'll be needing. So if it's three columns, I'll press "3x1", and then "RETURN", and have a one-row by three-column empty table.
  • So then, go ahead and press "RETURN".
  • Emacs creates your table with the number of columns and rows that you specified.
  • Then enter data, pressing "TAB" at the end of each row to get a new row below it. Until you've had enough.

So...you get the same thing...


  One row by two columns again.
  |   |   |

  Add another row by hitting "TAB" at the end of
  the first line, again.
  |   |   |
  |   |   |

  And then add row separators and another line.
  |---+---|
  |   |   |
  |---+---|
  |   |   |
  |   |   |

Method 03

This uses the "M-x org-table-create-or-convert-from-region", where you press and hold the "ALT" key while pressing "x", then enter "org-table-create-or-convert-from-region". Yeah, right. For Emacs, the "ALT" key is called "M", a leftover from the olden days.

  • Start with a grid of delimited data.
  • Delimiters can be
    • A single space between columns, with no spaces in the data.
    • Commas, preferably "comma + onespace".
    • Anything else that's consistent and clear and the same throughout the data grid.
  • Select the region. (If you don't know how to do this, then look it up.)
  • Press "C-c |".
  • Boom — you have your table.

So, let's try that then.


  Get some "data" to convert...

  fi fi fo fum
  doodle doodle doole dum

  Then select the region and press "C-c |"...

  | fi     | fi     | fo    | fum |
  | doodle | doodle | doole | dum |

  ...and you've got your table.

Note: This works if you have at least two lines of data to convert. Don't count on it working for only one line of data.

I'll get to another, more involved method later.

This post is based on info from Pragmatic Emacs: "Org-mode basics II: use simple tables in your notes."

 


See tabs at the top for definitions and books.
Have anything worth adding? Then try sosayseff+nosey@nullabigmail.com
Me? All too often tabled.

Saturday, January 8, 2022

Org Exporting

I'll get to the why and wherefore later. Now I'm documenting where I actually ended up and what I ended up with.

Emacs Org-Mode is not explained here, just how I export a document to HTML.

HOW TO EXPORT

First, choose whether to use the "Custom" or "Generic" process.

PART 1: MY CUSTOM PROCESS.

My "custom" process is what I will be using most or all of the time. All I need to do is to drop it into my target file and go with that.

I have several files pre-written and stored in their own directory:

  • custom.css
  • html-export-header
  • postamble-css.css

(1) Drop the following "html-export-header" into the top of the org file to export:

# custom default org headers 2022-01-02
#+TITLE: Custom Header for HTML Exporting
#+DATE: 9999-99-99
#+AUTHOR:
#+LANGUAGE: en
#+OPTIONS: H:6
#+OPTIONS: html-postamble:auto
#+OPTIONS: html-preamble:nil
#+OPTIONS: html-style:t
#+OPTIONS: num:0
#+HTML_CONTAINER: div
#+HTML_DOCTYPE: html5
#+HTML_HEAD:
#+HTML_HEAD:

Set the following to suit your needs:

#+TITLE: Custom Header for HTML Exporting
#+DATE: 9999-99-99
#+AUTHOR:

Caveats:

(a) Be sure to include "#+OPTIONS: html-style:t"

(b) Put it ahead of links to the custom css. It is needed to produce correct formatting for any items not covered in the custom css, like centering, which depending on "org-center" being defined.

(2) Add the CSS. It is at the bottom of this post. It is longish.

 

PART 2: A GENERIC PROCESS

(1) Insert the standard default templates this way:

Use the "HTML template" command: C-c C-e # h (or M-x org-export-insert-default-template RET html RET)

Then use the "default template" command: C-c C-e # d (or M-x org-export-insert-default-template RET default RET)

(2) Customize the inserted templates

Edit the options to match the current requirements. (Note: All of these options are listed in the "Org-Mode Manual".

Custom CSS Examples Using Org-Mode "Options"

Turn off the default "htmlize" styling:
#+OPTIONS: html-style:nil [ It is an option, but don't use it — see below. ]

Link to a custom CSS file:
#+HTML_HEAD:
#+HTML_HEAD_EXTRA:

Link to an external stylesheet:
#+HTML_HEAD:

Embed a 'style' section (such as the postamble problem):
#+HTML_HEAD:

Custom HTML Option Examples

Ensure that these are set, and manually add if needed, below the defaults
#+HTML_DOCTYPE: html5
#+HTML_CONTAINER: div

Manually add the following lines below the defaults and before the text to export. Ignore any obscure options inserted by 'default' and 'html'. These can be fine tuned with time and experience.
#+OPTIONS: html-style:t
#+OPTIONS: html-postamble:auto
#+OPTIONS: html-preamble:nil
#+OPTIONS: num:0
#+HTML_HEAD: [ Using the correct css path name ]
#+HTML_HEAD:
#+HTML_HEAD:

(3) Template Activation (optional).

Note: The export options are parsed and activated at only two times:

  • On startup (when the file is opened), or
  • Manually, by
    • Placing point on one of the template lines, and
    • Pressing C-c C-c

On success, the confirmation message is: "Local setup has been refreshed".

(4) Remove cruft from top of file.

For example, I include the following in my Org-Mode files:

  • org-to-html.org [ The filename. ]
  • #+STARTUP: hideblocks [ Controls the display of comment blocks and so on. ]
  • #+STARTUP: overview [ Controls the display of Org-Mode headings v content. ]

Change filename to "#+TITLE: <filename-or-title>" (whatever is right for a title).

Delete the other two

Etc.

(5) Run the export process (Org to HTML): "C-c C-e h h"

 

Custom CSS Follows:



/* CSS based on Derek Taylor DistroTube CSS
from https://distro.tube/org-html-themes/src/readtheorg_theme/css/readtheorg.css
*/

html{
font-size: 100%;
height: 100%;
overflow-x: hidden;
}

body{
background-color: #ffffff;
color: #000000;
font-family: "DejaVu Sans", Verdana, Arial, sans-serif;
font-weight: normal;
margin: 0;
min-height: 100%;
overflow-x: hidden;
}

#content{
background-color: #ffffff;
height: 100%;
margin-left: 15em;
padding: 1.618em 3.236em;
width: 80%;
}

.banner {
border-right: 94px solid #111111;
}

h1,h2,h3,h4,h5,h6,legend{
font-family: "DejaVu Sans", Verdana, Arial, sans-serif;
font-weight: bold;
margin: 1em 0;
}

h2,h3,h4,h5,h6{
border: 1px dotted #913e0b;
border-radius: 5px;
padding: .1em 0 .1em .1em;
}

h2,h3,h4,h5,h6{
background-color: #ffffff;
}


h1{ background-color: #913e0b;
margin: -.8em 0 0 -3em;
padding: .15em 0 .15em 0;
text-align: center;
width: 120%;
}

/* HEADERS */
h1{ color: #ffffff; }

h2{
margin-top: 2em;
background-color: #eeeeee;
color: #510048;
}

h3{
margin-top: 3em;
color: #133d58;
}

h4{
color: #164766;
}

h5{
color: #195074;
}

h6{
color: #1c5a82;
}

h1{ font-size: 2em; }
h2{ font-size: 2em; }
h3{ font-size: 1.7em; }
h4{ font-size: 1.4em; }
h5{ font-size: 1.1em; }
h6{ font-size: .9em; }

.subtitle{
font-size: 95%; /* 95% of h1 */
}

.title{font-size: 2em;} /* is also h1 anyway */

p{
font-size: 1em;
line-height: 1.25em;
margin: 0px 0px 24px 0px;
}

b,strong{
font-weight: bold}

blockquote{
color: #000000;
background-color: #dddddd;
border-left: 6px solid #ecbe7b;
font-style: italic;
line-height: 24px;
margin: 0px 0px 24px 0px;
padding: 8px 20px 2px 20px;
}

i{
color: #000000;
}

ul,ol,dl{
line-height: 24px;
list-style-image: none;
list-style: disc;
margin: 0px 0px 24px 0px;
padding: 0;
}

li{
margin-left: 24px;
}

dd{
margin: 0;
}

#content .section ul,#content .toctree-wrapper ul,article ul{
list-style: disc;
line-height: 24px;
margin-bottom: 24px}

#content .section ul li,#content .toctree-wrapper ul li,article ul li{
list-style: disc;
margin-left: 24px}

#content .section ul li p:last-child,#content .toctree-wrapper ul li p:last-child,article ul li p:last-child{
margin-bottom: 0}

#content .section ul li ul,#content .toctree-wrapper ul li ul,article ul li ul{
margin-bottom: 0}

#content .section ul li li,#content .toctree-wrapper ul li li,article ul li li{
list-style: circle}

#content .section ul li li li,#content .toctree-wrapper ul li li li,article ul li li li{
list-style: square}

#content .section ul li ol li,#content .toctree-wrapper ul li ol li,article ul li ol li{
list-style: decimal}

#content .section ol,#content ol,article ol{
list-style: decimal;
line-height: 24px;
margin-bottom: 24px}

#content .section ol li,#content ol li,article ol li{
list-style: decimal;
margin-left: 24px}

#content .section ol li p:last-child,#content ol li p:last-child,article ol li p:last-child{
margin-bottom: 0}

#content .section ol li ul,#content ol li ul,article ol li ul{
margin-bottom: 0}

#content .section ol li ul li,#content ol li ul li,article ol li ul li{
list-style: disc}

dl dt{
font-weight: bold;
}

dl p,dl table,dl ul,dl ol{
margin-bottom: 12px !important;
}

dl dd{
margin: 0 0 12px 24px;
}

code{
background:#bcff0f;
border: solid 1px #7bb231;
color: #000;
font-family: "Liberation Mono", monospace;
font-size: 90%;
max-width: 100%;
overflow-x: auto;
padding: 0 5px;
white-space: nowrap;
}

.codeblock-example{
border: 1px solid #e1e4e5;
border-bottom: none;
padding: 24px;
padding-top: 48px;
font-weight: 500;
background-color: #eeeeee;
position: relative;
}

.codeblock-example:after{
content: "Example";
position: absolute;
top: 0px;
left: 0px;
background-color: #eeeeee;
color: #000000;
padding: 6px 12px;
}

.codeblock-example.prettyprint-example-only{
border: 1px solid #e1e4e5;
margin-bottom: 24px;}

.codeblock,pre.src,#content .literal-block{
border: 1px solid #e1e4e5;
padding: 12px;
overflow-x: auto;
background: #eeeeee;
margin: 1px 0 24px 0;}

pre.src{
color: #000000;
display: block;
font-family: "Liberation Mono", monospace;
font-size: 12px;
font-size: 1em;
font-size: .9em;
line-height: 1.5;
margin: 1px 0px 24px 0px;
overflow: auto;
padding: 12px;
white-space: pre;
}

.example{
background:#f3f6f6;
border: 1px solid #e1e4e5;
color: #000000;
font-size: 1.15em;
line-height: 1.25;
margin-bottom: 24px;
padding: 12px;
}

table{
border-bottom: 1px solid #e1e4e5;
border-collapse: collapse;
border-spacing: 0;
empty-cells: show;
margin-bottom: 24px;
width: 100%;
}

td{
vertical-align: top}

table td,table th{
background-color: #eeeeee;
border: 1px solid #282c34;
font-size: 1em;
margin: 0;
overflow: visible;
padding: 8px 16px;
}

table thead th{
font-weight: bold;
border-top: 3px solid #51afef;
border-bottom: 1px solid #1c1f24;
}

table caption{
color: #000;
font: italic 85%/1 arial,sans-serif;
padding: 1em 0;
}

table tr:nth-child(2n-1) td{
background-color: #eeeeee;
}

table tr:nth-child(2n) td{
background-color: #eeeeee;
}

.figure p{
color: #000;
font: italic 85%/1 arial,sans-serif;
padding: 0px;
}

.rotate-90{
transform: rotate(90deg);
}

.rotate-270{
transform: rotate(270deg);
}

#toggle-sidebar, table-of-contents .close-sidebar { display: none; }

*{
box-sizing: border-box;
}

figcaption,figure,footer,header,hgroup,nav{
display: block}

ins{
background:#ff9;
color: #000;
text-decoration: none}

mark{
background:#ff0;
color: #000;
font-style: italic;
font-weight: bold}

small{
font-size: 85%}

sub,sup{
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline}

sup{
top: -0.5em}

sub{
bottom: -0.25em}

img{
-ms-interpolation-mode: bicubic;
vertical-align: middle;
max-width: 100%
}

svg:not(:root){
overflow: hidden}

figure{
margin: 0
}

label{
cursor: pointer
}

legend{
border: 0;
margin-left: -7px;
padding: 0;
white-space: normal
}

.nav #content .admonition-title,#content .nav .admonition-title,.nav .icon{
display: inline
}

.wy-alert,#content .note,#content .attention,#content .caution,#content .danger,#content .error,#content .hint,#content .important,#content .tip,#content .warning,#content .seealso,#content .admonitiontodo{
padding: 12px;
line-height: 24px;
margin-bottom: 24px;
}

.wy-alert-title,#content .admonition-title{
color: #000000;
font-weight: bold;
display: block;
color: #000000;
padding: 6px 12px;
margin-bottom: 0px;
}

#content .danger,#content .error{
background: #fdf3f2;
}

.wy-alert.wy-alert-warning,#content .wy-alert-warning.note,#content .attention,#content .caution,#content .wy-alert-warning.danger,#content .wy-alert-warning.error,#content .wy-alert-warning.hint,#content .wy-alert-warning.important,#content .wy-alert-warning.tip,#content .warning,#content .wy-alert-warning.seealso,#content .admonitiontodo{
background:#ffedcc;
}

#content .admonition-title.note:before, #content .admonition-title.seealso:before,
#content .admonition-title.warning:before, #content .admonition-title.caution:before,
#content .admonition-title.attention:before,
#content .admonition-title.tip:before, #content .admonition-title.hint:before,
#content .admonition-title.important:before,
#content .admonition-title.error:before, #content .admonition-title.danger:before{
font-family: "DejaVu Sans", Verdana, Arial, sans-serif;
content: "";}

#content .note,#content .seealso{
background:#e7f2fa}

.wy-alert p:last-child,#content .note p:last-child,#content .attention p:last-child,#content .caution p:last-child,#content .danger p:last-child,#content .error p:last-child,#content .hint p:last-child,#content .important p:last-child,#content .tip p:last-child,#content .warning p:last-child,#content .seealso p:last-child,#content .admonitiontodo p:last-child{
margin-bottom:0}

#content .admonition-title.tip,#content .admonition-title.important,#content .admonition-title.hint{
line-height: 1;
background-color: #ffffff;
}

#content .important,#content .tip,#content .hint{
background: #dbfaf4}

#content .admonition-title.note,#content .admonition-title.seealso{
line-height: 1;
background: #6ab0de}

#content .admonition-title.warning,#content .admonition-title.caution,#content .admonition-title.attention{
line-height: 1;
background: #F0B37E}

#content .admonition-title.error,#content .admonition-title.danger{
line-height: 1;
background: #f29f97}

legend{
display: block;
width: 100%;
border: 0;
padding: 0;
white-space: normal;
margin-bottom: 24px;
font-size: 150%;
*margin-left: -7px}

label{
display: block;
margin: 0 0 0.3125em 0;
color: #333;
font-size: 90%}

a{
color: #0000ff;
text-decoration: none;
cursor: pointer;}

a:hover, a:active{
outline: 0;
font-style: normal;
padding: .1em .3em .1em .3em;
}

a:visited{
color: #777777;
}

a:hover{
color: #ffffff;
background-color: #dd0000;
}

.org-left a {
color: #51afef;
}

.left{
text-align: left;}

.center{
text-align: center;}

.right{
text-align: right;}

hr{
display: block;
height: 1px;
border: 0;
border-top: 1px solid #000000;
margin: 24px 0;
padding: 0;
}

#table-of-contents li{
list-style: none;
margin-left: 0px;
}

#table-of-contents header{
color: #2980B9;
display: block;
display: inline-block;
font-size: 80%;
font-weight: bold;
height: 32px;
line-height: 32px;
padding: 0 1.618em;
text-transform: uppercase;
white-space: nowrap;
}

#table-of-contents ul{
margin-bottom: 0;}

#table-of-contents li.divide-top{
border-top: solid 1px #404040;}

#table-of-contents li.divide-bottom{
border-bottom: solid 1px #404040;}

#table-of-contents li.current{
background:#e3e3e3;}

#table-of-contents li.current a{
color: #000000;
border-right: solid 1px #c9c9c9;
padding: 0.4045em 2.427em;}

#table-of-contents li.current a:hover{
background-color: #dd0000;
color: #cccccc;
color: #ffffff; /* changed 2021-11-29 */
}

#table-of-contents li a{
border: none;
color: #dddddd;
color: #ffffff; /* changed 2021-11-29 */
position: relative;
}

#table-of-contents li.on a:hover, #table-of-contents li.current>a:hover{
background:#fcfcfc;}

#table-of-contents li ul li a{
padding: 0.4045em 2.427em;}

#table-of-contents li ul li ul li a{
padding: 0.4045em 3.236em;}

#table-of-contents li.current ul{
display: block;}

#table-of-contents .local-toc li ul{
display: block;}

#table-of-contents li ul li a{
margin-bottom: 0;
color: #cccccc;
color: #dddddd; /* changed 2021-11-29 */
font-weight: normal;
}

#table-of-contents a{
display: inline-block;
line-height: 18px;
padding: 0.4045em 1.618em;
display: block;
position: relative;
font-size: 90%;
color: #000000;
direction: ltr;
}

#table-of-contents a:hover{
background-color: #dd0000;
background-color: #20638f; /* changed 2021-11-29 */
color: #ffffff;
cursor: pointer;
font-style: normal; /* changed 2021-11-29 */
font-style: italic;
}

/* TOC main: the whole sidebar */
#table-of-contents{
background-color: #913e0b;
font-size: .9em; /* toc table-of-contents font-size */
height: 100%;
left: 0;
overflow-x: hidden;
overflow-y: scroll;
position: fixed;
scrollbar-arrow-color: #b3b3b3;
scrollbar-base-color: #1F1D1D;
scrollbar-shadow-color: #1F1D1D;
scrollbar-track-color : #343131;
top: 0;
width: 17em;
}

/* TOC header label */
#table-of-contents h2{
background-color: #20638f;
color: #ffffff;
display: block;
font-size: 100%;
margin-bottom: 1em;
margin-top: -.3em;
padding: 1.18em;
text-align: center;
}

ul.nav > li ul {
display: none;
}

li.active {
background-: #e3e3e3;
}

li.active>a {
color: black !important;
}

ul.nav>li.active a {
color: #404040 !important;
}

ul.nav>li.active li.active {
background-color: #c9c9c9;
}

ul.nav>li.active li.active>a {
color: black !important;
border-right: solid 1px #c9c9c9 !important;
font-weight: bold !important;
display: block !important;
}

ul.nav>li.active>a {
background-color: #fcfcfc;
color: black !important;
border-bottom: solid 1px #c9c9c9 !important; /* XXX Restrict it to 2nd level (dave sez no idea - not mine)*/
border-right: solid 1px #c9c9c9 !important;
font-weight: bold !important;
display: block !important;
}

li.active>ul {
display: inline !important;
}

footer{
color: #000000;

footer p{
margin-bottom:12px}

#content img{
max-width: 100%;
}

#content div.figure{
padding: 0px;
margin-bottom: 18px}

#content div.figure.align-center{
text-align: center}

#content .section>img,#content .section>a>img{
margin-bottom: 24px}

.verse{
border-left: 5px solid #6AB0DE;
background-color: #E7F2FA;
padding: 6px 20px;
font-style: italic;
}

#content .note .last,#content .attention .last,#content .caution .last,#content .danger .last,#content .error .last,#content .hint .last,#content .important .last,#content .tip .last,#content .warning .last,#content .seealso .last,#content .admonitiontodo .last{
margin-bottom: 0}

#content .admonition-title:before{
margin-right: 4px}

#content .section ol p,#content .section ul p{
margin-bottom: 12px}

#content h1 .headerlink, #content h2 .headerlink, #content h3 .headerlink, #content h4 .headerlink, #content h5 .headerlink, #content h6 .headerlink, #content dl dt .headerlink{
display: none;
visibility: hidden;
font-size: 14px}

#content h1 .headerlink:after, #content h2 .headerlink:after, #content h3 .headerlink:after, #content h4 .headerlink:after, #content h5 .headerlink:after, #content h6 .headerlink:after, #content dl dt .headerlink:after{
visibility: visible;
content: "";
font-family: "DejaVu Sans", Verdana, Arial, sans-serif;
display: inline-block}

#content h1:hover .headerlink, #content h2:hover .headerlink, #content h3:hover .headerlink, #content h4:hover .headerlink, #content h5:hover .headerlink,#content h6:hover .headerlink, #content dl dt:hover .headerlink{
display: inline-block}

#content .sidebar{
float: right;
width: 40%;
display: block;
margin: 0 0 24px 24px;
padding: 24px;
background: #f3f6f6;
border: solid 1px #e1e4e5}

#content .sidebar p,#content .sidebar ul,#content .sidebar dl{
font-size: 90%}

#content .sidebar .last{
margin-bottom: 0}

#content .sidebar .sidebar-title{
display: block;
font-family: "DejaVu Sans", Verdana, Arial, sans-serif;
font-weight: bold;
background: #e1e4e5;
padding: 6px 12px;
margin: -24px;
margin-bottom: 24px;
font-size: 100%}

#content .highlighted{
background: #F1C40F;
display: inline-block;
font-weight: bold;
padding: 0 6px}

#content .footnote-reference,#content .citation-reference{
vertical-align: super;
font-size: 90%}

span[id*='MathJax-Span']{
color: #404040}

.math{
text-align: center}

#footnotes{
border-top: 1px solid #e1e4e5;
padding-top: 36px;
}

h2.footnotes{
display: none;
}

.footnum, .footref{
color: #2980b9;
font-size: 90%;
font-family: "DejaVu Sans", Verdana, Arial, sans-serif;
}

.footnum:before, .footref:before{
content: "[";
}

.footnum:after, .footref:after{
content: "]";
}

.footpara {
color: #000000;
font-size: 90%;
font-family: "DejaVu Sans", Verdana, Arial, sans-serif;
padding-bottom: 8px;
padding-left: 16px;
padding-right: 16px;
padding-top: 8px;
line-height: 1.25em;
}

.todo{
background-color: #f29f97;
padding: 0px 4px;
color: #000000;
}

.WAIT, .nilWAIT{
background-color: #6AB097;
}

.done{
background-color: #6ab0de;
padding: 0px 4px;
color: #000000;
}

.tag span {
background-color: #EDEDED;
border: 1px solid #EDEDED;
color: #000000;
cursor: pointer;
display: block;
float: right;
font-size: 80%;
font-weight: normal;
margin: 0 3px;
padding: 1px 2px;
border-radius: 10px;
}

.tag .FLAGGED {
background-color: #DB2D27;
border: 1px solid #DB2D27;
color: #000000;
font-weight: bold;
}

.timestamp {
font-family: "Liberation Mono", monospace;
font-size: 90%;
color: navy;
}

.nav .timestamp {
color: inherit;
}

.inlinetask {
background: #FFF9E3;
border: 3px solid #FFEB8E;
padding: 9px 12px;
margin-bottom: 24px;
font-family: "DejaVu Sans", Verdana, Arial, sans-serif;}

 

 

The Postamble.

This is a sort of housekeeping summary. Time, date, author, and so on. I had trouble getting it to show up, so I wrote more CSS for it.

It has a counterpart, the "preamble", which is the same and which, I guess, normally goes at the top of the exported file.

The preamble is not interesting to me, so I focus on the postamble.

 

#postamble {
color: #555555;
font-family: "Liberation Mono", monospace;
font-size: .9em;
font-weight: bold;
margin: 0 0 1em 20em;
}

#postamble p {
margin: 0;
padding: 0;
}

 

 


See tabs at the top for definitions and books.
Have anything worth adding? Then try sosayseff+nosey@nullabigmail.com
Me? Still confused about everything. (The usual.)

Monday, November 22, 2021

I Will Now Say This About That

Am still plugging away at a system for producing documentation using Emacs' Org-Mode. Fun.

But not easy, I'll tell you. And maybe not fun either.

Everyone says (all the Emacsters anyhow) that there is lots of great documentation available for anyone who wants to run riot in the fields of Emacs. Sure. Right. Like, totally.

And there is a lot there, but it's mostly useless. Emacs documentation suffers from severe Nerd Syndrome — it is useless unless you already understand the subject. Just like man pages.

Try reading a man page to find out what's what and why and where and when and how to do just One Simple Thing. Then write down all you've learned. If you are an actual human you will take your pencil and sheet of paper and try to kill one with the other, while swearing, a lot. This stuff can't be deciphered. It's good only if you already know it and only need to refresh your memory on the details.

Same with the "GNU Emacs Manual" "The Org Manual" "Worg, the Org-Mode Community" and so on. All of them. Crazy shit. All crazy shit. Endless gibberish. But don't bother mentioning it to anyone. They'll only put you down or (maybe better/maybe worse) will just ignore you and go back to their secret playpens and decoder rings.

This stuff takes a lifetime of commitment. People do amazing things with Emacs but it takes a lifetime of commitment. You have to go all-in, warp your brain, destroy your life, do nothing else forever, and then you'll end up with a thousand new lines of elisp to add to your personal init.el file to make Emacs do that One Crazy Thing that you can't live without.

Then you can write about it. And share your code. And no one else will be able to run it without severe customizing, so they'll all write their own version, and share their code, and yea, it shall propagate unto the ends of the earth. But all of us humans who just want to do a thing or two will remain in the darkness because of ye olde WTF Principle.

I'm a newbie. I've been using Emacs only 25 years, so go ahead, write me off, dismiss me, laugh loudly and long. I'm only now finding value in Org-Mode and hope to figure out how to export my damn notes to damn HTML for a more readable form of damn documentation that can't be accidentally edited via damn finger fumbling while only trying to read it, and yes, I have been having some fun because I am making some progress. Finally.

I can do all the formatted writing I want, and have the CSS I need almost ready, and for my basic use cases I can now export my notes and get a decent result, but progress has been on the order of one small issue solved per day, so it is slow.

Yesterday, for example, I found out how to get Org to export levels "*" through "******" as "h1" through "h6", instead of "h1" through "h4", plus ordered lists for all deeper levels. Woot.

OK, fine, but I've been hunting for an answer to this for over a week. I found a hint in the documentation for the "default" export options, where it said something to the effect that the "H" option could be set to mumble mumble mumble something mumble mumble, so I guessed and tried "#+OPTION H:6" and it actually worked. Good guess for once, but it was only a guess. A hunch. A flying leap. Something that couldn't hurt. And not obvious in any way.

So why the hell was the Org-Mode HTML exporter not set to produce that result by default? Why not? And why was this not clearly documented, with a clear example?

No. Emacs has lousy documentation. Lots of extremely detailed lousy documentation. If I didn't use Emacs for writing and jotting down my notes about various things I wouldn't bother, but it's the best editor I've ever used. For writing.

I can cut and paste blocks of text, generate columns when I rarely need to do columns, open multiple views of a single file, insert tidy tables at will, and lots of other cool things that are available by default. "Dired" is worth it all by itself. That's a major time-saver right there, and I truly love a lot of what Emacs can do, but go one millimeter too deep and you're in an alternate reality with no way home.

So poop on it.

As I said, I'm close to getting enough of Org-Mode and HTML exporting figured out, along with some really nice CSS to match, that it will be worth it, I think. Since I already use Emacs all day, every day, and am comfortable using Org-Mode for organizing my notes, it will pay to stay on this crazy train. I hope.

I was going to try out Sphinx and AsciiDoc just to compare them to what Emacs and Org-Mode can do, but I don't think it's worth it at this point. If Emacs and Org-Mode can meet my needs, then that's fine. As I said, I already use Emacs, and Org-Mode is simple, I know it, and the only hurdle is exporting. Once I understand exporting and have it working to my satisfaction, I'm home free. There is no point in installing, learning, and configuring new software that uses different markup, as far as I can tell now.

And I will be glad when I've reached that point. Maybe in a week. All I want to do is to export some of my personal notes to HTML for my own use. I can hope, can't I? Please?

 


Have anything worth adding? Then try sosayseff+nosey@nullabigmail.com
Me? Recently had a near-defenestration experience.

Saturday, November 13, 2021

Org Exporting & CSS

I'm getting closer. Slowly.

Been dinking around with Emacs org-mode exporting and making it look decent with CSS.

Although I was inspired by Sphinx, and will check it out, I decided to start with Emacs' org-mode and see if I could style that adequately. I use Emacs every day, using Org-mode is simpler than switching to reStructuredText, and if I can stay with Emacs, I don't have to learn another tool.

But, although it's easy to write using org-mode, and dead simple to export from it to HTML, the world of styling that HTML with CSS is hellishly crude.

There is nothing wrong with using the rudimentary styling that exporting from org-mode produces, except that it hurts to look at it. Totally functional in the same way that bolting iron plates together is a functional way to make a boat. It works if you do it right, but it's neither pleasant to look at nor easy to live with.

There is a "Projects using Sphinx" page with lots of examples.

"PyEMD" is a good example: clean, uses the default theme, readable, totally fine.

And we do have a couple of Emacs projects that use themes based on this, but they are hard to track down and not exactly easy to figure out. I'm basically documenting what I've found so I don't lose it all somehow.

(1) DISTRO.TUBE This is what I like best

DistroTube.com is a site created by Derek Taylor [DT], creator of the DistroTube [DT] video channel on YouTube and Odysee [LBRY]. I create videos about GNU/Linux, free software, open source software and related interests. This site was created in Emacs and written in Org Mode. I use Org Export to convert the “org” files into HTML, and I based the design on the popular “ReadTheOrg” theme from Org-HTML-Themes

It has two themes, and offers the CSS for both: htmlize and readtheorg

(2) FNIESSON is up next: "How to export Org mode files into awesome HTML in 2 minutes". This was apparently the inspiration for DistroTube

Though you can easily override CSS stylesheets and add your own HTML themes, we can say (or write) that Org mode provides a /basic/ HTML support. Org-HMTL themes is an open source framework for providing you with a list of very nice (cross-browser) themes for all your Org documents. Use them to style your docs, and your colleagues will come up to tell you that you are a genius!

OK, fine, but not quite there is what I think. fniessen

(3) GONGZHITAAO For me this is a relatively minor contribution, though I'm glad it's there. Everything helps. I'm willing to learn from anyone and everyone, and I'm grateful that they've shared.

Start at Living in Emacs.

He has a demo page, with a presence on at GitHub as well, where you can grab the CSS ("Simple and clean CSS for Org-exported HTML").

(4) JESSEKELLY881 CSS here. See it in action at Imagine, with the CSS here. And there is another view at Rethink.

(5) JUAN JOSÉ GARCÍA RIPOLL He has A CSS Stylesheet For Exporting Org-Mode Files. I'm guessing that the page you get to is the result of his CSS, which is directly accessible at this location.

(6) NORANG Org Mode - Organize Your Life In Plain Text! is famous among Emacs users. I can't say that I'm nuts about the theme he (Bernt Hansen) uses, but it's functional and it's there. I did use his HTML as a sort of test bed to help tune what will be my CSS. You can find his CSS here.

(7) ORG-SPEC This is another example. Can't say that I'm ecstatic, but it's better than I could have done at this stage. I'm keeping the links for future reference because no matter what, I always have more to learn. See "Document", the CSS is also directly accessible here.

At GitHub, see thi-ng. See the info on THOMASF, below, where you can get access to "solarized-dark.css" and "solarized-light.css"

(8) MOWEN I don't know of a sample page, but the CSS is available at GitHub.

(9) NEILSEN See Emacs org-mode examples and cookbook. Not wildly lovely according to me, but it's there and I'm once again grateful. CSS is directly accessible here.

(10) SAKURA See sakura demo, and GitHub - oxalorg_sakura. "Sakura: a minimal classless css theme. Just drop it in and watch the websites blossom!"

There is an example website using sakura: ComputableVerse. And the CSS is directly accessible here.

(11) THOMASF See solarized-css. "To provide general solarized light and dark colorshcemes for HTML documents that mostly relies on standard HTML elements."

Examples and more info are at Github - solarized-css. Directly access the CSS (light) and (dark). And see the HTML test page.

 


See tabs at the top for definitions and books.
Have anything worth adding? Then try sosayseff+nosey@nullabigmail.com
Me? Caught picking my nodes again. Embarrassing, as always.

Saturday, November 6, 2021

Orgling These Days

So I'm plugging at it, plugging along, plugging holes in my ignorance, plugging them with clumps of knowledge.

I've recently been fairly deeply into "The Org Manual", Release 9.4. I went through the whole thing, taking notes (in org-mode) on whatever looked useful and what did not look too impossibly confusing and deep and possibly never useful.

Yesterday I read that Richard Stallman once read "The Org Manual" and from it could not figure out what org-mode was, or how to use it, so I'm reassured. There is a lot to it, and it can get impossibly confusing.

It is easy to create a document consisting of notes with various heading levels, some quotes, some links, maybe a table or two, some code samples, and so on, and then to export that from org-mode to HTML. No probs.

What I'm currently trying to do is to find styling for that HTML.

Because org-mode for Emacs has been around since 2003, one would assume that there would be a host of themes and CSS files for styling the exported HTML. But nope. Unlike the usual rat's nest of interlocking, mutually-interdependent modes, modules, add-ons, and configuration files needed to get anything working in Emacs, styling HTML exported from org-mode is an almost empty category.

I have found a few resources, but all of them are clunky and will be inconvenient to use. I do have enough to work with though, enough to cover my needs, for the basics, but it will still be goofy going forward.

At least for now. The future, as always, will have to take care of itself.

I got started in this direction by one day discovering Sphinx. Sphinx was developed by and for the Python community to generate, convert, and display documentation in easily-readable formats.

At least for me though, for now though, Sphinx seems too involved. I'm using Emacs for most of my work, and if I can generate decently-styled HTML from the text files I create, I'm OK with that. Even if I have to keep things over toward the really simple end of the scale. I'm not sure that I need to do that, but maybe. And if I stick with Emacs, I don't need to add another tool set and learn all its quirks, foibles, and foolish dead ends.

I want to ease into this, and can add the whells and bissles later, when I know how to spell them and all such-like, and do Feel A Great Need.

And, oddly enough, the best CSS I've found so far is what has been taken from Sphinx and converted to be used with org-mode. Oddly enough, and strangely, given the age of Emacs (45 years) and org-mode (18 years).

But the Emacs world is not like that. The Emacs world is full of half-finished dream projects all piled up together in one tangled endless mass just daring you to come looking, lying in wait for the innocent, steaming with promises, choked with nippers and stingers and sticky webs. Some people get things working and others don't. I'm mostly in the second category. Getting too deeply into Emacs eventually means that you will devote 100% of your time to it, and that you can never again return to the surface.

So anyway.

A couple of weeks back I was seriously wondering if I should devote any time at all to continuing with org-mode and HTML and styling at all, and found in my saved files a copy of "Org Mode Is One of the Most Reasonable Markup Languages to Use for Text" by Karl Voit, and changed my mind. I'll stick with org-mode for now.

Voit compares org-mode to Mmarkdown, reStructuredText, AsciiDoc, Wikitext, and some others, like Markdown Extra, MultiMarkdown, GitHub Flavored Markdown, and CommonMark.

He concludes that org-mode

  • is intuitive, easy to learn and remember
  • is standardized
  • is consistent
  • can be easily typed
  • makes sense outside of Emacs
  • has excellent tool support (within Emacs)

That is, he concludes (in case you came in late), that org-mode is the all-around bestest.

Maybe, maybe not, but since I already use Emacs daily and already use org-mode daily, and can simply and quickly export HTML, and that I think that I have found a not-terrible way to style the HTML that I export from org-mode in a not-terrible-looking way, I'm pretty well set for the present.

So I'll check out Sphinx in a week or two just so I know what it is, and then I'll get on to re-learning the rest of what I want to re-learn, if I can remember what the hell that was.

 

Refs:
The Org Manual
Richard Stallman
Org-mode
Emacs
Sphinx
Python
Org Mode Is One of the Most Reasonable Markup Languages to Use for Text

 


Have anything to add? Then email sosayseff+snorp@nullabigmail.com
Me? Frantically trying to get my nose hairs under control. Yet again.