> But then, ed is so simple and more or less standard<p>More or less? ED IS THE STANDARD TEXT EDITOR! [1]<p>[1] <a href="https://www.gnu.org/fun/jokes/ed-msg.html" rel="nofollow">https://www.gnu.org/fun/jokes/ed-msg.html</a>
The quite cool journey of a hacker trying to find his favourite SSG itch scratching position.<p>What inspired me to post it is that I cobbled a fun HTML preprocessor using cpp to someone today: <a href="https://git.sr.ht/~q3cpma/html-cpp" rel="nofollow">https://git.sr.ht/~q3cpma/html-cpp</a> (I use a Common Lisp contraption for myself).
I love how much utility 60+ year old Unix commands have. Very powerful, requiring only a few kB of ram, and even 20+ years later, I’m still discovering new utilities.<p>I did something similar for <a href="https://isgithubipv6.web.app/" rel="nofollow">https://isgithubipv6.web.app/</a> . Most static site generators are huge ( I was aiming for < 5mb docker container) . I went with `envsubst` , env vars and a simple HTML template.
Nice! Another tantalizing rabbit hole.<p>I go full in on ed sporadically. It requires a bit of a brain rewire, but tye UX is closer to pencil and paper, which is hard to beat for encouraging deeper thought, IMHO.<p>Also, check out edbrowse for a line-oriented browser:<p><a href="https://en.wikipedia.org/wiki/Edbrowse" rel="nofollow">https://en.wikipedia.org/wiki/Edbrowse</a><p>It's developed by a blind coder and has a nice core following.
> It has no file inclusion, for one. So C Preprocessor's #include is no longer accessible. I manage without it<p>m4 is always there with better macros than CPP.
> Should You Use ed As Site Generator?<p>> No, not at all.<p>Well, it (totxt.ed) looks pretty inscrutable to me:<p><pre><code> H
!# Include proxy title
!# Insert fallback values
?<head>?a
<SUBTITLE></SUBTITLE>
<DESCRIPTION></DESCRIPTION>
<IMAGE></IMAGE>
<IMAGE_ALT></IMAGE_ALT>
.
w
!# Include the template files via script
g/\(<!--\)*[<#]include \(file=\)*"*\([^">]*\)"* *-*\/*>*/s//&\
\/[<#]include\/d\
-1r \3\
wq\
/
g/[<#]include "*\([^">]*\)"*\/*>*/d\
.,+3w !ed %
E
!# Repeat the second time for recursive includes
g/\(<!--\)*[<#]include \(file=\)*"*\([^">]*\)"* *-*\/*>*/s//&\
\/[<#]include\/d\
-1r \3\
wq\
/</code></pre>