Emphasize Text By Dragging Mouse in Org-mode

Long story short, I came up with an idea to emphasize content while I was reviewing an org-mode document a few months ago after I was tired of typing tedious * around the content repeatedly. And I've been longing for this feature since then, because I was unfamiliar with mouse-based key bindings, and neither did I have the time to investigate it.

Today I finally nailed it down while I was attending a boring meeting, and it turned out to be quite simple. The exploration journey was not much different than before. First, I managed to find out how to bind a command to a mouse event, taking advantage of the good-old C-h k and (info "emacs") (or here at gnu.org). And then wrote a few lines of code to perform the task standing on the shoulder of Advice.

[Read More]

A Bookmarklet for Copying a Link as an Org-mode Link

In this blog post, I'd like to share a bookmarklet for copying a web page's URL as an org-mode link on Firefox, Chrome, or whatever web browsers support bookmarklets.

It's handy when the URL isn't SEO-friendly, which means you can't tell what its content is about at first glance of the URL. So a little description text on the link would help.

Here is the bookmarklet:

javascript:window.prompt("Copy to clipboard: Ctrl+C, Esc", "[[" + document.location.href + "][" + document.title + " - " + document.location.hostname + "]]");

// Don't know why the page becomes blank after using it on Firefox, so use alert instead.
javascript:alert("[[" + document.location.href + "][" + document.title + " - " + document.location.hostname + "]]");

Add a new bookmark on the browser, give it a name, such as (org-link), and then copy and paste the content as URL, just like below on Firefox:

[Read More]

Generating org-mode Outlines for wikiHow Articles

Recently I found some great articles on wikiHow, then I want to keep notes of them in org-mode files.

At first, I manually copied the ToC of articles, but soon I found it's tedious and takes a lot of time. Today I wrote a requests-based Python script to help me extract the ToCs (Table of Content) into org-mode outlines. It takes two arguments, the first one is the URL, the second one is the containing heading's level for the generated ToC in org-mode.

[Read More]