Babel is why I keep blogging with Emacs

(entropicthoughts.com)

269 points | by ibobev 3 days ago ago

89 comments

  • akkartik 3 days ago ago

    This works if your code snippets generate relatively static output. Lately I often need to create animations, often interactive ones. See https://akkartik.name/debugUIs.html, for example.

    In my life I've often switched to more manual tools when I notice that the more automated tool causes me to live within certain limitations. Sometimes it has taken me a decade to notice these limitations. Automation matters when I do something tens of times a day. But I publish a blog post once in tens of days. It feels worth some additional work to get a little more control and break out of ruts.

    • adityaathalye 2 days ago ago

      The neat thing about org-mode for writing and publishing (I don't use it for "productivity") is that every time I have a new requirement, there is a solution that I can integrate into my existing writing workflow. And I get multimedia publishing "for free".

      Discussed here: https://news.ycombinator.com/item?id=43157672

        Why and How I use "Org Mode" for my writing and more
        217 points by sebg 7 months ago | 64 comments
      
      src: https://github.com/adityaathalye/shite/blob/master/sources/p...
    • justinhj 2 days ago ago

      I also blog with org mode and anything that can be exported as a block of html can be easily included. Recently I dropped an interactive chart using React into the text, for example.

      • adityaathalye 2 days ago ago

        Ditto. I wanted to show JavaScript text art animation, and could "just" do this:

          *** ~setInterval~ and ~setTimeout~ worked just right
          These let us call functions that do exactly the thing we want,
          viz. punch /[[#the-aesthetic-of-text-art-and-its-animation][characters]]/
          into our "live spreadsheet" medium, exactly the way the artist
          placed them in the original art source.
        
          These methods can make a CPU sing, but hey, the awesome art
          is worth every watt it, ah, draws.
        
          #+html: <div class="box invert">
          #+html: <em>Random twitch loop <code>setTimeout</code> and recursion.</em>
          #+html: <div id="blink-demo"></div>
          #+html: </div>
          #+html: <script type="text/javascript">demoBlink();</script>
        
          #+html: <div class="box invert">
          #+html: <em>Flipbook-like frame-by-frame animation loop with <code>setInterval</code>.</em>
          #+html: <div id="glider-demo"></div>
          #+html: </div>
          #+html: <script type="text/javascript">demoGlider();</script>
        
        This works very nicely because I've structured my website as "every post is just a microsite". See:

        src: https://github.com/adityaathalye/shite/tree/master/sources/p...

          \_ (develop %|u+4) $ tree sources/posts/animate-text-art-javascript/
          sources/posts/animate-text-art-javascript/
          ├── animations.js
          ├── blink.ddw
          ├── DarkDrawSheetView.png
          ├── glider.ddw
          ├── HanukkahOfData2022ArtCopyrightDwimmertxt.png
          ├── HanukkahOfData2022ArtSliceCopyrightDwimmertxt.png
          ├── HanukkahOfData2022DarkDrawDrawingViewCopyrightDwimmer.png
          ├── HanukkahOfData2022DarkDrawSheetViewCopyrightDwimmer.png
          ├── index.org
          ├── loading.ddw
          └── spinner.ddw
          
          1 directory, 11 files
        • BeetleB 2 days ago ago

          #+html works, but why not just a proper HTML source block? Easier to edit, and you get syntax highlighting?

          • adityaathalye 2 days ago ago

            Yeah, that post was before I realised there's a better way. Now I use a proper source block with export control etc.

  • thecsw 3 days ago ago

    I was in the same boat for many years! Having started using org-mode for my website in 2018 [1] (just add index.org to the path to see the source), it grew into this massive pile of obscure gen and with my limited comfort level with lisp, turned into a scary smelling concoction of dozens of perl/sed/sh scripts that modified the output to fit my needs and have them do something fancy.

    But then, really, sat down for about 48 hours on a lonely weekend when everyone was away and wrote a simple static site generator [2] that takes exact same files and produces output that I fully understand e2e, becoming the project I'm most proud of.

    There are so many other generators I tried (hugo, jekyll, rails, asciidoctor, org-publish, astro), rolling up your own gives a sense of a stable foundation. Love your website! So clean. One thing that I'm thinking of adding (though I haven't touched my generator that much, I consider it "complete") is the dynamic execution of source code blocks.

    [1] https://sandyuraz.com

    [2] https://github.com/thecsw/darkness

    • adityaathalye 2 days ago ago

      Hah! Superfriend!

      First... Love your site (clean, fast, easy on the eyes, no need for JS to read). And your writing... yours is a proper blog. I used to feel bad about not being able to "just blog" like a real blogger, but I discovered that what I really like, is to write, in order to think. So, my blog has become part of my Big Reason to write (a lot) locally, and I am very happy to publish giant-ass blog posts; longform thinking.

      Second... I went down a very similar path to custom site-buildin'.

      Reject Wordpress because it's the 2020s -> reject anything mandating npm, gem, pip, lockfile web-scale dependency madness -> just hugo (single binary, wow) -> hugo + ox-hugo -> ouch, yet another custom templating language, and no backwards compatibility -> should I just Wordpress like it's 2005? -> NO, wait. Now I know programming. -> Voila! `shite` [1] (org-mode content -> pandoc -> plain HTML-and-CSS website [2]).

      [1] https://github.com/adityaathalye/shite (dicussed here, that one time: https://news.ycombinator.com/item?id=34486596)

        Show HN: Shite – little hot-reloadin' static site maker from shell
        141 points by adityaathalye on Jan 23, 2023 | 60 comments
      
      (The discussion will answer anyone's burning question about the project name :)

      [2] https://evalapply.org

      Third... Again... superfriend! 10000% same sentiment as yours:

      > that takes exact same files and produces output that I fully understand e2e, becoming the project I'm most proud of

      See my `shite`'s incredible documentation---animated GIFs and everything. Probably my second-best documented personal project (or tied for first-best with clojure-multiproject-example).

      Things that give me inordinate joy:

      - `shite` weighs in at ~300 Lines of Code (and why does it have 240 Github Internet Points, who are these insane people???)

      - it is truly "serverless" - I don't run a local dev server even

      - it hot-compiles and hot-refreshes on save - fully interactive local authoring (as well as live template modifications)

      - since Feb 2022, it broke (only very slightly), after I distro upgraded Ubuntu 22.04 LTS to 24.04 LTS, because pandoc changed its default handling of line breaks, breaking layout of hand-indented "verse" text.

      - Under 10 second full site rebuild, with 43 posts totalling over 100K words and over 40 more auto-generated pages (rss feed, various xmls, and per-tag blog post index pages). And I haven't even made it parallel yet. Probably will, if full rebuilds get longer than 30 seconds.

      - The resulting site scores top marks on lighthouse and even image-heavy pages render fully in under a second on 4G mobile internet. (zero analytics, or tracking javascript).

      - And my most favourite part: I've made Internet Friends because of the site! https://www.evalapply.org/about.html#standing-invitation

      It's hilarious --- I've done such sophisticated work for work, but this little piece of personal software is my pride and joy... It makes me grin almost every single day.

      May The Source be with you too! _\\ // (yes, I love mixing metaphors)

  • ashton314 3 days ago ago

    I write my blog (https://lambdaland.org) entirely in Emacs now. It's Hugo, but I use ox-hugo [1] to convert from org-mode to markdown and Hugo converts it to HTML.

    What I like about this: everything else I do is in org-mode anyway, so this fits my brain. I also have some nice org-mode tooling to make things like footnotes, margin notes, etc. look really nice.

    A little convoluted, sure, but I've seen worse. :-P

    [1]: https://ox-hugo.scripter.co/

    • adityaathalye 2 days ago ago

      I really tried hugo, but I gave up because of hugo's many annoyances --- breaking changes in versions a mere few months apart (why????), yet another arbitrary templating system, poor support for org-mode out of the box, lots of impedance mismatch with ox-hugo (a valiant effort), runs a local server for local development, injects javascript for live refresh, etc...

      Don't get me wrong, it is a really nice project which I do recommend to people who don't want to go down the path of writing their own custom site maker... The single-binary formula allows hugo to offer a much better set of trade-offs than the competition.

      But... if you can write your own, write your own. It is a glorious yak shave.

      My only tip will be to avoid all dependencies like the plague. For stability and sanity.

      The upshot... After over two years of using my dinky-ass handmade pandoc-usin' (not even parallelised) static site maker, I feel hugo is not even as fast as what I have.

      • ashton314 2 days ago ago

        > breaking changes

        Yeah, that's bitten me and it's super stupid. At this point, I've just pinned hugo so I don't update it any more. It's a friggin' static site with basically no Javascript (just a little for the site search feature—handled by the theme) so I don't feel any need to keep Hugo up-to-date.

      • dev_hugepages 2 days ago ago

        How do you implement live refresh without JavaScript?

    • Lownin 3 days ago ago

      It looks like Hugo also has native .org file support. Does ox-hugo provide functionality over Hugo’s native org file parsing?

      • ashton314 2 days ago ago

        I used Hugo's native `.org` file support for a while. It was… fine. There are some serious issues (for me) that I had with it though. The most salient one is that it didn't convert straight quotes in the source ("") to proper curly-quotes. (“”) I don't remember what else but I'm sure there was more than just that. I've spent a lot of time on the typography of my site and I wanted everything to be as perfect as I could make it.

      • globular-toast 3 days ago ago

        I started using Hugo's built-in org support, but I found it quite limiting. I can't remember the specifics, but it doesn't support everything you can do with Markdown. So I quickly switched to ox-hugo. They can co-exist though so you can try the native support then switch if you run into the same shortcomings as I did.

        • ashton314 2 days ago ago

          ^ This. Hugo's support for Markdown is much better than it's support for org-mode. ox-hugo bridges the gap super well.

      • lordgrenville 3 days ago ago

        Didn't know that Hugo supports org files. But just one example of added functionality is being able to use one big file with a subtree for each post.

        • ashton314 2 days ago ago

          This is a nice feature of ox-hugo. I still use individual files and it's great.

      • BeetleB 3 days ago ago

        It didn't back when ox-hugo was written.

    • cyrialize 3 days ago ago

      I've also thought about using ox-hugo! I have (literally) organized my life in plain text, so I keep everything in org files.

      • ashton314 2 days ago ago

        You would certainly enjoy using it then. :) It's got great documentation. (As is to be expected with basically any Emacs project.)

    • dima55 3 days ago ago

      Does org-babel work? Do equations work?

  • projektfu 3 days ago ago
  • ineedasername 2 days ago ago

    If it’s about wanting to understand your end to end workflow and you don’t mind it being “except for babel” then you could run emacs as a headless daemon and pass through to babel with emacsclient.

    It’s a bit inelegant, and lacks the complete purity of “just 2,000 lines of code”. But the sentiment is already drawing lines based on arbitrary gradations in levels of abstraction. So if it improves your workflow to switch away from the rest of emacs’ baroque cathedral of unused functionality, and you want the simplicity of your bespoke engine, just make a handful of those 2,000 lines a wrapper around some i/o through to babel.

    After all, it’s turtles all the way down on this sort of thing, at least until you’re staring at circuit diagrams of thinking, “huh, wonder if I can build it all with multi-, no, half adders..”. Further than that and you’ll probably need to learn some advanced metallurgy.

  • siavosh 2 days ago ago

    What’s the recommendation for the simplest blogging setup to say s3? Req: 0 javascript, simple css, absolutely minimal functions for blogs. My ideal is I open a text file on my Mac in vi, type my thoughts and then save and run some script to publish it and it gets the style and date and index entry automatically.

    • flexagoon 2 days ago ago

      You can set up any static site generator (like Astro or Hugo) with a pre-made blog template. Then you'll just have to write posts in markdown files and the generator will handle the rest.

      (Or you can write a custom template in any of those, they both don't add any JS or anything else to your page by default unless you explicitly add it. I like Astro more since it's basically just HTML with extra features unlike Hugo which uses a separate templating language, but they're all pretty much the same)

      You can deploy it automatically and completely for free on platforms like GitHub Pages or Cloudflare Pages, which are pretty easy to set up and will automatically build and deploy new versions of your site on every git push.

      • johanvts 2 days ago ago

        For hugo at least, you can write posts in org mode.

  • cosmic_quanta 2 days ago ago

    Babel sounds awesome, I should give it a try.

    I've been using Pandoc for my static site, which I also used for my PhD thesis. I wrote pandoc-plot[0] to render figures in documents like the author does, inspired by Matplotlib's plot-directive[1]. I feel like this feature is a must for technical writing, but getting the details right is tricky!

    [0]: https://github.com/LaurentRDC/pandoc-plot

    [1]: https://matplotlib.org/stable/api/sphinxext_plot_directive_a...

  • BeetleB 3 days ago ago

    Heh. I write my blog posts in org mode, and have a way to get Pelican[1] to read them. It doesn't support executing Babel source blocks on export - I should probably add that feature to my package.[2]

    [1]https://getpelican.com/

    [2]https://blog.nawaz.org/posts/2022/Dec/reintroducing-opel-put...

    • zenmac 3 days ago ago

      have not seen pelican before, but went with zola. IMHO a binary distro is just much cleaner than the pip/uv/npm/yarn approach. And it is fast, and can auto rendered rss/atom.

      • BeetleB 3 days ago ago

        I stuck to Pelican because it's Python, and thus easy for me to write plugins.

        And of course, it can do Atom/RSS.

    • vunderba 3 days ago ago

      I started my blog with Pelican before migrating over to Astro. I enjoyed Pelican (Python based static site generator) for the most part but the theme system wasn't to my liking.

  • whacked_new 2 days ago ago

    I was a long time org mode user and used babel extensively [1]. It was a marvelous experience, but the market chose markdown. I still drop into org-mode some times for specific features, and the babel integration is still in its own league, but technically there's nothing preventing something similar for markdown.

    I pulled some org-babel code to make a code fence evaluator for markdown a while back [2] but haven't found myself needing it that much. So without a need to wrangle reports or run exports, I think it's a 1% feature for text file connoisseurs.

    [1] https://ess.r-project.org/ with babel is an experience I find superior to jupyter tools even after all these years

    [2] https://github.com/whacked/emacs-markdown-babel

    • johanvts 2 days ago ago

      Conforming to “the market” is just a pandoc call away. I export to markdown, pdf, html and even docx all the time when i need to share with colleagues. I prefer writing in org-mode because of the complete ecosystem it offers inside emacs. But also just as plaintext I really miss src blocks in markdown.

      • iLemming 2 days ago ago

        Yup, never had no problem with that. My notes are in Org - if I ever need to grab something to share with a colleague, my yanking command is advised - with a prefix it calls Pandoc and converts to markdown and vice-versa - to get something of markdown into my notes - it all takes just a keypress.

        Following "the market" often feels like reinventing yourself over and over only for the sake of throwing that knowledge into the garbage pile of deprecation - do you guys remember the days when market dictated the use of Dreamweaver, Silverlight, SOAP and SVN?

        If market tomorrow barks that everyone should be using "Blockchain-ML" or "UltraScript Deluxe" formats, I'm not gonna convert million lines of my notes to whatever crap gets trendy. When I say "Org-mode", there's no confusion - it will remain the same even a decade later, but Markdown? Which one is it - CommonMark, GFM, MultiMarkdown, Kramdown...? It looks like we're not done "perfecting" it, maybe markdown doomed to remain in 'beta'... forever?

    • tmalsburg2 2 days ago ago

      Sure, the market chose Markdown, but this simply led me to the conclusion that the market isn’t worth following. Of course the mismatch creates some friction, but the benefits of org-mode, for me personally, easily outweigh that.

    • BeetleB 2 days ago ago

      The market also chose Internet Explorer ;-)

  • facundo_olano 3 days ago ago

    I wrote my own org-mode static generator: https://github.com/facundoolano/jorge

    More robust than my previous emacs setup and much lighter than hugo. No fancy babel generation but I don’t really need that.

  • NeutralForest 3 days ago ago

    I used to use org-mode with hugo but it got annoying, I didn't like how I needed to structure my org files, it kind of forced me into some structure. Now I use Zola with Markdown. I'm losing in power but it's so much simpler tbh.

  • ks2048 2 days ago ago

    I use Emacs, but not org-mode (or Babel). I feel like tying yourself to {emacs + format} is limiting - the format should be self-justifying - bonus if there is a good mode for Emacs.

    • iLemming 15 hours ago ago

      > the format should be self-justifying

      Well, it really is. Org-mode is absolutely amazing for anything that can be [even vaguely] expressed in the outline format - anything hierarchical - personal notes, todo-lists, documentation, wiktionary, dictionary and thesaurus entries, comment threads - yes, I read Hackernews and Reddit in Org-mode, file-system entries, plot outlines and story structures, presentation outlines, financial planning and budget breakdowns, travel itineraries and packing lists, maintenance schedules, decision trees, etc.

      Even things like .yaml or python files - sometimes converting indent-based stuff to org-mode can give you better perspective of things, because Org-mode has numerous different ways to search and express the data - someone who's never experienced using sparse trees which work like "smart filters" temporarily hiding everything except the parts matching your search, while preserving the hierarchy, may have no idea how great it is - this entire idea of this abstraction.

      It only sounds "limiting", in practice - it is supremely flexible system. It makes me really sad that I have not discovered this flexibility sooner in my life.

  • piker 3 days ago ago

    Just started my blog[1] as another way to dogfood Tritium. So far works pretty well. My posts are going to be short and simple but since Docx -> HTML conversion is straightforward, I should have more capability as the product improves as a word processor.

    I’m trying to make it a bi-weekly, 1-hour exercise but finding things to write about that might be interesting in a short window is kinda tough.

    [1] https://tritium.legal/blog

  • SoftTalker 2 days ago ago

    Almost everything I write, from programs to SQL to HTML to email, I do in emacs. I’ve tried to get Teams chat working but it just isn’t reliable so I use a browser for that.

    • GreyZephyr 2 days ago ago

      Do you have any resources for your sql workflow in emacs? I use eMacs for everything else, but keep going back to dbeaver whenever I write SQL or interact with PostgreSQL. All the tutorials I’ve turned up seem to be doing simple things with small tables, rather than a more complex workflow. I’m sure there are ways to use emacs effectively for SQL but I just can’t find out how.

      • SoftTalker 2 days ago ago

        Not really. I write SQL in text files, manage them in version control (git these days, but in the past it has been mercurial or subversion, doesn't really matter) and execute them in psql via a SQLi postgres buffer (emacs comint mode that wraps a psql command shell in a buffer).

        I haven't used (or heard of) dbeaver but took a quick look at it and I have tried other SQL tools that seem similar. Never really felt they gave me much.

        I like keeping my tools very simple.

        • GreyZephyr 2 days ago ago

          The main thing that I like is that it gives you nice table autocomplete as well as some nice metadata. As well as some connection management stuff. And it drives me mad because I am sure there must be a way to get the psql autocomplete to work in a buffer, but I have never managed it.

          • iLemming 15 hours ago ago

            Are you writing all that sql simply to examine the existing data, or you're actively writing migratory expressions and such?

            For the former - if you're willing to completely alter your perspective here, you may discover something unusually good. To understand the data, I find myself more often reaching for a Clojure REPL with basic odbc lib dependency. Clojure, at times may feel like hands-down the best tool for dealing with certain types of data. It really is great for quickly retrieving/grouping/sorting/slicing/dicing - these days I use it for exploring JSON results from APIs (that I automatically convert to EDN), or for dealing with DB data.

            And you can perfectly manage that in org-source blocks too - I typically keep at least one Clojure REPL instance running in Emacs - I'd connect to it and go like:

                  (-> (select :*)
                      (from :users)
                      (where [:= :status "active"])
                      (limit 5)
                      (group-by :user_id) ...)
            
            For someone with no clue, all these parens may feel like annoyance, for me, they are the best way to deal with structured expressions - composing and writing them is far more satisfactory than even writing plain sql. Although, sure - sql can be a mind-blowing, great tool on itself.
            • GreyZephyr 4 hours ago ago

              For the exploratory stuff I tend to use R in code blocks as I’m familiar with it. Sadly I’ve never really done much with Clojure, though its data capabilities always look very cool, especially datatomic. It’s just always been a bit of a poor fit for what I’ve been doing so I’ve never quite got round to it. Maybe this will give me the push I need!

              Sadly the things where the extra tooling is missed is more in larger databases where I’m either rebuilding or restructuring an existing database or writing more complex queries to help with this and I want to do it all in the database. Hence autocomplete and general knowledge of the schema being built in is nice.

          • SoftTalker 2 days ago ago

            I didn't even realize psql had autocomplete. It's nice, but I pretty quickly learn the table and column names I'm working with, or I just run \dt and copy/paste from the output. I guess I understand if someone would find that tedious; I learned to program before autocomplete was a thing in any editor, and I'm just used to it.

            All the autocomplete and other smart editor features quickly outrun the speed at which I can think about what I'm doing, so I find them of limited use.

    • internet_points 2 days ago ago

      i would pay real money to get teams chat in emacs (though I'd pay more to get my customers to stop using teams)

      • iLemming 2 days ago ago

        What's your wish for? Navigating the chats more efficiently, or simply typing the messages? If the latter, why haven't you figured out a workflow where you do all your typing in Emacs, or whatever your choice of an editor is?

        I have done that years ago and I just can't imagine my life without this feature. I never even try to type directly, anything longer than three words - in Slack, Browser, Teams, Outlook, whatever. There are packages like emacs-everywhere, but I don't use that. My technique is simple and I usually get it to work on every WM and system I use. It basically simulates Cmd|Ctrl+A & Ctrl+X, and via emacsclient opens a dedicated buffer and sends the text+PID. When done, pressing a key copypastes the text back into the app of the PID.

        I can't recommend that enough - being able to use all the tools you have in your editor - completions, spellchecking, thesaurus, etymology lookup, translation and dictionaries, search of all kinds, etc., is absolute and pure joy.

        • johanvts 2 days ago ago

          Nice, so how do you trigger the client? I could see something like this working via autohotkey

          • iLemming 2 days ago ago

            I don't use Windows these days. For Mac I wrote a simple Hammerspoon script; on Linux I do this on every WM I use - they typically have a way. You just need to call emacsclient to load a helper elisp script, e.g., https://github.com/agzam/spacehammer/blob/master/spacehammer...

            • SoftTalker 2 days ago ago

              Amazing. I never considered this possiblity. Definitely going to spend some time looking into this. I use Awesome WM which is pretty extensible. I will have to figure out what to do when Wayland becomes the only display server.

  • m-hodges 3 days ago ago

    > Any lightweight markup format (like Markdown or ReStructuredText or whatever) allows for embedding code blocks, but Org, through Babel, can run that code on export, and then display the output in the published document, even when the output is a table or an image.

    This is what I love about blogging with Quarto.

    • zelphirkalt 2 days ago ago

      On their website Quarto look just like normal JupyterLab notebook interface. Does it do anything extra?

      One advantage of org-babel is, that one can not only to segmented code execution, but one can specify the dependencies of source blocks and thus doesn't have to run them top to bottom or choose how to run them manually. One simply includes blocks by their name in other blocks and everything will run in the specified order. It shouldn't be too hard to build that into IPython Notebooks, but somehow no one has properly done that yet, or it completely bypassed me, while I still worked with ipynbs for years.

  • dzonga 3 days ago ago

    do people also realize you can blog with .txt files ?

    write a txt file, scp then let whatever server serve the files.

    • interroboink 3 days ago ago

      Basically the .plan file revived (: [1]

      John Carmack was well-known for keeping his development notes and other thoughts in a .plan file[2][3]

      Aside: it saddens me a little how the simple idea of copying files onto a server is so many steps removed from modern "web framework" behemoths. I think some people genuinely don't know about the simpler older ways, and the pros and cons between them.

      [1] https://unix.stackexchange.com/questions/122782/what-is-plan...

      [2] https://garbagecollected.org/2017/10/24/the-carmack-plan/

      [3] https://github.com/oliverbenns/john-carmack-plan

      • piker 3 days ago ago

        Man, he was so productive.

        https://github.com/oliverbenns/john-carmack-plan/blob/master...

        frag bar

        start profile on late frame

        fixed relinking bug

        improved prediction bounding

        change weapon chooses supers first

        ammo pictures on status bar

        drop pain flash again and bound

        tweak armor and spike damages

        don't pick up equal armor

        ceiling doors don't cause damage

        demons crash when jumping

        monsters need to use bsp clipping

        need to save memory...

        Fatal error: NaN impact time from entity

        change armor damage

        drop weapons

        face to face with nailgun does no damage

        +pointfile from cmdline doesn't work

        conglomerate hunk printing

        shoot triggers

        missing a Z update on rockets sometimes?

        firing after net games

        negative scores on frag bar and frag board

        world backpack and armor model

        weapon bounce down

        center look key

        check change levels in high res mode

        show ammo counts in single player

        frag screen

        radius damage should open secret doors

        five point font on kills

        rocket poke into walls

        shoot open connected doors

        gib bounce sound

    • chlorion a day ago ago

      I use org mode files, a small build script and git.

      The build system just invokes emacs and compiles org documents to HTML, and installs them in /var/www/${site}. I have a git update hook on the server that invokes the build script when I push updates.

      Originally I did just rsync over HTML files though, but I like the new setup a lot.

    • deafpolygon 2 days ago ago

      Yep, 99% of markdown is basically a title on the first line, body in the rest.

  • dima55 3 days ago ago

    I blog with emacs using the long-abandoned o-blog generator. Anybody have something better? Using the org-mode exporter, with working org-babel and equations and all that. This article doesn't go into the details.

    • EnigmaCurry 3 days ago ago

      > Anybody have something better?

      I wrote this to publish Org docs to S3 - https://github.com/EnigmaCurry/s3-publish.el - I wanted something extremely lightweight, not even wanting to commit things to git like I normally would and waiting for CI to build something. Uploading html directly to S3 means it gets published in <1s from push.

      • sandinmyjoints 3 days ago ago

        That's neat! For org, if it had an option to generate the HTML file name from slugifying the org file name instead of the salted hash, it could be fantastic for rapid lightweight blogging.

      • kstrauser 3 days ago ago

        o-blog in the parent comment reminded me that I use to use a similarly named SSG called blogofile, and what do you know. Small world.

        • EnigmaCurry 2 days ago ago

          yes I used to use it too :) I think I've written three or four SSG since then haha.

  • contrarian1234 2 days ago ago

    Orgmode is what got me to stick with Emacs for a long time. Used it for years for static webpages, but eventually moved to Asciidoc.

    I think the fundamental issue is that having your markup language tied to an editor is .. insane? (yeah I know there is some iOS app that also supports it..)

    • iLemming 2 days ago ago

      > having your markup language tied to an editor

      Org-mode isn't just a markup though, and Emacs ain't just an editor - it's rather one cohesive system. I use Org-mode to manage all my dotfiles - it simpler than nix or ansible, allows me to do things both - declaratively and with linear instructions; My note-taking is all done in Org-mode; I don't have to present much these days - I did that with Org in the past. My spaced-repetition cards are in Org-mode. Whenever I need performing etymology look-up or check the thesaurus - results displayed in Org-mode. I'm reading this page in Org-mode and typing this comment in Emacs.

      It only sounds insane, but the basic outline format of Org is absolute pinnacle of simplicity. So many things you can do in it, sure it may feel absurd. What? Reading HN and Reddit in Org-mode? Well, why not? If all the different things like imenu, search features of all kinds, sorting, conversion, etc. - all that available at your fingertips, not to mention the extreme extensibility; it does get only practical over time.

      • contrarian1234 a day ago ago

        yeah, that's exactly where I didn't want to end up. I want my constellation of tools to be as interoperable as possible. I don't want to be locked in to the Emacs universe - hoping some greybeard makes a package for whatever I want to do.

        Just as a simple example:

        > My spaced-repetition cards are in Org-mode

        Okay, so for instance Anki now has an improved algorithm called FSRS. It's greatly improved my flashcard experience. Maybe at some point this will be available in an orgmode flashcard package.. but I'll have to wait. Or maybe it'll never get implemented

        I rather use the best tools for the job and find ways to make them interoperate

        But I respect your commitment to the Emacs microcosm. I think it make s a lot of sense.

        A big part of it, is I simply don't want to write ELisp to fix my problems. It's not a language I want to get very proficient with. I hope some day there is a JVM equivalent, b/c I honestly could see myself working in a Clojure Editor and making JVM based extensions - (the JVM has a library for everything)

        • iLemming 16 hours ago ago

          > I want my constellation of tools to be as interoperable as possible.

          Unironically, that's exactly what knowing some Lisp and Emacs gets me, and it seems to me you simply have very little idea what I'm talking about. You're focusing on so much explicit knowledge of things, that you're missing an entire universe of tacit wisdom - the things that can open up ways for cerebral satisfaction - not through some theoretical argy-bargy, but through down-to-earth, unadulterated pragmatics.

          I never said that I'm using Emacs for practicing spaced-repetition - I don't use it to flash the cards to me. Why would anyone use a desktop computer for something like that, when the mobile devices are clearly more suitable for that task? I do however manage my cards in Emacs - because most of the time they are made of plain text, sometimes LaTeX embeddings and attached images. I do that in Emacs, because my spaced-repetition cards are not in some other medium - they literally are my notes, part of my exocortex system. I can easily find them, review them, modify them and send back to Anki app for syncing, so they are ready for my next time two-minute practice. These days I can even feed any content to LLM to generate dozens of cards, and it takes seconds, not even minutes.

          > I simply don't want to write ELisp to fix my problems

          Your choice, but honestly? You're missing out. Elisp is relatively straightforward and unambiguous PL - far less complicated than even JS or Python, it really doesn't take too long to get to know it.

          I can give you numerous practical, working, real-life examples of how using Lisp in Emacs can bring enormous joy and the sense of liberation from the status-quo. It is indisputably true "hacker's playground".

          I understand your fascination with Clojure - I use it daily myself, and similarly, just like you're not getting my talking points right now - majority of programmers don't get my enthusiasm for it. What they often be missing is that Clojure sometimes can feel like a godsend for achieving certain results. Just the other day - we were dealing with a Python-built service that sends huge nested maps around, and we needed to manipulate them, splitting into smaller sub-structures and dealing with them in Python wasn't particularly easy. Well, I quickly concocted a tiny elisp function that calls python and converts the data to EDN. It's only ten lines of elisp and it does it right there - in the same buffer. Then I spun-up a Clojure REPL, where I explored the map, filtered out the keys, introspected it in ways that wouldn't be so satisfactory using plain python tooling alone. Some pythonistas with no exposure to Clojure would call that "a skill issue", without even realizing that the skills and intuition I developed over the years are precisely the instruments that allow me to deal with everyday tasks in ways that never materialized for them.

          I don't know for how long you've been doing this craft, and please, feel free to ignore whatever I'm saying - after all, I'm nobody - just some rando on the internet, yet, if you just allow me some non-condescending, honest mentoring here...

          The tools we gravitate toward often say more about our past experiences than about the problems we're trying to solve. I've been there - I once avoided entire ecosystems because they weren't in "my" language. But here's what I've learned: every tool, every language, every paradigm is just another human attempt at managing complexity. None are sacred.

          Elisp might feel alien compared to other things you know well, but that alienness is worth examining. What if the friction you're feeling isn't a flaw but a feature? What if Elisp's simplicity and directness - its lack of certain abstractions you're used to - is actually freeing you from complexity you didn't need?

          Software is storytelling, and different languages tell different kinds of stories. The JVM tells stories about enterprise scalability and library ecosystems. Elisp tells stories about text manipulation and user empowerment. Neither is wrong, but using the JVM to deal with plain text is like using a symphony orchestra to play a lullaby - you can do it, but you might be missing the point.

          Maybe try suspending your language preferences for just a month. Write some Elisp. Maybe not a lot - just enough to solve one real problem you have. You might find that the language you "don't want to get proficient with" has been whispering solutions you couldn't hear over the noise of your preferences.

          If you really, genuinely curious what knowing just a bit of Emacs can buy you, feel free to ping me, I may even agree to arrange a video-call session to show you things I do every day and compare them with your habitual workflows - who knows, maybe tis not I, but rather you, will be teaching me something new.

          • contrarian1234 38 minutes ago ago

            > Elisp is relatively straightforward and unambiguous PL - far less complicated than even JS or Python, it really doesn't take too long to get to know it.

            > Maybe try suspending your language preferences for just a month. Write some Elisp. Maybe not a lot - just enough to solve one real problem you have. You might find that the language you "don't want to get proficient with" has been whispering solutions you couldn't hear over the noise of your preferences.

            I've written a good amount of ELisp. I wrote a small linear algebra library in it. I feel I gave it a very good honest try. I read all the manuals and what not. Actually thinking back on how much time i spent trying to grok it.. I'm a bit horrified. Fortunately it lead me to Clojure, so it's not all lost time. I'm definitely not a pro by any stretch. I know this might come as a shock to you, but I always found it an absolute chore to work with. Constantly finicky. The worst is dealing with other people's Elisp code. It's is hard to read, hard to understand how to configure and modify packages. There is so much global state that you have zero insight into what's actually going on.

            I still use Emacs b/c of CIDER. The thing leak memory like crazy and I have to reboot it every couple of days. I used to use Ergomacs, but that would also lag the whole editor a ton. There are tons of broken things.. error buffers popping up where I don't want them to, keybindings that work everywhere but Magit etc etc. It's all probably fixeable but it's so difficult to understand what the hell it going on. Each EMacs version bump is like a day or two of lost time of me trying to fix the damn thing. The JVM/Clojure world is so so much easier and straightforward and easy to deal with. There are so many great tools for debugging and profiling. It's night and day. "like using a symphony orchestra to play a lullaby" I just never ever feel that way...

            I only program a few hours a week now a days. It's not my full time job these days. But deal with Emacs' warts is a full time job. Even after all my ELisping, I still have very little understanding or insight in to EMacs actual internal design and modularity (if it even has any). This is in stark contrast to Clojure - which is modular and extensible by design

            > But here's what I've learned: every tool, every language, every paradigm is just another human attempt at managing complexity

            Some languages are better than others. I learned a ton from C++. But some languages.. there are no paradigms in ELisp that I miss in Clojure. I've written a lot of R. I don't miss anything from that poorly designed monster. It didn't teach me anything - other than that some ecosystems live on for too long by inertia. Some languages are just old and bad b/c they're from a period of time where people hadn't figured things out a bit more. I'm sure there are nuggets o ELisp that I just never dug down deep enough for, but to me it just feels dated. ELisps and Schemes are fun and cute, but they're just not a good way to express abstractions and complex ideas. A lot of ideas just hadn't congealed when it was designed. Baking in datastructures in Clojure is just genius. Making Protocols central to the language just rams home all the lessons we've had over the decades about composability and OO design over the year. I don't want to go back to writing cons cells

  • lloydatkinson 2 days ago ago

    Given the context of static site generators, I assumed it was something to do with Babel the JavaScript compiler.

    • iLemming 2 days ago ago

      This is actually a legit complaint. The proper naming would be "Org-Babel" - even in the context of Emacs it's almost always, invariable prefixed.

  • 1oooqooq 2 days ago ago

    i still have no idea what's babel. i think, maybe, it's not the js transpiler, but not even sure

    • Jtsummers 2 days ago ago

      Just one Google search away, also linked at the top of this page: https://orgmode.org/worg/org-contrib/babel/intro.html

      Literate programming + code execution in org mode files. You can run code for most languages (all if you're willing to add in the hooks for those not supported out of the box). Turns any org file into a notebook (in the Maple, Mathematica, Jupyter, etc. sense), and since org files are easily exported into other file formats, you can execute the babel blocks in the exporting process to have an up-to-date execution of your program/notebook.

  • agentultra 3 days ago ago

    I mean that 2000 lines, I assume, is going to only be that many lines because it will have 20-50k lines of dependencies under it.

    It’s not a bad idea to understand the software you use. A matter of where you want to spend your time. Learning about the org-mode internals is also a valid choice.

  • Jenny858 3 days ago ago

    [dead]

  • animanoir 3 days ago ago

    [dead]

  • _wire_ 3 days ago ago

    [flagged]

    • indigodaddy 3 days ago ago

      So we shouldn't ever post anything about what we find interesting or useful in tech/computing then?

    • txru 3 days ago ago

      That's a fancy way to say something pretty mean.

    • exe34 3 days ago ago

      That should stop all the LLM posts right in their track!

    • SvenL 3 days ago ago

      What to write about then? Hobby - yes, your human, humans have hobbies so it’s not noteworthy. Food, travel… yes we know that we need to eat, yes we know we live on a planet with places on it.

      Nothing would be noteworthy to post because everything is about obvious if we abstract it to some basic underlying principle.

  • improgrammer007 3 days ago ago

    [flagged]

  • Quekid5 2 days ago ago

    I never wrote a blog... and it's fine.