Live data from Hacker News

Literate Devops with Emacs Org-Mode (2014)

howardism.org

51–60 of 86 posts

Re: Literate Devops with Emacs Org-Mode (2014)

#51

Earlier quoted context omitted.

I've been looking for a similar solution - albeit not for HTML - but haven't found anything convincing so far. My train of thought was: It'd be great to have a a canonical XML format for org files to export to, since after that, you could essentially write XSLT transforms for almost any target format (even back to org-files to go full circle). In my case, that e.g. would be odt-files with branding for the organizatio…

Pandoc supports org-mode, so you should be able to use it to convert to DocBook, which you can then use with XLST (pandoc also supports HTML directly, by the way).

If I remember correctly, I had a look at the pandoc option, but got to the conclusion that this way, I would throw away useful 'syntactical' information (for example, I use todo-flags, tags and timestamps to track open tasks).

If you use org-mode without the need to extract such specific information (and are only interested in generating a document), pandoc might of course be a good way to go.

Edit: ...or maybe there even is a hack to identify and extract things like timestamps anyway. I didn't look into it that much.

Re: Literate Devops with Emacs Org-Mode (2014)

#52
post #2

Org-mode & Magit really are the secret superpowers of modern emacs. And notmuch (full-text search of one's email, at least one order of magnitude faster than Gmail's!). And elfeed. And gnus. And dired. And pretty much everything else in emacs …

I know it's being worked on but every time I see posts about how great magit is, it pains be because my experience is that it continues to be ungodly slow on MacOS. Other MacOS/Emacs folks, is my experience considered atypical at this point?

M-x profiler-start

M-x magit

M-x profiler-report

You can accomplish a surprising amount of optimisation after seeing what it is that takes time.

Re: Literate Devops with Emacs Org-Mode (2014)

#53

Earlier quoted context omitted.

How slow is ungodly slow to you? It's pretty slow on Firefox's code base but that repo is huge. For most things it's not lightning fast but definitely not ungodly slow.

Oh, yeah, gecko is not a fair comparison at all for any git utility. Even on my beefy linux box, m-c takes an age to load under magit. Even doing CLI-based interactive rebases takes a while. Yay 300k+ commits.

Is there a tool for git that only downloads the last say 1000 or 2000 commits or is a full history tree fundamental to git working correctly?

Re: Literate Devops with Emacs Org-Mode (2014)

#54
post #47

So "Literate DevOps" is writing comments in your shell scripts and running the commands line by line? I agree it's a good idea. I do similar things when writing PowerShell scripts (can run them line by line using PowerShell ISE). EDIT: If you're going to downvote me, it'd be better to explain why.

I didn't downvote but I'll try to explain. Is the fact that you got the idea exactly backwards: is not about putting comments on your scripts. Is about writing an article, intended to be read by humans, that is also executable. Imagine it this way: Suppose you are reading a blog post on how to install, configure vagrant and install drupal on it. The article is pretty clear an well written and you enjoy it. And you al…

I’ve started to use Jupyter notebooks, with devop recipes as different sections, for this.

You can keep the notebook in the repo if you do two (or three) things:

1. The scripts read passwords from a key store instead of the notebook source. I wrote a Python package for doing this easily in Python cells; for bash, I just use subcommands.

2. A git pre-commit hook clears the notebook output cells.

3. (Optional) A git pre-commit or pre-push hook searches for text that looks like private credentials.

Re: Literate Devops with Emacs Org-Mode (2014)

#55
post #2

Org-mode & Magit really are the secret superpowers of modern emacs. And notmuch (full-text search of one's email, at least one order of magnitude faster than Gmail's!). And elfeed. And gnus. And dired. And pretty much everything else in emacs …

I know it's being worked on but every time I see posts about how great magit is, it pains be because my experience is that it continues to be ungodly slow on MacOS. Other MacOS/Emacs folks, is my experience considered atypical at this point?

That won't be much of a problem anymore once Emacs 26.1 is released. Meanwhile you can use the latest release candidate - those usually are very solid. For more information see https://magit.vc/manual/magit/MacOS-Performance.html.

Re: Literate Devops with Emacs Org-Mode (2014)

#56

Earlier quoted context omitted.

Oh, yeah, gecko is not a fair comparison at all for any git utility. Even on my beefy linux box, m-c takes an age to load under magit. Even doing CLI-based interactive rebases takes a while. Yay 300k+ commits.

