<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Org-Mode on Ken Huang</title>
    <link>https://blog.kenhuang.io/tags/org-mode/</link>
    <description>Recent content in Org-Mode on Ken Huang</description>
    <generator>Hugo</generator>
    <language>en</language>
    <managingEditor>whatacold@gmail.com (Ken Huang)</managingEditor>
    <webMaster>whatacold@gmail.com (Ken Huang)</webMaster>
    <lastBuildDate>Wed, 26 Feb 2025 00:11:19 +0800</lastBuildDate>
    <atom:link href="https://blog.kenhuang.io/tags/org-mode/rss.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Emphasize Text By Dragging Mouse in Org-mode</title>
      <link>https://blog.kenhuang.io/blog/2023-08-14-org-emphasis-dragging-mouse/</link>
      <pubDate>Mon, 14 Aug 2023 22:48:20 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2023-08-14-org-emphasis-dragging-mouse/</guid>
      <description>&lt;p&gt;&#xA;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 &lt;code class=&#34;verbatim&#34;&gt;*&lt;/code&gt; around the content repeatedly. And I&amp;#39;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.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;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 &lt;code class=&#34;verbatim&#34;&gt;C-h k&lt;/code&gt; and &lt;code class=&#34;verbatim&#34;&gt;(info &amp;#34;emacs&amp;#34;)&lt;/code&gt; (or &lt;a href=&#34;https://www.gnu.org/software/emacs/manual/html_node/emacs/Mouse-Buttons.html&#34;&gt;here at gnu.org&lt;/a&gt;). And then wrote a few lines of code to perform the task standing on the shoulder of &lt;a href=&#34;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&#34;&gt;Advice&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Bookmarklet for Copying a Link as an Org-mode Link</title>
      <link>https://blog.kenhuang.io/blog/2022-08-08-org-link-bookmarklet/</link>
      <pubDate>Mon, 08 Aug 2022 23:33:05 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2022-08-08-org-link-bookmarklet/</guid>
      <description>&lt;p&gt;&#xA;In this blog post, I&amp;#39;d like to share a &lt;a href=&#34;https://en.wikipedia.org/wiki/Bookmarklet&#34;&gt;bookmarklet&lt;/a&gt; for copying a web page&amp;#39;s URL as an org-mode link on Firefox, Chrome, or whatever web browsers support bookmarklets.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;It&amp;#39;s handy when the URL isn&amp;#39;t SEO-friendly, which means you can&amp;#39;t tell what its content is about at first glance of the URL. So a little description text on the link would help.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Here is the bookmarklet:&lt;/p&gt;&#xA;&lt;div class=&#34;src src-js&#34;&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;javascript&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;prompt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Copy to clipboard: Ctrl+C, Esc&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;[[&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;href&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;][&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;title&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34; - &amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;hostname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;]]&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// Don&amp;#39;t know why the page becomes blank after using it on Firefox, so use alert instead.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;javascript&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;alert&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;[[&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;href&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;][&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;title&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34; - &amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;hostname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;]]&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;&#xA;Add a new bookmark on the browser, give it a name, such as &lt;code&gt;(org-link)&lt;/code&gt;, and then copy and paste the content as URL, just like below on Firefox:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Generating org-mode Outlines for wikiHow Articles</title>
      <link>https://blog.kenhuang.io/blog/2019-07-20-generating-org-mode-outlines-for-wikihow-articles/</link>
      <pubDate>Sat, 20 Jul 2019 20:04:00 +0800</pubDate><author>whatacold@gmail.com (Ken Huang)</author>
      <guid>https://blog.kenhuang.io/blog/2019-07-20-generating-org-mode-outlines-for-wikihow-articles/</guid>
      <description>&lt;p&gt;&#xA;Recently I found some great articles on &lt;a href=&#34;https://www.wikihow.com&#34;&gt;wikiHow&lt;/a&gt;, then I want to keep notes of them in &lt;a href=&#34;https://orgmode.org/&#34;&gt;org-mode&lt;/a&gt; files.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;At first, I manually copied the ToC of articles, but soon I found it&amp;#39;s tedious and takes a lot of time.&#xA;Today I wrote a &lt;a href=&#34;https://requests.readthedocs.io/&#34;&gt;requests&lt;/a&gt;-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&amp;#39;s level for the generated ToC in org-mode.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
