[HN Gopher] Using Ed(1) as My Static Site Generator
       ___________________________________________________________________
        
       Using Ed(1) as My Static Site Generator
        
       Author : BoingBoomTschak
       Score  : 56 points
       Date   : 2025-05-31 13:55 UTC (9 hours ago)
        
 (HTM) web link (aartaka.me)
 (TXT) w3m dump (aartaka.me)
        
       | BoingBoomTschak wrote:
       | The quite cool journey of a hacker trying to find his favourite
       | SSG itch scratching position.
       | 
       | What inspired me to post it is that I cobbled a fun HTML
       | preprocessor using cpp to someone today:
       | https://git.sr.ht/~q3cpma/html-cpp (I use a Common Lisp
       | contraption for myself).
        
       | WD-42 wrote:
       | Fantastic. The Unix hackers are alive and well. Keep it real.
        
         | Rendello wrote:
         | I did my resume in groff once, formatted like a man page. It
         | didn't look half-bad either.
        
           | fiddlerwoaroof wrote:
           | This is a great idea
        
             | DaSHacka wrote:
             | 100%, I'd love to see the template if GP ever makes a blog
             | post about it
        
               | qartis wrote:
               | I'm not GP but I also ported my resume from latex to
               | groff a few years ago for fun:
               | https://github.com/qartis/groff_resume/
               | 
               | I'm not experienced with groff so the code isn't great
               | but I was quite happy with the typesetting (and the
               | compile times!)
        
               | Rendello wrote:
               | I'll see if I can find it. I checked archive.org but it
               | didn't save a copy (it saved the PDF version though,
               | apparently that was good enough to save).
               | 
               | It wasn't the craziest resume I did. I applied for a
               | company that made this UI tool for enterprises. It was a
               | half-WHSIWYG, half-Lua tool. I downloaded the demo and
               | spent a week building my resume as a UI, then sent it to
               | the team. I got an interview with the top level guys and
               | a team of programmers, and they excitedly asked me
               | questions about how I made it and how I figured out
               | certain features (like this image passthrough
               | functionality that "none of their clients could figure
               | out"). It was all very exciting but I wasn't ultimately
               | hired (they were being acquired at the time, perhaps that
               | had something to do with it). I have the video on the UI
               | and the making of it, perhaps I'll post it one day once I
               | anonymize the company's name in the video.
        
       | snackbroken wrote:
       | > But then, ed is so simple and more or less standard
       | 
       | More or less? ED IS THE STANDARD TEXT EDITOR! [1]
       | 
       | [1] https://www.gnu.org/fun/jokes/ed-msg.html
        
         | 01HNNWZ0MV43FF wrote:
         | More? Less? Why are we talking about pagers? Who's on first?
        
           | fredoralive wrote:
           | who on first? I don't think you can use who as init.
        
             | Henchman21 wrote:
             | Not with that attitude!
        
         | staplung wrote:
         | """ When I use an editor, I don't want eight extra KILOBYTES of
         | worthless help screens and cursor positioning code! I just want
         | an EDitor!! Not a "viitor". Not a "emacsitor". Those aren't
         | even WORDS!!!! ED! ED! ED IS THE STANDARD!!! """
        
         | wtetzner wrote:
         | > Note the consistent user interface and error reportage. Ed is
         | generous enough to flag errors, yet prudent enough not to
         | overwhelm the novice with verbosity.
        
         | adamors wrote:
         | Was hoping to see this here, still makes me laugh after
         | discovering it 20 years ago.
        
       | sgt wrote:
       | I once used m4 to generate my blog. Worked like a charm!
        
         | smlavine wrote:
         | I once used m4 to generate my blog. Hated it. Escaping was a
         | nightmare and I was always afraid I'd quote something wrong.
        
           | PhilipRoman wrote:
           | I use m4 with -P option and m4_changequote({{,}})
           | 
           | Personally I find it quite reasonable for code that you don't
           | plan on changing any time soon.
        
             | kragen wrote:
             | Those seem like they would make it bearable. Also GNU m4
             | has an extension to standard m4 which doesn't replace
             | builtin macro names that take arguments if you omit the ().
             | Without that, every unquoted occurrence of words like
             | format, index, join, quote, builtin, define, copy, or
             | capitalize silently vanishes. It's a nightmare. You can
             | also avoid this problem with changeword or -P.
        
         | somat wrote:
         | Oh man massive nostalgia hit.
         | 
         | When I was younger I was trying to learn the traditional unix
         | tools, so I sat down with a copy of openbsd and made a wiki
         | using only what was found in the base system, and perl was
         | cheating. The templating engine was m4, web server in shell,
         | page history in rcs, a really neat back reference system in
         | awk(when you square linked to another page, it would put a link
         | back in the backreference section of that other page, inspired
         | by everything2) ...
         | 
         | Now I am trying to see if I have any of the code saved... It
         | was probably one huge pile of injection vectors... but they
         | were my injection vectors.
         | 
         | Hah, found it, Apologies for inflicting it on everyone, But I
         | was having too much fun trying to figure out what past me was
         | on.
         | 
         | https://nl1.outband.net/fossil/gami/dir?ci=tip&type=tree
        
       | djoldman wrote:
       | > Should You Use ed As Site Generator?
       | 
       | > No, not at all.
       | 
       | Well, it (totxt.ed) looks pretty inscrutable to me:
       | 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\       /
        
         | rahen wrote:
         | It still looks a lot more legible than a TECO script. ed was a
         | big improvement in ergonomics.
        
         | kragen wrote:
         | Huh, I didn't know you could do that in ed. It doesn't look
         | inscrutable to me, just confusing.
        
       | regus wrote:
       | I really like the idea of ed. I tried using it recently but
       | having to constantly reprint the block of code you are editing
       | was really tedious.
        
         | skydhash wrote:
         | I think the idea of ed is to embrace the edit-compile-cycle. So
         | the error tell you the specific line to go to. Then after the
         | obvious errors are out, you do a full printout to handle logic
         | errors.
        
           | cardiffspaceman wrote:
           | It's always fun to figure out the path through the error
           | messages that changes the error line numbers the least, so
           | you don't have to search or recompile.
        
           | Avshalom wrote:
           | The idea of Ed is that you have a large spool of paper and
           | you make little editing marks on the printout until you
           | decide you've reached some threshold and then print out a
           | fresh up-to-date copy
        
       | susam wrote:
       | Impressive! Only three leaps away from using butterflies as
       | static site generator!
        
       ___________________________________________________________________
       (page generated 2025-05-31 23:00 UTC)