Is there a tool for git that only downloads the last say 1000 or 2000 commits or is a full history tree fundamental to git working correctly?

It's the --depth option for git clone/fetch: https://www.git-scm.com/docs/git-clone#git-clone---depthltde...

Re: Literate Devops with Emacs Org-Mode (2014)

#57
post #47

Earlier quoted context omitted.

I didn't downvote but I'll try to explain. Is the fact that you got the idea exactly backwards: is not about putting comments on your scripts. Is about writing an article, intended to be read by humans, that is also executable. Imagine it this way: Suppose you are reading a blog post on how to install, configure vagrant and install drupal on it. The article is pretty clear an well written and you enjoy it. And you al…

> "That is literate programming, is closer to a jupyter notebook than to 'comments on scripts'." Surely that's a matter of perspective? Imagine you have a text document containing one command and one description of that command. Is this a literate programming document or not? Furthermore, does the mode change depending on which tool is used to open the source file? For example, if I open a Bash script in a text edito…

Answering questions one doesn't like is better than voting them down.

Re: Literate Devops with Emacs Org-Mode (2014)

#58

Earlier quoted context omitted.

Org-mode has been nice the few times I've tried it, but without decent mobile support or multi-master syncing, it's hard to adopt it as my main productivity tool. I've tried a few mobile org-mode clients and been universally disappointed. I'm increasingly convinced that the right path forward is to give Emacs an Android port (it's not that hard) and let the mobile org just be the mainline org, perhaps with a layer of…

I use dropbox for multi-master syncing. Seems to work ok. Emacs even has some file locking stuff that seems to help prevent me from clobbering changes I've made on another machine

You mean you're modifying files stored in Dropbox from your phone? What sort of editor setup do you use?

Re: Literate Devops with Emacs Org-Mode (2014)

#59
post #2

Org-mode & Magit really are the secret superpowers of modern emacs. And notmuch (full-text search of one's email, at least one order of magnitude faster than Gmail's!). And elfeed. And gnus. And dired. And pretty much everything else in emacs …

Org-mode has been nice the few times I've tried it, but without decent mobile support or multi-master syncing, it's hard to adopt it as my main productivity tool. I've tried a few mobile org-mode clients and been universally disappointed. I'm increasingly convinced that the right path forward is to give Emacs an Android port (it's not that hard) and let the mobile org just be the mainline org, perhaps with a layer of…

I've been pretty happy with Orgzly on Android, but that's probably because I don't want that much from it. I don't really like typing more than a sentence or two at a time on a phone, so I never expected to do any serious editing of Org mode files on a phone. What I do want, and feel Orgzly adequately provides, is the ability to read my Org files, mark things as DONE or put check marks in checklists, and capture one sentence notes that I later fill out and refile, once I'm sitting in front of a real keyboard.

Re: Literate Devops with Emacs Org-Mode (2014)

#60
post #4
post #2

Org-mode & Magit really are the secret superpowers of modern emacs. And notmuch (full-text search of one's email, at least one order of magnitude faster than Gmail's!). And elfeed. And gnus. And dired. And pretty much everything else in emacs …

Is there some way to tell org exactly how I want it to spit out HTML? I was going to do my blog entirely with org-mode+org-publish, but it spits out a mess of HTML and also a small bit of js for some reason, so I'm just writing html directly myself now. I don't really find writing html myself all that annoying or anything, but it'd be nice if I could get org to generate really clean/simple HTML for me that I could th…

I doubt there's anything actually wrong with the HTML that Org produces that would keep you from putting it in a blog, but you can certainly configure things to your liking. At the very least you can easily modify the HTML preamble and postamble, the javascript script tags and the CSS in style tags that Org's HTML export produces. All of those are just strings stored in variables that you can customize: org-html-preamble, org-html-postamble, org-html-scripts and org-html-style-default. There's more stuff you can configure by just reassigning some variable, see the file ox-html.el.

If tweaking those is not enough for you, you can write your own HTML export. You wouldn't have to parse Org syntax: you'd receive the Org markup already parsed into a nested list structure. If you don't use many Org features, writing an Org backend that supports only those probably isn't that much work. And you'd have ox-html.el to base your own backend on.

Post reply on HN