Website objective 9: backlog files to website
Started
Table of Contents
- DONE Strategize
- DONE Gather source files
- DONE Create new final fines directory within source SEGMENT directory (later, deleted it)
- DONE Should I fully preserve the NOTES-CURRENT dir? Online, yes, because when you need Latex source, you can easily grab it.
- DONE Should I rename them? Only in bulk, in emacs, if it makes sense to bother, later.
- DONE Should I be copying tnhem or moving them? Most will be downloaded [maybe not]. html should be copied.
- DONE Do these data match the current Libsyn RSS? Wrong question; Libsyn is SOT; download files, don’t copy them. [Except you can’t do this for Margin, MP, so you might as well develop a universal local approach.]
- DONE Notes feed is incomplete, only goes back to Re24; fixed.
- DONE Decide file-gathering methodology for non-Libsyn feeds. One segment at a time.
- DONE Why is this so difficult? Because my final files are not all in SEGMENTS, and I wasn’t systematic.
- DONE Where are the file? In SEGMENTS and [FINAL FILES] or whatever, on the MM.
- DONE Get [FINAL FILES] on laptop. Actually, got them on external drive
ft1
. - DONE Should you get everything on a simple storage server (DO), a la S3 buckets? Nah, see next.
- DONE Where should I store my files? The video will eventually die at scale. Nah, see next.
- DONE Can I point nginx Re1.mp4 to another server? Nah, see next.
- DONE More simply, can I put a YouTube URL in my nginx Index of Re600? I think the way is an html file for the videos that redirects to wherever. Nah, see next.
- DONE But 20min of video is only 133 MB (7MB/min). Do I really need to store video offsite? Or only today’s, and then archives (which get downloaded much less) are all local? That’s the way.
- DONE So where are the [FINAL FILES]? Some are in
otherfiles
. I need to get 180GB onto my laptop. It’s the only clean way. - DONE Get
RETRAICE-archive
onto laptop.
- DONE Decide html (generation or fix-up) for Re1–N which were never properly generated. One segment at a time.
- DONE Decide NOTES-CURRENT source files vetting method. One segment at a time.
- DONE make this doc published on website
- DONE make LOGBOOK publishable
- DONE Make the
#+SETUPFILE
work - DONE Make zsh terminal structure blocks export with syntax highlighting / colorization. Done, using
script
.- DONE State the objective: syntax highlighting / colorization of shell i/o in
org
andhtml
export. - DONE get a major mode in
emacs
that syntax highlights / colorizeszsh
blocks the way I want. I don’t think this is doable. - DONE map that major mode to a string in Easy Customization
Org Src Lang Modes
. Not doing this; see previous. - DONE New approach: Use external tool to convert
zsh
i/o to html, then paste that intoorg
file. Didn't work. - DONE How are others doing it?
- DONE Fiddling
- DONE This gets colorizing in emacs, but not export.
- DONE Does this manually applied colorization get color in export? No.
- DONE Can I get colorized html from the
```console
inmarkdown
mode? Not really, even in Github webapp (not shown below). - DONE Sanity check: Let it go? What is the purpose?
- DONE Let's try
ansifilter
andhighlight
again. Done, and later for LaTeX. - DONE Oooh,
script
! - DONE How to fix ugly
script
capture ofzsh
auto-complete / suggestions? Drop down tobash
. - DONE Downsides: I have to
alias
andbash
to do it, and the raw file contents in myorg
are html, not text, which will cause problems with LaTeX exports. But still, it looks good published. - DONE Can I
ansifilter
to LaTeX? Yes! - DONE Maybe I should try
highlight
with my own language definition. Maybe later.
- DONE State the objective: syntax highlighting / colorization of shell i/o in
- DONE set
nginx
config to indexprojects
directory - DONE modify and run publishing process with this project doc in tow.
- DONE Is there a security concern with the
<script>
functionality of these html export blocks? - DONE Can I convert the scripty html static html easily? Not that I’ve found.
- DONE What I really care about is the directory movement. Easy to kill that? Yea, just delete the links. Done.
- DONE Do relative symlinks work on webserver after
rsync -l
(included by-a
)? Yes! - DONE Get time, date, templates working better for publication.
- DONE Get org html preamble modified date to show timezone
- DONE sort out css and setupfile structure
- DONE change face of preamble and postamble to be more background
- TODO miscellaneous stuff
- DONE get old blog post on power map (12) on website
- DONE fix rss that keeps updating PA: https://retraice.com/feeds/public.xml
- DONE blank [rectangle] character in preamble
- DONE Get all CSS out of documents and into CSS files
- DONE the css file is being injected into static html page at export, so updates won’t automatically propagate
- NEXT Simplify setup of
setup
andstyle
files to be more comprehensible. - TODO Find a workable centering CSS method
- TODO fix mobile margins
- TODO logbook lines look wrong in Chrome mobile
- TODO fix the
UP
button; it should make sense, or get removed, but what is my solution to navigation? - TODO fix image size problems with desktop vs. mobile on https://retraice.com/blog/12.html
- TODO Does this (that symlinks for mp3/mp4s work, see above) mean that I can/should put larger files (mp3s, mp4s) in their own dir on the website, for scale management later?
- TODO Also: does my idea of cloning the website N times and putting them all behind a load balancer really scale?
- TODO Check nginx config
- get blog on website
- WAIT Gather files
- WAIT Clean up YouTube channels
- Fun stuff ahead
- LOGBOOK 9-backlog
DONE Strategize
DONE Gather source files
Several days ago, I pulled the source SEGMENT directories for Re1–Re5, so I could work on them on my laptop.
DONE Create new final fines directory within source SEGMENT directory (later, deleted it)
Now I’ve created a Re1 directory with Re1-SEGMENT, and copied in (from
SCRIPTS-OUTPUT
) the following
files:
➜ 2024-09-03-Tue-12:37:35-jmbpmhn Re1-SEGMENT $ la total 40 -rw-r--r--@ 1 jeffre staff 8.0K Aug 27 06:20 .DS_Store drwxr-xr-x 3 jeffre staff 96B Dec 12 2022 ACTUAL -rw-r--r-- 1 jeffre staff 744B Jan 11 2021 Copy-Pasted-Markers.txt drwxr-xr-x 4 jeffre staff 128B Aug 27 06:20 FCP drwxr-xr-x 6 jeffre staff 192B Aug 27 06:20 LOGIC drwxr-xr-x 11 jeffre staff 352B Apr 8 2023 NOTES-CURRENT drwxr-xr-x 7 jeffre staff 224B Sep 1 13:05 Re1 -rw-r--r-- 1 jeffre staff 2.0K Dec 12 2022 Re1-Vitals.sh drwxr-xr-x 62 jeffre staff 1.9K Apr 8 2023 SCRIPTS drwxr-xr-x 15 jeffre staff 480B Nov 4 2023 SCRIPTS-OUTPUT drwxr-xr-x 44 jeffre staff 1.4K Apr 8 2023 SCRIPTS-as-of-2022-12-12--18-59-07 drwxr-xr-x 15 jeffre staff 480B Apr 8 2023 archive ➜ 2024-09-03-Tue-12:37:38-jmbpmhn Re1-SEGMENT $ tree Re1 Re1 ├── FINAL---PDFLibsynShownotes.txt ├── FINAL---mp3LibsynNotes--FOR-LYRICS.txt ├── FINAL---mp3LibsynNotes--FOR-YOUTUBE.html ├── Re1-NOTES.pdf └── Re1.mp3 1 directory, 5 files ➜ 2024-09-03-Tue-12:37:49-jmbpmhn Re1-SEGMENT $
Actually,
, I’m going to delete this directory, because I haven’t decided source of truth yet.
Now it looks like this again, with the files moved to ~/.Trash
:
➜ 2024-09-04-Wed-13:29:12-jmbpmhn Re1-SEGMENT $ la total 40 -rw-r--r--@ 1 jeffre staff 8.0K Aug 27 06:20 .DS_Store drwxr-xr-x 3 jeffre staff 96B Dec 12 2022 ACTUAL -rw-r--r-- 1 jeffre staff 744B Jan 11 2021 Copy-Pasted-Markers.txt drwxr-xr-x 4 jeffre staff 128B Aug 27 06:20 FCP drwxr-xr-x 6 jeffre staff 192B Aug 27 06:20 LOGIC drwxr-xr-x 12 jeffre staff 384B Sep 4 13:01 NOTES-CURRENT -rw-r--r-- 1 jeffre staff 2.0K Dec 12 2022 Re1-Vitals.sh drwxr-xr-x 62 jeffre staff 1.9K Apr 8 2023 SCRIPTS drwxr-xr-x 15 jeffre staff 480B Nov 4 2023 SCRIPTS-OUTPUT drwxr-xr-x 44 jeffre staff 1.4K Apr 8 2023 SCRIPTS-as-of-2022-12-12--18-59-07 drwxr-xr-x 15 jeffre staff 480B Apr 8 2023 archive ➜ 2024-09-04-Wed-13:29:27-jmbpmhn Re1-SEGMENT $ tree ~/.Trash/Re1-deletable-copies /Users/jeffre/.Trash/Re1-deletable-copies ├── FINAL---PDFLibsynShownotes.txt ├── FINAL---mp3LibsynNotes--FOR-LYRICS.txt ├── FINAL---mp3LibsynNotes--FOR-YOUTUBE.html ├── Re1-NOTES.pdf └── Re1.mp3 1 directory, 5 files ➜ 2024-09-04-Wed-13:29:35-jmbpmhn Re1-SEGMENT $ ➜ 2024-09-04-Wed-13:29:35-jmbpmhn Re1-SEGMENT $ la SCRIPTS-OUTPUT total 98976 -rw-r--r-- 1 jeffre staff 13K Jan 17 2021 FINAL---PDFLibsynShownotes.txt -rw-r--r-- 1 jeffre staff 6.4K Jan 24 2021 FINAL---mp3LibsynNotes--FOR-LYRICS.txt -rw-r--r-- 1 jeffre staff 6.4K Jan 24 2021 FINAL---mp3LibsynNotes--FOR-YOUTUBE.html drwxr-xr-x 23 jeffre staff 736B Apr 8 2023 ID3-build-and-add-STEPS -rw-r--r-- 1 jeffre staff 744B Jan 5 2021 Markers--FINAL.txt drwxr-xr-x 48 jeffre staff 1.5K Apr 8 2023 Markers-From-ProjectData-STEPS drwxr-xr-x 111 jeffre staff 3.5K Apr 8 2023 Output-Checks-STEPS -rw-r--r-- 1 jeffre staff 24M Jan 5 2021 Re1--test-more-shownotes.mp3 -rw-r--r-- 1 jeffre staff 612B Dec 12 2022 Re1-Macros-for-LaTeX.txt -rw-r--r--@ 1 jeffre staff 179K Jan 26 2021 Re1-NOTES.pdf -rw-r--r-- 1 jeffre staff 24M Jan 26 2021 Re1.mp3 drwxr-xr-x 76 jeffre staff 2.4K Apr 8 2023 Show-notes-build-STEPS -rw-r--r-- 1 jeffre staff 33B Dec 12 2022 ShowFullTitleForVitalsID3py.txt ➜ 2024-09-04-Wed-13:30:53-jmbpmhn Re1-SEGMENT $
DONE Should I fully preserve the NOTES-CURRENT dir? Online, yes, because when you need Latex source, you can easily grab it.
- CON: you’ll have to vet the files, in case there’s not-for-public comments in them
- PRO: with time, anything not on the web is lost or inaccessible
- PRO: others can benefit from your Latex and other source code
- PRO: the easiest thing is just to put up the source files
DONE Should I rename them? Only in bulk, in emacs, if it makes sense to bother, later.
DONE Should I be copying tnhem or moving them? Most will be downloaded [maybe not]. html should be copied.
DONE Do these data match the current Libsyn RSS? Wrong question; Libsyn is SOT; download files, don’t copy them. [Except you can’t do this for Margin, MP, so you might as well develop a universal local approach.]
- size
- meta dates
DONE Notes feed is incomplete, only goes back to Re24; fixed.
Looks like it might be because I published nothing in 2021; now testing by publishing "test-2021" on July 1, 2021 in Libsyn webapp; nope; emailed helpdesk
. Received reply, my settings are at max 100 episodes (I looked for this, ugh).DONE Decide file-gathering methodology for non-Libsyn feeds. One segment at a time.
DONE Why is this so difficult? Because my final files are not all in SEGMENTS, and I wasn’t systematic.
DONE Where are the file? In SEGMENTS and [FINAL FILES] or whatever, on the MM.
DONE Get [FINAL FILES] on laptop. Actually, got them on external drive ft1
.
DONE Should you get everything on a simple storage server (DO), a la S3 buckets? Nah, see next.
DONE Where should I store my files? The video will eventually die at scale. Nah, see next.
DONE Can I point nginx Re1.mp4 to another server? Nah, see next.
DONE More simply, can I put a YouTube URL in my nginx Index of Re600? I think the way is an html file for the videos that redirects to wherever. Nah, see next.
https://superuser.com/questions/277186/symlink-to-a-url/1340296#1340296 https://stackoverflow.com/questions/5411538/how-to-redirect-one-html-page-to-another-on-load
Ok, I can make this work. It’s inelegant, but it works.
DONE But 20min of video is only 133 MB (7MB/min). Do I really need to store video offsite? Or only today’s, and then archives (which get downloaded much less) are all local? That’s the way.
Co2_ It's Not a Hacker (and Alex Birsan's Dependency Confusion via Ee Durbin on Django Chat).mp4
That’s 20min, 133 MB.
So, suppose 133 MB per day, 325, 10 years: 485 GB. Meh. Add 10% for mp3/pdf/html/txt. Say, 600 GB per decade. Nothing, in the scheme of things.
DONE So where are the [FINAL FILES]? Some are in otherfiles
. I need to get 180GB onto my laptop. It’s the only clean way.
DONE Get RETRAICE-archive
onto laptop.
DONE Decide html (generation or fix-up) for Re1–N which were never properly generated. One segment at a time.
DONE Decide NOTES-CURRENT source files vetting method. One segment at a time.
- How to include multiple
.tex
files? - How to include bib?
- How to include images?
DONE make this doc published on website
DONE make LOGBOOK publishable
DONE make a source/projects/
dir
DONE make an rsync
to copy the html file generated by the M-` O pho
run from this project file, which is org-export-dispatch
and html, open
options.
DONE make CLOCK:
entries in :LOGBOOK:
drawer publish: org-export-with-clocks
Can't get :LOGBOOK:
keyword CLOCK:
entries to export. Wait, these variables:
- source: https://orgmode.org/worg/dev/org-export-reference.html section ‘The Communication Channel’
org-export-options-alist
org-export-with-clocks
set toon
inEasy Customization
- That did it! (Tried a lot of other stuff, in
Easy Customization
and buffer-local stuff like https://lists.gnu.org/archive/html/emacs-orgmode/2012-03/msg00023.html , that didn’t work.)
DONE make LOGBOOK look right
Here’s the relevant org
code added to this file (see https://orgmode.org/manual/CSS-support.html):
At the top:
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style2.css" />
Within the LOGBOOK
headline:
* LOGBOOK @@html:<div class="logbook"> <!--[2024-09-10 Tue 04:25] added jlm -->@@ :LOGBOOK: <...> CLOCK: [2024-09-09 Mon 15:06]--[2024-09-09 Mon 15:28] => 0:22 <...> :END: @@html:</div>@@
And the style2.css
file (see https://stackoverflow.com/questions/41253908/changing-spacing-between-paragraphs-and-inside-of-paragraphs):
.timestamp { color: #111111; font-family: monospace; font-size: 80%; } /* modified jlm [2024-09-10 Tue 04:03]*/ .timestamp-kwd { color: #5f9ea0; font-size: 80%; } /* modified jlm [2024-09-10 Tue 04:03]*/ .logbook {line-height: 0px; /* within paragraph */ margin-bottom: 0px; /* between paragraphs */} /* added jlm [2024-09-10 Tue 04:03]*/
DONE Make the #+SETUPFILE
work
(As first considered in TODO get general settings into =#+SETUPFILE=
of
the file 8-make-all-docs-publishable.org
.)
Frist, renamed style2.css
to style-projects.css
.
Then added this at the top of the present 9-backlog-files-to-website.org
file,
#+SETUPFILE: setupfile-projects.org
which points to setupfile-projects.org
:
# [2024-09-10 Tue 10:15] #+author: Jeff Marcum #+OPTIONS: toc:t # css #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style-projects.css" /> <!-- https://orgmode.org/manual/CSS-support.html --> # timestamp color #+HTML_HEAD_EXTRA: <style type="text/css"> .timestamp { color: purple; font-weight: bold; } </style> # HOME and UP buttons #+HTML_LINK_UP: https://retraice.com/segments/re600/ #+HTML_LINK_HOME: https://retraice.com
DONE Make zsh terminal structure blocks export with syntax highlighting / colorization. Done, using script
.
DONE State the objective: syntax highlighting / colorization of shell i/o in org
and html
export.
For example, this should be highlighted in org
and in html export:
➜ 2024-09-03-Tue-12:37:35-jmbpmhn Re1-SEGMENT $ la total 40 -rw-r--r--@ 1 jeffre staff 8.0K Aug 27 06:20 .DS_Store drwxr-xr-x 3 jeffre staff 96B Dec 12 2022 ACTUAL -rw-r--r-- 1 jeffre staff 744B Jan 11 2021 Copy-Pasted-Markers.txt drwxr-xr-x 4 jeffre staff 128B Aug 27 06:20 FCP drwxr-xr-x 6 jeffre staff 192B Aug 27 06:20 LOGIC drwxr-xr-x 11 jeffre staff 352B Apr 8 2023 NOTES-CURRENT drwxr-xr-x 7 jeffre staff 224B Sep 1 13:05 Re1 -rw-r--r-- 1 jeffre staff 2.0K Dec 12 2022 Re1-Vitals.sh drwxr-xr-x 62 jeffre staff 1.9K Apr 8 2023 SCRIPTS drwxr-xr-x 15 jeffre staff 480B Nov 4 2023 SCRIPTS-OUTPUT drwxr-xr-x 44 jeffre staff 1.4K Apr 8 2023 SCRIPTS-as-of-2022-12-12--18-59-07 drwxr-xr-x 15 jeffre staff 480B Apr 8 2023 archive ➜ 2024-09-03-Tue-12:37:38-jmbpmhn Re1-SEGMENT $ tree Re1 Re1 ├── FINAL---PDFLibsynShownotes.txt ├── FINAL---mp3LibsynNotes--FOR-LYRICS.txt ├── FINAL---mp3LibsynNotes--FOR-YOUTUBE.html ├── Re1-NOTES.pdf └── Re1.mp3 1 directory, 5 files ➜ 2024-09-03-Tue-12:37:49-jmbpmhn Re1-SEGMENT $
I can’t find an emacs mode that will syntax highlight / colorize my ls
and
zsh
stuff, and how could it? zsh
knows that the directories are
directories from, probably, the ascii escape codes. But I copy/paste only
(?) the visible ascii characters into org
structure blocks. Unless the
mode could parse ls syntax for things like drwxr-...
directory lines.
Or just let it go?
DONE get a major mode in emacs
that syntax highlights / colorizes zsh
blocks the way I want. I don’t think this is doable.
The mode would have to know that my shell prompt should be carefully
colorized, and which strings in la
output are directories vs files, etc.
DONE map that major mode to a string in Easy Customization Org Src Lang Modes
. Not doing this; see previous.
DONE New approach: Use external tool to convert zsh
i/o to html, then paste that into org
file. Didn't work.
This is a bit of trouble, but maybe I can ultimately perform the i/o in an
org
src block with output.
Trying ansifilter
and highlight
based on https://stackoverflow.com/a/2033408 .
I can get some colorization, but the basic problem with grabbing the text of
a shell prompt ➜ 2024-09-03-Tue-12:37:35-jmbpmhn Re1-SEGMENT $
with ls
/
la
and the output is that it’s input and output in the same place. It’s
not the syntax of one thing, but three.
DONE How are others doing it?
Examples:
- https://nickjanetakis.com/blog/inspect-the-stats-and-get-a-status-report-of-your-celery-workers
- https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu
Best leads:
- https://stackoverflow.com/questions/38398896/github-markdown-preserve-linux-terminal-output
- https://stackoverflow.com/questions/20303826/how-to-highlight-bash-shell-commands-in-markdown/49004070#49004070
- https://orgmode.org/manual/Environment-of-a-Code-Block.html
- https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-shell.html
- https://emacs.stackexchange.com/questions/44664/apply-ansi-color-escape-sequences-for-org-babel-results
- https://stackoverflow.com/questions/45812085/enabling-font-weight-and-colour-in-results-block-of-org-babel
DONE Fiddling
ls --color -alhF
total 16 drwxr-xr-x 12 jeffre staff 384B Apr 8 2023 ./ drwxr-xr-x 7 jeffre staff 224B Aug 27 05:55 ../ drwxr-xr-x 3 jeffre staff 96B Dec 12 2022 ACTUAL/ -rw-r--r-- 1 jeffre staff 744B Jan 11 2021 Copy-Pasted-Markers.txt drwxr-xr-x 3 jeffre staff 96B Dec 13 2022 FCP/ drwxr-xr-x 5 jeffre staff 160B Apr 8 2023 LOGIC/ drwxr-xr-x 11 jeffre staff 352B Apr 8 2023 NOTES-CURRENT/ -rw-r--r-- 1 jeffre staff 2.0K Dec 12 2022 Re1-Vitals.sh drwxr-xr-x 62 jeffre staff 1.9K Apr 8 2023 SCRIPTS/ drwxr-xr-x 15 jeffre staff 480B Nov 4 2023 SCRIPTS-OUTPUT/ drwxr-xr-x 44 jeffre staff 1.4K Apr 8 2023 SCRIPTS-as-of-2022-12-12--18-59-07/ drwxr-xr-x 15 jeffre staff 480B Apr 8 2023 archive/
ls -alhF --color=always
total 16 drwxr-xr-x 12 jeffre staff 384B Apr 8 2023 ./ drwxr-xr-x 7 jeffre staff 224B Aug 27 05:55 ../ drwxr-xr-x 3 jeffre staff 96B Dec 12 2022 ACTUAL/ -rw-r--r-- 1 jeffre staff 744B Jan 11 2021 Copy-Pasted-Markers.txt drwxr-xr-x 3 jeffre staff 96B Dec 13 2022 FCP/ drwxr-xr-x 5 jeffre staff 160B Apr 8 2023 LOGIC/ drwxr-xr-x 11 jeffre staff 352B Apr 8 2023 NOTES-CURRENT/ -rw-r--r-- 1 jeffre staff 2.0K Dec 12 2022 Re1-Vitals.sh drwxr-xr-x 62 jeffre staff 1.9K Apr 8 2023 SCRIPTS/ drwxr-xr-x 15 jeffre staff 480B Nov 4 2023 SCRIPTS-OUTPUT/ drwxr-xr-x 44 jeffre staff 1.4K Apr 8 2023 SCRIPTS-as-of-2022-12-12--18-59-07/ drwxr-xr-x 15 jeffre staff 480B Apr 8 2023 archive/
DONE This gets colorizing in emacs, but not export.
Source: https://github.com/atomontage/xterm-color/issues/40#issuecomment-841815639
echo "he\033[0;31mllo\033[0m"
hello
DONE Does this manually applied colorization get color in export? No.
echo "he\033[0;31mllo\033[0m"
hello
DONE Can I get colorized html from the ```console
in markdown
mode? Not really, even in Github webapp (not shown below).
```console ➜ 2024-09-13-Fri-14:00:02-jmbpmhn source/ git:(master) ✗ $ la total 256 -rw-r--r--@ 1 jeffre staff 6.0K Jun 25 10:31 .DS_Store -rw-r--r-- 1 jeffre staff 7.2K Jul 5 16:00 .emacs.desktop drwxr-xr-x 12 jeffre staff 384B Sep 13 13:46 .git/ -rw-r--r-- 1 jeffre staff 77B Jul 6 06:23 .gitignore drwxr-xr-x 3 jeffre staff 96B Jun 24 16:17 customers/ drwxr-xr-x 3 jeffre staff 96B Jun 24 16:16 feeds/ drwxr-xr-x 5 jeffre staff 160B Feb 21 2024 images/ -rw-r--r-- 1 jeffre staff 395B Jul 5 05:30 index.aux -rw-r--r--@ 1 jeffre staff 10K Sep 9 14:27 index.html -rw-r--r-- 1 jeffre staff 2.1K Sep 9 14:44 index.org -rw-r--r--@ 1 jeffre staff 51K Jul 5 05:30 index.pdf -rw-r--r-- 1 jeffre staff 2.0K Jul 5 05:30 index.tex -rw-r--r-- 1 jeffre staff 904B Feb 21 2024 links.org drwxr-xr-x 4 jeffre staff 128B Jun 24 16:16 mp3s/ drwxr-xr-x 2 jeffre staff 64B Jun 19 18:38 other/ -rw-r--r-- 1 jeffre staff 7.5K Jun 20 19:54 privacy-policy.org -rw-r--r-- 1 jeffre staff 6.3K Sep 9 14:43 project-alist.el drwxr-xr-x 7 jeffre staff 224B Sep 13 13:54 projects/ -rw-r--r-- 1 jeffre staff 24B Jun 24 17:40 rsync-exclude drwxr-xr-x 6 jeffre staff 192B Jun 26 08:36 segments/ -rw-r--r-- 1 jeffre staff 5.9K Feb 21 2024 terms-of-use.org ➜ 2024-09-13-Fri-14:00:03-jmbpmhn source/ git:(master) ✗ $ ```
DONE Sanity check: Let it go? What is the purpose?
- The documents, without colorization, don't look like what I see.
- The documents are easier to read and understand with color.
DONE Let's try ansifilter
and highlight
again. Done, and later for LaTeX.
Got ansifilter
working (see next). highlight
seems more about
converting source code (“Highlight converts sourcecode to HTML, XHTML, RTF,
LaTeX, TeX, SVG, BBCode and terminal escape sequences with coloured syntax
highlighting. Language definitions and colour themes are customizable.”).
Later, this will be especially useful for getting technical stuff in LaTeX
to look right, because right now my org
export to LaTeX doesn’t.
DONE Oooh, script
!
Check this out!! The funny business is the arrow character missing,
and the auto-complete in zsh of la
and exit
, things I can definitely
work around!
I generated this by running script
, then using:
script laFile <la and then exit> ansifilter --html laFile > laFile.html
Script started on Fri Sep 13 15:11:10 2024 2024-09-13-Fri-15:11:10-jmbpmhn testing-ansifilter-deletable/ $ =lla>ackground-color:#000000;"> total 48 -rw-r--r--@ 1 jeffre staff 3.2K Sep 12 13:23 6.html drwxr-xr-x 2 jeffre staff 64B Sep 11 14:04 dirtest/ -rw-r--r-- 1 jeffre staff 972B Sep 12 13:23 highlight.css -rw-r--r-- 1 jeffre staff 43B Sep 13 15:11 laFile -rw-r--r--@ 1 jeffre staff 5.3K Sep 12 13:23 test5.html drwxr-xr-x@ 6 jeffre staff 192B Sep 13 14:29 testing-ansifilter-deletable2/ -rw-r--r-- 1 jeffre staff 1.1K Sep 13 15:10 typescript 2024-09-13-Fri-15:11:12-jmbpmhn testing-ansifilter-deletable/ $ =eexexiexit> Script done on Fri Sep 13 15:11:13 2024
The two key links:
- https://stackoverflow.com/questions/2033268/how-to-convert-linuxs-shell-output-to-html/2033408#2033408
for
ansifilter
andhighlight
at: http://andre-simon.de/ - https://stackoverflow.com/questions/3515208/can-colorized-output-be-captured-via-shell-redirect
for
script
. Helpful onscript
: https://www.geeksforgeeks.org/script-command-in-linux-with-examples/
Other useful stuff:
- https://orgmode.org/manual/Results-of-Evaluation.html
- https://orgmode.org/manual/Environment-of-a-Code-Block.html
- https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-shell.html
- https://emacs.stackexchange.com/questions/44664/apply-ansi-color-escape-sequences-for-org-babel-results
This got colorization, but only within emacs, in the
RESULTS
block, not in html export.- https://stackoverflow.com/questions/45812085/enabling-font-weight-and-colour-in-results-block-of-org-babel This aimed for a similar thing, but I didn’t make it work.
- https://github.com/jeffrecode/test-console/blob/main/1test.md This is
where I tested Github’s
```console
syntax highlighting, and found it not good enough to interpret my unusual prompt, and even the directories ofls
.
DONE How to fix ugly script
capture of zsh
auto-complete / suggestions? Drop down to bash
.
Is it just best to drop down to bash
? I’ve improved my PS1
prompt in
.bashrc
:
# [2024-09-18 Wed 09:43] Can I get a similar prompt to my zsh? PS1='\[\033[01;95m\] $(date +%Y-%m-%d-%a-%H:%M:%S) \W/ \$ \[\033[00m\]'
And in action, I would do:
➜ 2024-09-18-Wed-11:40:52-jmbpmhn projects/ git:(master) ✗ $ export SHELL=/bin/bash && script -q 2024-09-18-Wed-11:40:58 projects/ $ ls -alh total 256 drwxr-xr-x 9 jeffre staff 288B Sep 18 11:39 ./ drwxr-xr-x 23 jeffre staff 736B Sep 9 14:44 ../ -rw-r--r-- 1 jeffre staff 25K Sep 10 04:30 9-backlog-files-to-website--clock-css-modified.html -rw-r--r--@ 1 jeffre staff 64K Sep 18 11:34 9-backlog-files-to-website.html -rw-r--r--@ 1 jeffre staff 28K Sep 18 11:35 9-backlog-files-to-website.org drwxr-xr-x 3 jeffre staff 96B Sep 16 12:00 hacking/ -rw-r--r-- 1 jeffre staff 442B Sep 10 11:38 setupfile-projects.org -rw-r--r-- 1 jeffre staff 669B Sep 10 11:09 style-projects.css -rw-r--r-- 1 jeffre staff 0B Sep 18 11:40 typescript 2024-09-18-Wed-11:41:03 projects/ $ exit exit ➜ 2024-09-18-Wed-11:41:40-jmbpmhn projects/ git:(master) ✗ $ ansifilter --html ➜ 2024-09-18-Wed-11:41:58-jmbpmhn projects/ git:(master) ✗ $ ansifilter --html typescript > typescript.html ➜ 2024-09-18-Wed-11:42:37-jmbpmhn projects/ git:(master) ✗ $ open typescript.html
Which produces:
2024-09-18-Wed-11:40:58 projects/ $ ls -alh total 256 drwxr-xr-x 9 jeffre staff 288B Sep 18 11:39 ./ drwxr-xr-x 23 jeffre staff 736B Sep 9 14:44 ../ -rw-r--r-- 1 jeffre staff 25K Sep 10 04:30 9-backlog-files-to-website--clock-css-modified.html -rw-r--r--@ 1 jeffre staff 64K Sep 18 11:34 9-backlog-files-to-website.html -rw-r--r--@ 1 jeffre staff 28K Sep 18 11:35 9-backlog-files-to-website.org drwxr-xr-x 3 jeffre staff 96B Sep 16 12:00 hacking/ -rw-r--r-- 1 jeffre staff 442B Sep 10 11:38 setupfile-projects.org -rw-r--r-- 1 jeffre staff 669B Sep 10 11:09 style-projects.css -rw-r--r-- 1 jeffre staff 0B Sep 18 11:40 typescript 2024-09-18-Wed-11:41:03 projects/ $ exit exit
Improving prompt, creating alias
shortcuts, and using C-d
to exit instead:
.profile
:
alias startScript='export SHELL=/bin/bash && script -q' alias convertScriptToHtmlAndOpen='ansifilter --html typescript > typescript.html && open typescript.html' alias cso='convertScriptToHtmlAndOpen'
Raw:
➜ 2024-09-18-Wed-11:58:57-jmbpmhn projects/ git:(master) ✗ $ startScript -> 2024-09-18-Wed-11:59:13 projects/ $ ls -alh total 280 drwxr-xr-x 10 jeffre staff 320B Sep 18 11:53 ./ drwxr-xr-x 23 jeffre staff 736B Sep 9 14:44 ../ -rw-r--r-- 1 jeffre staff 25K Sep 10 04:30 9-backlog-files-to-website--clock-css-modified.html -rw-r--r--@ 1 jeffre staff 66K Sep 18 11:46 9-backlog-files-to-website.html -rw-r--r--@ 1 jeffre staff 31K Sep 18 11:50 9-backlog-files-to-website.org drwxr-xr-x 3 jeffre staff 96B Sep 16 12:00 hacking/ -rw-r--r-- 1 jeffre staff 442B Sep 10 11:38 setupfile-projects.org -rw-r--r-- 1 jeffre staff 669B Sep 10 11:09 style-projects.css -rw-r--r-- 1 jeffre staff 0B Sep 18 11:59 typescript -rw-r--r--@ 1 jeffre staff 1.5K Sep 18 11:58 typescript.html -> 2024-09-18-Wed-11:59:17 projects/ $ exit ➜ 2024-09-18-Wed-11:59:19-jmbpmhn projects/ git:(master) ✗ $ cso
Yields:
-> 2024-09-18-Wed-11:59:13 projects/ $ ls -alh total 280 drwxr-xr-x 10 jeffre staff 320B Sep 18 11:53 ./ drwxr-xr-x 23 jeffre staff 736B Sep 9 14:44 ../ -rw-r--r-- 1 jeffre staff 25K Sep 10 04:30 9-backlog-files-to-website--clock-css-modified.html -rw-r--r--@ 1 jeffre staff 66K Sep 18 11:46 9-backlog-files-to-website.html -rw-r--r--@ 1 jeffre staff 31K Sep 18 11:50 9-backlog-files-to-website.org drwxr-xr-x 3 jeffre staff 96B Sep 16 12:00 hacking/ -rw-r--r-- 1 jeffre staff 442B Sep 10 11:38 setupfile-projects.org -rw-r--r-- 1 jeffre staff 669B Sep 10 11:09 style-projects.css -rw-r--r-- 1 jeffre staff 0B Sep 18 11:59 typescript -rw-r--r--@ 1 jeffre staff 1.5K Sep 18 11:58 typescript.html -> 2024-09-18-Wed-11:59:17 projects/ $ exit
DONE Downsides: I have to alias
and bash
to do it, and the raw file contents in my org
are html, not text, which will cause problems with LaTeX exports. But still, it looks good published.
DONE Can I ansifilter
to LaTeX? Yes!
First, I generate the LaTeX:
-> 2024-09-18-Wed-12:22:29 projects/ $ ansifilter --latex typescript > typescript.tex -> 2024-09-18-Wed-12:22:32 projects/ $ exit
This is the raw LaTeX file produced:
\documentclass{article} \usepackage{color} \usepackage{hyperref} \newcommand{\ws}[1]{\textcolor[rgb]{0,0,0}{#1}} %\usepackage[ISO-8859-1]{inputenc} \begin{document} \section*{typescript} \ttfamily% {\bfseries{}\color[rgb]{1,0,1}{-}$>$\ws{\ }2024{-}09{-}18{-}Wed{-}12:25:00\ws{\ }projects/\ws{\ }\$\ws{\ }}ls\ws{\ }{-}alh\hspace*{\fill}\\ total\ws{\ }616\hspace*{\fill}\\ drwxr{-}xr{-}x\ws{\ }\ws{\ }18\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }576B\ws{\ }Sep\ws{\ }18\ws{\ }12:23\ws{\ }{\bfseries{}\color[rgb]{0.5,0.5,0.5}}{\bfseries{}\color[rgb]{0,1,1}.}/\hspace*{\fill}\\ lrwxr{-}xr{-}x\ws{\ }\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }20B\ws{\ }Sep\ws{\ }18\ws{\ }12:23\ws{\ }{\color[rgb]{0.8,0,0.8}.\#9{-}backlog{-}files{-}to{-}website.org}@\ws{\ }{-}$>$\ws{\ }jeffre@jmbpmhn.47443\hspace*{\fill}\\ drwxr{-}xr{-}x\ws{\ }\ws{\ }23\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }736B\ws{\ }Sep\ws{\ }\ws{\ }9\ws{\ }14:44\ws{\ }{\bfseries{}\color[rgb]{0.5,0.5,0.5}}{\bfseries{}\color[rgb]{0,1,1}..}/\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}\ws{\ }\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }25K\ws{\ }Sep\ws{\ }10\ws{\ }04:30\ws{\ }9{-}backlog{-}files{-}to{-}website{-}{-}clock{-}css{-}modified.html\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}@\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }12K\ws{\ }Sep\ws{\ }18\ws{\ }12:23\ws{\ }9{-}backlog{-}files{-}to{-}website.html\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}@\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }39K\ws{\ }Sep\ws{\ }18\ws{\ }12:23\ws{\ }9{-}backlog{-}files{-}to{-}website.org\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}@\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }110K\ws{\ }Sep\ws{\ }18\ws{\ }12:23\ws{\ }9{-}backlog{-}files{-}to{-}website.pdf\hspace*{\fill}\\ drwxr{-}xr{-}x\ws{\ }\ws{\ }\ws{\ }3\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }96B\ws{\ }Sep\ws{\ }18\ws{\ }12:08\ws{\ }{\bfseries{}\color[rgb]{0.5,0.5,0.5}}{\bfseries{}\color[rgb]{0,1,1}auto}/\hspace*{\fill}\\ drwxr{-}xr{-}x\ws{\ }\ws{\ }\ws{\ }3\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }96B\ws{\ }Sep\ws{\ }16\ws{\ }12:00\ws{\ }{\bfseries{}\color[rgb]{0.5,0.5,0.5}}{\bfseries{}\color[rgb]{0,1,1}hacking}/\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}\ws{\ }\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }442B\ws{\ }Sep\ws{\ }10\ws{\ }11:38\ws{\ }setupfile{-}projects.org\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}\ws{\ }\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }669B\ws{\ }Sep\ws{\ }10\ws{\ }11:09\ws{\ }style{-}projects.css\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}\ws{\ }\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }\ws{\ }0B\ws{\ }Sep\ws{\ }18\ws{\ }12:25\ws{\ }typescript\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}\ws{\ }\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }162B\ws{\ }Sep\ws{\ }18\ws{\ }12:09\ws{\ }typescript.aux\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}@\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }578B\ws{\ }Sep\ws{\ }18\ws{\ }12:22\ws{\ }typescript.html\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}\ws{\ }\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }12K\ws{\ }Sep\ws{\ }18\ws{\ }12:09\ws{\ }typescript.log\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}\ws{\ }\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }\ws{\ }0B\ws{\ }Sep\ws{\ }18\ws{\ }12:09\ws{\ }typescript.out\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}@\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }45K\ws{\ }Sep\ws{\ }18\ws{\ }12:09\ws{\ }typescript.pdf\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}@\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }292B\ws{\ }Sep\ws{\ }18\ws{\ }12:22\ws{\ }typescript.tex\hspace*{\fill}\\ {\bfseries{}\color[rgb]{1,0,1}{-}$>$\ws{\ }2024{-}09{-}18{-}Wed{-}12:25:04\ws{\ }projects/\ws{\ }\$\ws{\ }}exit\hspace*{\fill}\\ \end{document} % LaTeX generated by ansifilter 2.21, http://andre-simon.de/
And this is how it has to be stripped of some things, and headers broken out in my org
file:
#+latex_header: \usepackage{color} #+latex_header: \usepackage{hyperref} #+latex_header: \newcommand{\ws}[1]{\textcolor[rgb]{0,0,0}{#1}} #+begin_export latex \section*{typescript} \ttfamily% {\bfseries{}\color[rgb]{1,0,1}{-}$>$\ws{\ }2024{-}09{-}18{-}Wed{-}11:59:13\ws{\ }projects/\ws{\ }\$\ws{\ }}ls\ws{\ }{-}alh\hspace*{\fill}\\ total\ws{\ }280\hspace*{\fill}\\ drwxr{-}xr{-}x\ws{\ }\ws{\ }10\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }320B\ws{\ }Sep\ws{\ }18\ws{\ }11:53\ws{\ }{\bfseries{}\color[rgb]{0.5,0.5,0.5}}{\bfseries{}\color[rgb]{0,1,1}.}/\hspace*{\fill}\\ drwxr{-}xr{-}x\ws{\ }\ws{\ }23\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }736B\ws{\ }Sep\ws{\ }\ws{\ }9\ws{\ }14:44\ws{\ }{\bfseries{}\color[rgb]{0.5,0.5,0.5}}{\bfseries{}\color[rgb]{0,1,1}..}/\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}\ws{\ }\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }25K\ws{\ }Sep\ws{\ }10\ws{\ }04:30\ws{\ }9{-}backlog{-}files{-}to{-}website{-}{-}clock{-}css{-}modified.html\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}@\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }66K\ws{\ }Sep\ws{\ }18\ws{\ }11:46\ws{\ }9{-}backlog{-}files{-}to{-}website.html\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}@\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }31K\ws{\ }Sep\ws{\ }18\ws{\ }11:50\ws{\ }9{-}backlog{-}files{-}to{-}website.org\hspace*{\fill}\\ drwxr{-}xr{-}x\ws{\ }\ws{\ }\ws{\ }3\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }96B\ws{\ }Sep\ws{\ }16\ws{\ }12:00\ws{\ }{\bfseries{}\color[rgb]{0.5,0.5,0.5}}{\bfseries{}\color[rgb]{0,1,1}hacking}/\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}\ws{\ }\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }442B\ws{\ }Sep\ws{\ }10\ws{\ }11:38\ws{\ }setupfile{-}projects.org\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}\ws{\ }\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }669B\ws{\ }Sep\ws{\ }10\ws{\ }11:09\ws{\ }style{-}projects.css\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}\ws{\ }\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }\ws{\ }\ws{\ }0B\ws{\ }Sep\ws{\ }18\ws{\ }11:59\ws{\ }typescript\hspace*{\fill}\\ {-}rw{-}r{-}{-}r{-}{-}@\ws{\ }\ws{\ }1\ws{\ }jeffre\ws{\ }\ws{\ }staff\ws{\ }\ws{\ }\ws{\ }1.5K\ws{\ }Sep\ws{\ }18\ws{\ }11:58\ws{\ }typescript.html\hspace*{\fill}\\ {\bfseries{}\color[rgb]{1,0,1}{-}$>$\ws{\ }2024{-}09{-}18{-}Wed{-}11:59:17\ws{\ }projects/\ws{\ }\$\ws{\ }}exit\hspace*{\fill}\\ #+end_export
So, if I were trying to export a beautiful ls -alh
to both html and Latex,
I would have to create a separate export for each, the way I do in my
title/subtitle etc. structure for Retraice Notes.
DONE Maybe I should try highlight
with my own language definition. Maybe later.
DONE set nginx
config to index projects
directory
DONE modify and run publishing process with this project doc in tow.
adjust rsync process to filter files (or not)
The question is: Do I have to rsync filter html files in source? I don’t want to have to do this.
I THINK the reason I was filtering was in case I had an html file generated by org export instead of org publish. If I regularly export to examine the drafts of, say, index.org, then org-publish, then rsync, I’ll overwrite the publish-generated html with the draft one.
Can I tell rsync to not overwrite newer files? Of course I can. But it’s might lead to situations of confusion.
man rsync
:
--update, -u skip files that are newer on the receiver
The question is: Do you always want the most recently generated html file to be published? Scenarios:
- old draft gets published to indexed directory, not intended to be public
- new draft overwrites existing good draft. But this would mean I generated
an html file in
source
, nuked a ‘good’ html file, andrsynced
the …
This is too complicated to think through. What I need is separate
directories for export
html docs, and for publish
html docs.
export
is for projects and segments, and html files should be included inrsync
’spublish
is only for website-level pages, e.g. index, about, etc., not daily output, and html should not be synced.
But then why am I using publish
at all? Shouldn’t everything just be
rsync
ed? Looking at the project-alist.el
file, I really don’t see why I
need it.
- Is it because linked pages and docs are automatically published? Test…
So far so good. I think this variable controls linking to html or org
files:
org-html-link-org-files-as-html
- although I need to be careful about defaulting my
export
to subtree only, because if that gets published, it’s wrong. - And this way (rsync only), I don’t have to think about ‘newer’ and ‘older’ files. Just sync everything.
- Ok, looks good, after some tweaking and clean up.
But the org files clutter up the indexed directories, e.g.:
Raw-ish:
Index of /Users/jeffre/dotfiles/newhouse/website/local-test-site/segments/re600/ [parent directory] Name Size Date Modified Re600-vid.html 335 B 9/23/24, 2:06:09 PM Re600.html 8.4 kB 9/23/24, 2:07:09 PM Re600.org 588 B 6/20/24, 8:10:32 PM Re600.pdf 49.8 kB 6/21/24, 7:43:06 AM Re600.tex 1.1 kB 6/21/24, 7:43:02 AM Re600.txt 212 B 6/21/24, 8:38:43 AM TEST-bib.bib 1.7 kB 12/28/23, 11:00:59 AM
Html: re600 directory
But it’s not so bad. And it’s great to have the actual source file there.
So, this org doc is in my website source
directory, and when I export,
generates the html. Now I just need to link to this file. Or better yet,
link to the indexed directory of all projects? Yes, linking to the indexed
directory looks good, as long as I have a subdirectory for each project, to
keep things visually tidy. So a project is like a segment in that way:
… Hmm, if I insert raw html, the <script>
(I think) interferes with the
above insert, mixes with, and breaks both. So for now, only one directory
index raw html insert per org doc.
What I wanted to print in html, but raw-ish:
Index of /Users/jeffre/dotfiles/newhouse/website/source/projects/ [parent directory] Name Size Date Modified hacking/ 9/24/24, 9:56:06 AM website/ 9/24/24, 10:40:45 AM setupfile-projects.org 530 B 9/24/24, 10:40:06 AM style-projects.css 669 B 9/10/24, 11:09:19 AM
Better if I use eww
, but not similar to gui web browser layout. Still, at
least I don't have to manually align things. But it's really just ls -al
.
/Users/jeffre/dotfiles/newhouse/website/source/projects: drwxr-xr-x 6 jeffre staff 192 Sep 24 10:40 . drwxr-xr-x 23 jeffre staff 736 Sep 24 10:03 .. drwxr-xr-x 4 jeffre staff 128 Sep 24 09:56 hacking -rw-r--r-- 1 jeffre staff 530 Sep 24 10:40 setupfile-projects.org -rw-r--r-- 1 jeffre staff 669 Sep 10 11:09 style-projects.css drwxr-xr-x 4 jeffre staff 128 Sep 24 11:02 website
In a separate file: projects directory
DONE Is there a security concern with the <script>
functionality of these html export blocks?
Maybe. But I don’t think nginx
will serve any directory I haven’t
explicitly configured to be indexed. I’m not too worried about it. It
would be a pain to remove some of the scripts from the html I’m
embedding. But I’ll avoid embedding anything but static html in the future.
DONE Can I convert the scripty html static html easily? Not that I’ve found.
DONE What I really care about is the directory movement. Easy to kill that? Yea, just delete the links. Done.
DONE Do relative symlinks work on webserver after rsync -l
(included by -a
)? Yes!
https://retraice.com/segments/re600/Re600-link.mp3 is a symlink:
(I know I shouldn’t be logging in as root. Hardening this box is a separate project I’ve decided to put behind in priority to this and other projects.)
root@www-1:~# la /var/www/html/segments/re600/ total 84K lrwxrwxrwx 1 505 staff 20 Sep 29 13:30 Re600-link.mp3 -> ../../mp3s/Re600.mp3 -rw-r--r-- 1 505 staff 335 Sep 23 18:06 Re600-vid.html -rw-r--r-- 1 505 staff 8.5K Sep 23 18:07 Re600.html -rw-r--r-- 1 505 staff 588 Jun 21 00:10 Re600.org -rw-r--r-- 1 505 staff 50K Jun 21 11:43 Re600.pdf -rw-r--r-- 1 505 staff 1.1K Jun 21 11:43 Re600.tex -rw-r--r-- 1 505 staff 212 Jun 21 12:38 Re600.txt -rw-r--r-- 1 505 staff 1.8K Dec 28 2023 TEST-bib.bib root@www-1:~#
DONE Get time, date, templates working better for publication.
To show timezone, example:
From .emacs
;; insert timestamp with timezone info [2024-09-27 Fri 11:49] ;; (global-set-key (kbd "<f7>") (lambda () ;; (interactive) ;; (let ((current-prefix-arg '(16))) ;; (insert (format-time-string "[%Y-%m-%d %a %H:%M] [%Z]"))))) ;; ;; this break the interactive functionality of editable org timestamps. ;; trying to get %Z to work with Org editable timestamps ... SEEMS TO WORK! Including not breaking the LOGBOOK duration functionality. [2024-09-27 Fri 12:51 EDT] ;; https://emacs.stackexchange.com/questions/13463/specify-timezone-in-org-date-format (setq org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a %H:%M %Z>"))
Also, for easy insertion of time/date strings:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; https://emacs.stackexchange.com/questions/60822/how-to-specify-prefix-argument-in-key-binding ;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Command-Arguments.html ;; (global-set-key (kbd "<f5>") 'org-time-stamp-inactive) ;; (global-set-key (kbd "<f5>") (lambda () (interactive) (let ((current-prefix-arg '(16))) (call-interactively #'org-time-stamp-inactive)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; print date stamp for file names [2024-09-27 Fri 10:46] ;; https://emacs.stackexchange.com/questions/26539/insert-current-date-and-time-with-custom-timestamp ;; http://xahlee.info/emacs/emacs/elisp_printing.html (global-set-key (kbd "<f6>") (lambda () (interactive) (let ((current-prefix-arg '(16))) (insert (format-time-string "%Y-%m-%d-%a")))))
And for template insertion for daily/ and project files:
;; [2024-09-24 Tue 09:54] templates ;; (define-skeleton project-skeleton ;; "Project skeleton" nil ;; "#+title: =insert-file-name= ;; #+subtitle: started ;; #+setupfile: ../setupfile-projects.org ;; * LOGBOOK =insert-file-name= ;; @@html:<div class=\"logbook\">@@ ;; :LOGBOOK: ;; :END: ;; @@html:</div>@@") ;; [2024-09-27 Fri 14:23 EDT] better: (defun jeff-re-daily-template () "Jeff’s Re Daily template" (interactive) (insert "#+title: [title]") (insert "\n#+subtitle: file ") (insert-file-name) (insert " started ") (org-time-stamp-inactive '(16)) (insert "\n#+setupfile: ../setupfile-projects.org\n\n\n* LOGBOOK ") (insert-file-name) (insert "\n @@html:<div class=\"logbook\">@@\n :LOGBOOK:\n :END:\n @@html:</div>@@") ) (global-set-key (kbd "<f8>") 'jeff-re-daily-template)
And for inserting the filename, with or without full path:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; when? Sep-ish 2024 ;; https://unix.stackexchange.com/questions/45125/how-to-get-current-buffers-filename-in-emacs ;; (defun insert-file-name-full-path () ;; "Insert the full path file name into the current buffer." ;; (interactive) ;; (insert (buffer-file-name (window-buffer (minibuffer-selected-window))))) ;; ;; no longer necessary, because C-u with =insert-file-name= (see next) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; insert just file name [2024-09-27 Fri 10:55] ;; https://mbork.pl/2019-02-17_Inserting_the_current_file_name_at_point (defun insert-file-name (&optional full-path) "Insert the current filename at point. With prefix argument, use full path." (interactive "P") (let* ((buffer (if (minibufferp) (window-buffer (minibuffer-selected-window)) (current-buffer))) (filename (buffer-file-name buffer))) (if filename (insert (if full-path filename (file-name-nondirectory filename))) (error (format "Buffer %s is not visiting a file" (buffer-name buffer)))))) (global-set-key (kbd "M-o") #'insert-file-name)
DONE Get org html preamble modified date to show timezone
Is there any way to get active content in this field? Could I point it to something like how I get the clock on Re livestreams in OBS?
:html-preamble
to experiment, because it does look like I can set it to a
function:
org-html-preamble is a variable defined in ‘ox-html.el’. Its value is "Modified: %C" Original value was t Non-nil means insert a preamble in HTML export. When t, insert a string as defined by the formatting string in ‘org-html-preamble-format’. When set to a string, use this formatting string instead (see ‘org-html-postamble-format’ for an example of such a formatting string). When set to a function, apply this function and insert the returned string. The function takes the property list of export options as its only argument. Setting :html-preamble in publishing projects will take precedence over this variable. You can customize this variable. [back] [forward]
This works!!!
(defun jeff-f5-timestamp-for-html-preamble (dummyArg) ;; for html-preamble [2024-10-01 Tue 15:07 EDT] " a func" (interactive) (setq current-prefix-arg '(16)) (call-interactively 'org-time-stamp-inactive))
with this function set to Function
and jeff-f5-timestamp-for-html-preamble
:
Hide Org Html Preamble: Choice: [Value Menu] Function (must return a string): jeff-f5-timestamp-for-html-preamble [ State ]: SAVED and set. Non-nil means insert a preamble in HTML export. Hide When t, insert a string as defined by the formatting string in ‘org-html-preamble-format’. When set to a string, use this formatting string instead (see ‘org-html-postamble-format’ for an example of such a formatting string). When set to a function, apply this function and insert the returned string. The function takes the property list of export options as its only argument. Setting :html-preamble in publishing projects will take precedence over this variable. Groups: [Org Export HTML]
Now I need to add stuff to the timestamp itself:
Last modified: <span class="timestamp">[2024-09-01 Sun 13:07 EDT]</span>
This works:
;; for html-preamble [2024-10-01 Tue 15:07 EDT] (defun jeff-f5-timestamp-for-html-preamble (dummyArg) "A function to insert timestamp with timezone in html export preamble." (interactive) (concat (princ "Last modified: ") (setq current-prefix-arg '(16)) (call-interactively 'org-time-stamp-inactive)))
Ugh, I’m not going to bother with the
class="timestamp"
because it’s probably not worth figuring out right now. When I put the html
code into my princ
output, it just gets treated as text, not code, of
course. And I would want the class
to only apply to the time stamp, no the
whole output of my jeff-f5-timestamp-for-html-preamble
function, which will
push the limits of what preamble
seems to do. Push.
…Fuck! I just did it! I went to show the strings that get treated as text, and when I did that, they got treated as html! A minute ago, with some very rough attempt, that didn’t happen. Anyway, done! I swear, every time I explicitly give up on something, my brain goes into overdrive and gets it done. I’ve noticed this for years, especially technical problems. Though this just feels like dumb luck.
;; for html-preamble [2024-10-01 Tue 15:07 EDT] (defun jeff-f5-timestamp-for-html-preamble (dummyArg) "A function to insert timestamp with timezone in html export preamble." (interactive) (concat (princ "Last modified: <span class=\"timestamp\">") (setq current-prefix-arg '(16)) (call-interactively 'org-time-stamp-inactive) (princ "</span>")))
Now, now that I’m cocky, can I get the postamble 2024
to be a function
instead of a manual string?
Current:
Hide Org Html Postamble: Choice: [Value Menu] Custom formatting string: <br>Copyright 2024 Retraice, Inc. [ State ]: SAVED and set. Non-nil means insert a postamble in HTML export. Hide When set to ‘auto’, check against the ‘org-export-with-author/email/creator/date’ variables to set the content of the postamble. When t, insert a string as defined by the formatting string in ‘org-html-postamble-format’. When set to a string, use this formatting string instead (see ‘org-html-postamble-format’ for an example of such a formatting string). When set to a function, apply this function and insert the returned string. The function takes the property list of export options as its only argument. Setting :html-postamble in publishing projects will take precedence over this variable.
Too easy:
;; for html-postamble [2024-10-02 Wed 08:35 EDT] (defun jeff-year-for-html-postamble (dummyArg) "A function to insert year for html postamble." (interactive) (concat (princ "</div>Copyright ") (format-time-string "%Y") (princ " Retraice, Inc.")))
DONE sort out css and setupfile structure
DONE change face of preamble and postamble to be more background
TODO miscellaneous stuff
DONE get old blog post on power map (12) on website
DONE fix rss that keeps updating PA: https://retraice.com/feeds/public.xml
Tried uncommenting <pubDate>Sat, 24 Jun 2023 14:46:28 +0000</pubDate>
in
channel section, nope.
Uncomment <lastBuildDate>Thu, 20 Jun 2024 15:32:33
+0000</lastBuildDate>
in channel section?
I played with the GUID and other stuff. Looks like it was a problem with
PA confusing/mixing the live Retraice feed with my test feed, which was
also named "Retraice" in the <title>Retraice (test)</title>
tag. That
in combination with a GUID that was the same for the Re116 entry in both
feeds caused duplication errors in the test feed. I’ve made the title
tags unique, and all GUIDs should always be unique everywhere.
See https://www.w3schools.com/xml/rss_tag_guid.asp for making GUID the permalink.
DONE blank [rectangle] character in preamble
Ugh, this was a pain. Switching how I call the org timestamp function
finally fixed it, though I’m not sure I need the "P"
. It seems to boil
down to using let
vs setq
, but you can’t just use let
in the
jeff-f5-timestamp-for-html-preamble function, dunno why.
;; just trying to get rid of blank character in Chrome mobile view [2024-10-08 Tue 10:49 EDT] ;; https://stackoverflow.com/questions/12827887/emacs-universal-argument-c-u-in-a-function (defun jeff-org-timestamp-no-rectangle () (interactive) (let ((current-prefix-arg '(16))) ;; emulate C-u (call-interactively 'org-time-stamp-inactive) ) ) ;; for html-preamble [2024-10-01 Tue 15:07 EDT] (defun jeff-f5-timestamp-for-html-preamble (dummyArg) "A function to insert timestamp with timezone in html export preamble." (interactive "P") (concat (princ "<span class=\"prepostable\"> Last modified: </span><span class=\"timestamp\">") ;; (setq current-prefix-arg '(16)) (call-interactively 'org-time-stamp-inactive) ;; old way, lead to rectangle character visible in Chrome Mobile only. (jeff-org-timestamp-no-rectangle) ;; new way (princ "</span>"))) ;; for html-postamble [2024-10-02 Wed 08:35 EDT] (defun jeff-year-for-html-postamble (dummyArg) "A function to insert year for html postamble." (interactive) (concat (princ "<br><span class=\"prepostable\">Copyright ") (format-time-string "%Y") (princ " Retraice, Inc.</span>")))
DONE Get all CSS out of documents and into CSS files
#+OPTIONS: html-style:nil
DONE the css file is being injected into static html page at export, so updates won’t automatically propagate
Hmm, maybe it’s because I’m doing @import
"https://retraice.com/other/general-style.css"
in project-style.css
.
Yea. Fixed now.
NEXT Simplify setup of setup
and style
files to be more comprehensible.
TODO Find a workable centering CSS method
TODO fix mobile margins
This seems to be caused by my hacky CSS centering method.
TODO logbook lines look wrong in Chrome mobile
This seems to have been caused by my css, which aimed to flatten/shorten the verticle length of the logbook section as a whole. Better:
TODO fix the UP
button; it should make sense, or get removed, but what is my solution to navigation?
TODO fix image size problems with desktop vs. mobile on https://retraice.com/blog/12.html
TODO Does this (that symlinks for mp3/mp4s work, see above) mean that I can/should put larger files (mp3s, mp4s) in their own dir on the website, for scale management later?
Since I’m currently (
) considering doing an hour+ per day, I am revisiting the problem of storage and bandwidth, CDNs, etc.TODO Also: does my idea of cloning the website N times and putting them all behind a load balancer really scale?
TODO Check nginx config
get blog on website
WAIT Gather files
If you’re going to download:
WAIT Re1
WAIT mp3
WAIT pdf
WAIT txt
WAIT html
WAIT mp4
WAIT Clean up YouTube channels
WAIT Retraice
WAIT Margin
WAIT Code Outsider
Fun stuff ahead
- http://andre-simon.de/doku/highlight/en/highlight.php
- https://suckless.org/
- https://www.reddit.com/r/securityCTF/comments/10jc4fs/looking_for_beginner_ctfs_or_tutorialstips/
- https://trailofbits.github.io/ctf/
- https://darrenburns.net/posts/tools/
- https://www.laws-of-software.com/
- https://python.langchain.com/docs/tutorials/
LOGBOOK 9-backlog