Wednesday, January 19, 2022

It's About Time

So far it's working.

I'm timing myself.

I have a giant todo list that has its own pet todo lists, and sometimes they fight. Sometimes not, but anyway it's a real mess, and mostly I have been ignoring it except to add more things and feel guilty about it all. That's unproductive.

Really, though, I don't need to be productive. I answer to no one no more, nohow, aside from paying my rent on time. Once I do that I can go back to trimming my nose hairs and napping, but. But. But it ain't a life, and I need one.

So one thing I'm doing is sitting here with the intention of relearning/seriously learning "Computer Science", that mis-named discipline. For something to do. Because when you get to the point that you don't need to have anything to do, you do. Life has to have a purpose of some kind, so I invented one. It's a thing. Lots of people find out about it once they've reached their goal in life. "So what now, eh?" You need something. You can't just stand there and wait.

I heard an interview with John McPhee not that long ago, in which he said that he's got a project started that will out live him, that when you get to a certain age and a certain mostly-independent time of life, you need that. Something monumental, a mission that gives you something to struggle with and against. Something that you can't possibly finish in the time you have. So you can feel right and proper about yourself and about life.

What you do is to find something you are seriously interested in, and commit, and see if you can, in any way possible, complete the task even though it's impossible. That way you never need to worry about what you're going to do today or why you're still here, or what the meaning of life is, or whether you should have a third beer with lunch and sleep away yet another afternoon because now you have A Plan and can't get away with aimless drifting any more. You have a goal, a mission, a purpose, a challenge.

Stuff like that.

And then I saw Plan, do, learn: My admittedly hardcore work routine
by Channing Allen. Bingo. Now I've got a thing. A mission and a thing. A thing that has been helping me to have fun and also to be focused. So far it's working.

Every day, instead of looking at my todo list and feeling that it's becoming more and more like a predator and more like I'm the prey, I decide on three or four things that Must Get Done today if I'm to have any self-respect and deal with whatever it is that needs attention, and not just my personal goal-things, but things that really do need attention. (Taxes, voting, other financial items, and so on.)

So I decide on several of today's things, guess how long they'll take, and set aside time. For things that cannot possibly be finished today, I at least will have scheduled a definite amount of work time to devote to them.

Then I start.

I pick one item and set a timer. I see how far I can get in the amount of time I have, and when the timer goes off I stop. Stop and take a break and go on to the next thing, and, and. And I'm getting more done, and making more progress on those things that can't get done today but which need attention.

OK so far. Worth a look.

 


See tabs at the top for definitions and books.
Have anything worth adding? Then try sosayseff+nosey@nullabigmail.com
Me? Bought a three-stringed nose. Planning on taking up picking.

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.)