News for hackers. Stuff that matters.
Re:Laverna – A Markdown note-taking app focused on privacy by kaushalmodi on Sunday August 20, 2017 @09:39AM (#15058363)
> Emacs, and is on its way out

Being active on the Emacs and Org mode mailing lists, and other forums, I can say with confidence that this is not true.

In fact, I am seeing active development in both Emacs and Org; not just bug fixes, but frequent additions of new features.

> org-mode is only any good if you're using the full power of it (tasks, agenda, etc), which is buying into

Org markup is much more powerful than Markdown. So you can be much more productive by using Org just as markup. One example is '#+INCLUDE: "foo.py" :lines-5-10'.. This is tremendously useful if you are writing notes that export to some format or blogging.. you don't need to copy-paste code snippets, Org will fetch them for you. (I have a customization built on top of that.. instead of specifying the line numbers, I can specify the start and end regexp for the lines containing my snippet). Add org-babel to this mix, and you don't even need to run the snippets, and copy the results manually; again Org does it.

I recently blogged about comparing string related functions between Python and Nim: https://scripter.co/notes/string-functions-nim-vs-python/

I cannot imagine myself writing (and maintaining) that post in Markdown!

On the next update of Nim version, I'll simply run org-babel over the whole file, see git diff to check if anything major has changed, and update the post accordingly.. no copy/pasting ever :)

> a system that's soon going away.

Again, really? What made you think that?

Re:Laverna – A Markdown note-taking app focused on privacy by mongol on Sunday August 20, 2017 @12:53PM (#15059136)
> I recently blogged about comparing string related functions between Python and Nim: https://scripter.co/notes/string-functions-nim-vs-python/ I cannot imagine myself writing (and maintaining) that post in Markdown!

Convincing!

I am curious about the org-source you used for that article, is it public?

Re:Laverna – A Markdown note-taking app focused on privacy by kaushalmodi on Sunday August 20, 2017 @01:08PM (#15059192)
Yes, here's the source:

- source of that specific post in raw org [1] - site source [2]

[1]: https://gitlab.com/kaushalmodi/kaushalmodi.gitlab.io/raw/mas...

[2]: https://gitlab.com/kaushalmodi/kaushalmodi.gitlab.io

(I wish HN supported some markup :P)

Re:Laverna – A Markdown note-taking app focused on privacy by mongol on Sunday August 20, 2017 @01:38PM (#15059341)
Thanks! How did you edit that? As shown? I assumed it included many INCLUDEs?
Re:Laverna – A Markdown note-taking app focused on privacy by kaushalmodi on Sunday August 20, 2017 @07:23PM (#15060755)
That, I have edited as shown (except the snippet outputs). That was an example of using Org Babel. Note that the #+RESULT blocks in that file are all auto-generated; none hand-written.

That post does not have any #+INCLUDE because all the code snippets are trivial. I would use #+INCLUDE in posts where I have a code file, and I want to talk about only few lines from that.

I have different examples of #+INCLUDE in my examples file[1] for my Org to Markdown for Hugo exporter -- ox-hugo[2]. There I use the inbuilt INCLUDE feature where I choose to include only the specified Org sub-tree (using the sub-tree CUSTOM_ID). The above referenced post on Nim/Python is converted to Markdown for Hugo using the same exporter.

[1]: https://raw.githubusercontent.com/kaushalmodi/ox-hugo/master... [2]: https://github.com/kaushalmodi/ox-hugo

Re:Laverna – A Markdown note-taking app focused on privacy by sillysaurus3 on Sunday August 20, 2017 @10:21AM (#15058489)
(I have a customization built on top of that.. instead of specifying the line numbers, I can specify the start and end regexp for the lines containing my snippet).

This is awesome. Is this available anywhere? I'd like to use it.

Re:Laverna – A Markdown note-taking app focused on privacy by kaushalmodi on Sunday August 20, 2017 @10:57AM (#15058629)
Re:Laverna – A Markdown note-taking app focused on privacy by willtim on Sunday August 20, 2017 @04:00PM (#15059993)
Thank you! I had been meaning to write something like this for myself. It's more useful than line numbers, which typically change often.