6 ms·
Babel is why I keep blogging with Emacs
https://orgmode.org/worg/org-contrib/babel/ https://orgmode.org/worg/org-contrib/babel/
- animanoir 1y ago[dead]
- _wire_ 1y ago[flagged]
- indigodaddy 1y agoSo we shouldn't ever post anything about what we find interesting or useful in tech/computing then?
- txru 1y agoThat's a fancy way to say something pretty mean.
- exe34 1y agoThat should stop all the LLM posts right in their track!
- SvenL 1y agoWhat 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.
- BeetleB 1y agoHeh. 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/ https://getpelican.com/ [2]https://blog.nawaz.org/posts/2022/Dec/reintroducing-opel-put-all-your-pelican-posts-in-one-org-file/ https://blog.nawaz.org/posts/2022/Dec/reintroducing-opel-put...
- zenmac 1y agohave 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 1y agoI stuck to Pelican because it's Python, and thus easy for me to write plugins. And of course, it can do Atom/RSS.
- vunderba 1y agoI 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.
- NeutralForest 1y agoI 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.
- Arubis 1y agoIf you ever happen to go back, https://ox-hugo.scripter.co/ https://ox-hugo.scripter.co/ has a couple different options for supported structures. I use it for https://dylanfitzgerald.net https://dylanfitzgerald.net without much issue.
- dima55 1y agoI 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 1y ago> Anybody have something better? I wrote this to publish Org docs to S3 - https://github.com/EnigmaCurry/s3-publish.el 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 1y agoThat'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 1y agoo-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 1y agoyes I used to use it too :) I think I've written three or four SSG since then haha.
- thecsw 1y agoI 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 https://sandyuraz.com [2] https://github.com/thecsw/darkness https://github.com/thecsw/darkness
- adityaathalye 1y agoHah! 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 https://github.com/adityaathalye/shite (dicussed here, that one time: https://news.ycombinator.com/item?id=34486596 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 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 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)
- agentultra 1y agoI 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.
- ashton314 1y agoI write my blog (https://lambdaland.org 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/ https://ox-hugo.scripter.co/
- Lownin 1y agoIt looks like Hugo also has native .org file support. Does ox-hugo provide functionality over Hugo’s native org file parsing?
- lordgrenville 1y agoDidn'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 1y agoThis is a nice feature of ox-hugo. I still use individual files and it's great.
- BeetleB 1y agoIt didn't back when ox-hugo was written.
- globular-toast 1y agoI 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.
- 1y ago
- improgrammer007 1y ago[flagged]
- projektfu 1y agoFWIW, org's HTML export is about 4000 lines of elisp, and it is pretty well modularized. https://git.sr.ht/~bzg/org-mode/tree/main/item/lisp/ox-html.el https://git.sr.ht/~bzg/org-mode/tree/main/item/lisp/ox-html.... The publish front end is in https://git.sr.ht/~bzg/org-mode/tree/main/item/lisp/ox.el https://git.sr.ht/~bzg/org-mode/tree/main/item/lisp/ox.el and https://git.sr.ht/~bzg/org-mode/tree/main/item/lisp/ox-publish.el https://git.sr.ht/~bzg/org-mode/tree/main/item/lisp/ox-publi...
- Jenny858 1y ago[dead]
- akkartik 1y agoThis 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 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.
- justinhj 1y agoI 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 1y agoDitto. 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/posts/animate-text-art-javascript 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
- m-hodges 1y 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 1y agoOn 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 1y agodo people also realize you can blog with .txt files ? write a txt file, scp then let whatever server serve the files.
- interroboink 1y agoBasically 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-for-users https://unix.stackexchange.com/questions/122782/what-is-plan... [2] https://garbagecollected.org/2017/10/24/the-carmack-plan/ https://garbagecollected.org/2017/10/24/the-carmack-plan/ [3] https://github.com/oliverbenns/john-carmack-plan https://github.com/oliverbenns/john-carmack-plan
- piker 1y agoMan, he was so productive. https://github.com/oliverbenns/john-carmack-plan/blob/master/archive/1996-02-21.md 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
- deafpolygon 1y agoYep, 99% of markdown is basically a title on the first line, body in the rest.
- facundo_olano 1y agoI wrote my own org-mode static generator: https://github.com/facundoolano/jorge 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.
- piker 1y agoJust 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 https://tritium.legal/blog
- siavosh 1y agoWhat’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 1y agoYou 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 1y agoFor hugo at least, you can write posts in org mode.
- SoftTalker 1y agoAlmost 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 1y agoDo 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 1y agoNot 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 1y agoThe 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.
- SoftTalker 1y agoI 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.
- Quekid5 1y agoI never wrote a blog... and it's fine.
- ks2048 1y agoI 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 1y 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.
- cosmic_quanta 1y agoBabel 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 https://github.com/LaurentRDC/pandoc-plot [1]: https://matplotlib.org/stable/api/sphinxext_plot_directive_api.html https://matplotlib.org/stable/api/sphinxext_plot_directive_a...
- 1oooqooq 1y agoi still have no idea what's babel. i think, maybe, it's not the js transpiler, but not even sure
- Jtsummers 1y agoJust one Google search away, also linked at the top of this page: https://orgmode.org/worg/org-contrib/babel/intro.html 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.
- whacked_new 1y agoI 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/ 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 https://github.com/whacked/emacs-markdown-babel
- johanvts 1y agoConforming 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 1y agoYup, 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 1y ago
- ineedasername 1y agoIf 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.
- lloydatkinson 1y agoGiven the context of static site generators, I assumed it was something to do with Babel the JavaScript compiler.
- iLemming 1y agoThis is actually a legit complaint. The proper naming would be "Org-Babel" - even in the context of Emacs it's almost always, invariable prefixed.
- contrarian1234 1y agoOrgmode 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 1y 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 1y agoyeah, 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)