<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>hi, it&#39;s mike</title>
    <link>https://mike.puddingtime.org/tags/markdown/</link>
    <description>Recent content on hi, it&#39;s mike</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>mike@puddingtime.org (mike)</managingEditor>
    <webMaster>mike@puddingtime.org (mike)</webMaster>
    <copyright>© 2026, mike</copyright>
    <lastBuildDate>Mon, 03 Jul 2023 08:54:41 -0700</lastBuildDate>
    <atom:link href="https://mike.puddingtime.org/tags/markdown/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Daily notes for 2023-07-03</title>
      <link>https://mike.puddingtime.org/posts/2023-07-03-daily-notes/</link>
      <pubDate>Mon, 03 Jul 2023 08:54:41 -0700</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2023-07-03-daily-notes/</guid>
      <description>John Gruber might be Satan. magit-wip-mode. I can never tell when NYT is being obtuse or unintentionally helpful. New Himalayan loom &amp;ndash; fingers crossed.</description>
      <content:encoded><![CDATA[<h2 id="john-gruber-might-be-satan">John Gruber might be Satan.</h2>
<p><a href="https://johnmacfarlane.net/beyond-markdown.html">Reader, I lol&rsquo;d</a>.</p>
<h2 id="magit-wip-mode">magit-wip-mode</h2>
<p><a href="https://magit.vc/manual/magit/Wip-Modes.html">magit WIP modes</a>:</p>
<blockquote>
<p>&ldquo;Git keeps committed changes around long enough for users to recover changes they have accidentally deleted. It does so by not garbage collecting any committed but no longer referenced objects for a certain period of time, by default 30 days.</p>
</blockquote>
<blockquote>
<p>&ldquo;But Git does not keep track of uncommitted changes in the working tree and not even the index (the staging area). Because Magit makes it so convenient to modify uncommitted changes, it also makes it easy to shoot yourself in the foot in the process.</p>
</blockquote>
<blockquote>
<p>&ldquo;For that reason Magit provides a global mode that saves tracked files to work-in-progress references after or before certain actions. (At present untracked files are never saved and for technical reasons nothing is saved before the first commit has been created).&rdquo;</p>
</blockquote>
<p>I wander back and forth machines a lot and this seems like useful insurance, so I turned it on.</p>
<h2 id="accurate-but-not-good">accurate but not good</h2>
<p>Luke prompted a half-response this morning:</p>
<iframe src="https://hachyderm.io/@lkanies/110648795495111994/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="400" allowfullscreen="allowfullscreen"></iframe>
<p>I replied in a spirit appropriate to me, which is to say &ldquo;disappointed idealist who should learn to either quit being disappointed, or give up on being an idealist, or get a new sense of humor.&rdquo;</p>
<p>Because <a href="https://www.nytimes.com/2023/07/02/style/rethinking-july-4th-celebrations.html">that article</a> feels like a bookending, illustrative underscore of <a href="https://www.nytimes.com/2023/06/29/opinion/college-admissions-affirmative-action.html">this column</a>, which I went into sort of nodding along in a &ldquo;checks out&rdquo; sort of way, then sitting up straight when it got to:</p>
<blockquote>
<p>&ldquo;Expect more antiracist action plans, more vaporous decolonization, more mandated training, more huckster consultants, more vacuous reports, more administrators whose jobs no one can explain, more sleazy land acknowledgments (“Sorry I stole your house!”), more performative white self-flagellation, more tokenization of minority faculty members.</p>
</blockquote>
<blockquote>
<p>&ldquo;And amid this great tornado of race chatter, if you take a moment to plug your ears and look around, you will probably begin to notice fewer and fewer brown and Black kids reading on the quad and, down the line, fewer and fewer brown and Black doctors in the maternity wards. It will turn out that all those initiatives will have next to nothing to do with actually combating structural racism. We may well find ourselves teaching Toni Morrison to rooms that get whiter and richer by the year.&rdquo;</p>
</blockquote>
<p>The biggest change I noticed at my job from 2019 to 2022 was that HR managed to edge everyone out of anti-racist work, and suddenly anything that seemed like it could be meaningful and engage senior managers was ruled &ldquo;performative.&rdquo; Mentorship programs? Performative. Sponsorship programs? Performative. I came to realize that &ldquo;we don&rsquo;t want to be performative&rdquo; was just a thought-terminating cliché meant to shut down the conversation.</p>
<p>What were you supposed to do? Basically, fill low-stakes associate positions, maaaaaybe send a manager out to specific recruiting events, but otherwise just hand the entire hiring process over to recruitment and forget about it. If you looked at any demographic information that suggested perhaps the lenses you were supposed to use &mdash; ratios that ignored role or level &mdash; were problematic, you were asked how you got the information you were using because they thought they&rsquo;d locked it all up. And I watched a good leader driven out by someone who weaponized the whole topic.</p>
<p>When I helped interview HR business partners, it suggested to me that what I was seeing wasn&rsquo;t just local. One of them got uncomfortable when I asked about their experience with ERGs, and preferred to discuss how happy people were with a local soccer team ERG they&rsquo;d sponsored. I honestly didn&rsquo;t know what to do with that, but just marked &ldquo;strong no,&rdquo; explained why, and was relieved the hiring team went another direction. For all I know they thought that &mdash; as an older, white, male interviewer &mdash; I <em>wanted</em> to hear about a soccer ERG instead of an identity-based one, but I didn&rsquo;t feel like playing eight-dimension chess. <em>Including</em> soccer fans seemed like an odd DEI triumph.</p>
<p>So if I&rsquo;m coming off a little mordant about an NYT piece that manages to both report <em>and</em> perform a certain weird forgetfulness in the summer of 2023, it&rsquo;s because I&rsquo;m struggling to understand what we <em>got</em> besides a new consultant class, a new slice of territory for HR departments, and vague commitments to &ldquo;work on ourselves.&rdquo; I can&rsquo;t get mad about the reporting itself, because it seems <em>accurate.</em> It&rsquo;s where we all are. What do we want to do about that?</p>
<h2 id="new-loom-on-the-himalayan">New loom on the Himalayan</h2>
<p>I stuck <a href="https://accessories.hitchcocksmotorcycles.com/accessory-shop/Charging/46817">the new loom</a> on the RE Himalayan today. It was a 20-minute process, from taking off the side plate to figuring out where everything was, to disconnecting and reconnecting all the connectors.</p>
<p>The net effect is that it puts the gear detector behind the ignition instead of straight to the battery, which I hope will stop the parasitic drain I&rsquo;ve been dealing with. It&rsquo;s a weird thing to have to do, but I read a few rumors online that some dealers have been putting them on at sale. It&rsquo;s just a bad design decision with a $25 fix.</p>
<p>Al and I took a ride for groceries this evening. When we got home I took a reading off the battery then set a reminder to myself to check back in 24 hours to see whether the drain seems reasonable. Since I put an <a href="https://antigravitybatteries.com/products/starter-batteries/restart-oem/atz10-rs/">Antigravity battery</a> in there the stakes are a little lower if it drains too much while I observe.</p>
<p>Not related to the loom, the bike is running really well now.  It sounds good, feels smooth, and I&rsquo;ve appreciated how manageable it is. I had it out twice today and just enjoyed driving it through a few curvy parts of southeast Portland in the sun. We&rsquo;re thinking about taking a camping trip down in Clackamas County and going out separately so we can bring the Himalayan along and enjoy some forest service roads and rides along the river.</p>
<p>Still considering trading it in or selling it, but it&rsquo;s growing on me again. I just wish RE was just better at QA overall. I&rsquo;ve got $125 worth of dongles hanging off the thing to get it to just do what it should have done out of the factory, I&rsquo;ve spent four hours sitting around the dealership while the mechanics grudgingly fixed stuff like pinched vacuum hoses and weirdly tuned electrics, and I spent a bunch of my own time hand-tightening connections and digging overpacked grease out of connectors.</p>
<p>With all that time and effort invested, it&rsquo;s behaving. I don&rsquo;t know if I&rsquo;d recommend these bikes to a newbie. I have some patience and don&rsquo;t mind having to do a little work &mdash; it&rsquo;s sort of educational and interesting. Someone new to the hobby shouldn&rsquo;t have to think about that stuff when they&rsquo;re trying to just learn the basics and wondering if stalls or glitches are their fault.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Daily notes for 2023-06-25</title>
      <link>https://mike.puddingtime.org/posts/2023-06-25-daily-notes/</link>
      <pubDate>Sun, 25 Jun 2023 16:44:12 -0700</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2023-06-25-daily-notes/</guid>
      <description>How to mix todos and prose. An Obsidian Today page. Woeful MetaTalk. Getting ready to say goodbye to Apollo. Markdown blogging. BBEdit and LSP. Goodbye reMarkable.</description>
      <content:encoded><![CDATA[<h2 id="mingling-notes-and-todos">Mingling notes and todos</h2>
<p>Prot on the ways in which Denote (or any &ldquo;lots of little notes&rdquo; system) will eventually murder org-mode agenda generation times:</p>
<blockquote>
<p>&ldquo;If you want my opinion though, be more forceful with the separation of concerns. Decouple your knowledge base from your ephemeral to-do list: Denote (and others) can be used for the former, while you let standard Org work splendidly for the latter—that is what I do, anyway.
&hellip;
&ldquo;Do not mix your knowledge base with your to-do items.&rdquo;</p>
</blockquote>
<p>I appreciate that. I am on the record liking the ability to sprinkle todos into prose, or the way todos can be skeletal prose. But one thing I&rsquo;ve come to appreciate about <em>me</em> is that when I live in the same place for everything, I start feeling sort of tool-sick. I think that part of me that has a hard time resisting the urge to optimize reacts to Total environments by trying to totalize further.</p>
<p>With my Obsidian-by-way-of-Denote-conventions setup, I&rsquo;ve been thinking about that a little.</p>
<p>I once went through an Obsidian jag where I wanted it to handle all my todos, and it didn&rsquo;t take long to get to a state of config/plugin bankruptcy. I decided that it was a good idea to have todos be a thing handled by a dedicated tool, and notes to be handled by a good note taker.</p>
<p>During my most recent org kick, I let things intermingle more, and I really held on to org-mode as a backend for Denote because I had that total use case in the back of my head.</p>
<p>I do think there&rsquo;s some value in having todos as semantically distinct nuggets inside atomic notes. For instance, when I&rsquo;m on a call and taking notes, I don&rsquo;t want to context-switch to my todo app to make a todo, and that&rsquo;s not a good idea anyhow: You lose the context, or just make work for yourself going back to find the original note to get the context back.</p>
<p>One nice example of blending todos and some other text object comes from <a href="https://github.com/IvanMalison/org-projectile">org-projectile</a>, which lets you create TODOs in a code base that go into a central notes file with a link to the text hunk you can follow.</p>
<p>I borrowed that idea for Obsidian by using the Tasks plugin:</p>
<ul>
<li>Set Tasks to add creation dates to any todos you create</li>
<li>Use normal todos for most inline notes: Just drop one in when an action presents itself during a conversation, or comes up while writing.</li>
<li>Make a metanote page that lists notes created today, and also lists todos created today:</li>
</ul>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">tasks 
</span></span><span class="line"><span class="cl">not done 
</span></span><span class="line"><span class="cl">created today</span></span></code></pre></div>
<p>That makes a simple page that links back to the todo for when it&rsquo;s the right time of day to go through the day&rsquo;s notes and turn possible actions into actual tasks.</p>
<p>The Tasks plugin allows for a bunch of different kinds of tasks, so I&rsquo;ve repurposed the <code>- [*]</code> type as <code>oppty</code>. Starting out in a new job, a lot of stuff goes by that I think of as &ldquo;maybe nice for the backlog&rdquo; or &ldquo;should do some discovery on that,&rdquo; but I don&rsquo;t want to overwhelm myself by dropping it into my Inbox where it&rsquo;ll both sit for a while and have no context. So I made another metapage for opportunities:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">tasks
</span></span><span class="line"><span class="cl">status.name includes star
</span></span><span class="line"><span class="cl">not done </span></span></code></pre></div>
<p>They just sit there, available for periodic review, linked to their originating note so I can get the context back when I need it. If I decide it&rsquo;s not a thing after all, delete it or check it off. If I decide it&rsquo;s a thing, turn it into a project and check it off.  It&rsquo;s a little different from the org-projectile approach, to the extent it leaves a todo item in the source file instead of just logging it in an outside file and linking back to the right hunk. I think that&rsquo;s fine.</p>
<h2 id="obsidian-today-page">Obsidian Today Page</h2>
<p>I stumbled my way into a Today page figuring all that out. It&rsquo;s just a collection of Dataview and Task code blocks:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl"># Tasks from Today
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">```tasks 
</span></span><span class="line"><span class="cl">not done 
</span></span><span class="line"><span class="cl">created today
</span></span><span class="line"><span class="cl">\```
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"># Notes from today
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">```dataview
</span></span><span class="line"><span class="cl">LIST FROM -&#34;templates&#34; WHERE file.path != this.file.path AND file.cday = date(today) 
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">SORT file.mtime desc
</span></span><span class="line"><span class="cl">WHERE file.name != this.file.name
</span></span><span class="line"><span class="cl">\```
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"># Notes from yesterday
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">```dataview
</span></span><span class="line"><span class="cl">table without id
</span></span><span class="line"><span class="cl">link(file.link, default(file.aliases[0], file.name)) AS &#34;File&#34;,
</span></span><span class="line"><span class="cl">file.ctime AS &#34;Date&#34;
</span></span><span class="line"><span class="cl">FROM -&#34;metanotes&#34; AND -&#34;templates&#34;
</span></span><span class="line"><span class="cl">WHERE file.path != this.file.path AND file.cday = date(yesterday) AND  !contains(file.path, &#34;templates&#34;)
</span></span><span class="line"><span class="cl">SORT file.mtime desc
</span></span><span class="line"><span class="cl">\```
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"># Notes from previous three days
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">```dataview
</span></span><span class="line"><span class="cl">table without id
</span></span><span class="line"><span class="cl">link(file.link, default(file.aliases[0], file.name)) AS &#34;File&#34;,
</span></span><span class="line"><span class="cl">file.ctime AS &#34;Date&#34;
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">FROM -&#34;metanotes&#34; AND -&#34;templates&#34;
</span></span><span class="line"><span class="cl">where file.ctime &gt; (date(today) - dur(3 days)) AND file.ctime &lt; (date(today) - dur(1 days))
</span></span><span class="line"><span class="cl">sort file.ctime desc
</span></span><span class="line"><span class="cl">\```</span></span></code></pre></div>
<p>Basically, just &ldquo;Any tasks from notes made today, then &lsquo;all the notes from today,&rsquo; &lsquo;all the notes from yesterday,&rsquo; and &lsquo;all the notes from the prior 3 days,&rsquo;&rdquo; with a few filters to keep out metanotes and templates. It took a little fussing to get things to display in a way that shows my YAML metadata titles instead of the file names (which are Denote-formatted and a little cluttery), but that was an optional bit of prettying I undertook because I was curious.</p>
<h2 id="much-that-is-wrong-with-the-discourse-">Much that is wrong with &ldquo;the discourse&rdquo; &hellip;</h2>
<p>&hellip; can be found in <a href="https://metatalk.metafilter.com/26320/MetaFilter-has-a-real-problem-with-voicing-class-genocidal-attitudes">this MetaTalk thread wherein a user calls people out over their reaction to the submarine thing</a>.</p>
<p>Someone who knew one of the dead showed up:</p>
<blockquote>
<p>&ldquo;I&rsquo;ve met Shahzada several times &ndash; he was a significant backer of my work in carbon-free energy. He also personally paid for 5 million doses of Covid vaccine to be distributed in Pakistan during the pandemic, and set up a charity for helping people in Pakistan deal with the mental health consequences of the pandemic. He was a good person.</p>
</blockquote>
<blockquote>
<p>&ldquo;Reading some of the comments about him in the original thread was a gut punch. I was picturing (before we found out about the probable implosion) this person I know, this good guy, slowly suffocating underwater alongside his son, while Metafilter was making crass jokes about him.&rdquo;</p>
</blockquote>
<p>With each passing year it feels to me like an increasingly valuable piece of work to get better practiced at just not saying anything about an increasingly wide array of situations and topics. In a social media/web forum context, I can&rsquo;t think of anything I&rsquo;d say that would have a lot of leverage for good, and I can think of a lot of ways, like that right up there, that it can provide leverage for a lot of small but painful ills.</p>
<p>It&rsquo;s not that simple, right? It&rsquo;s a <em>good</em> thing that a lot of us have come to accept that people with power, privilege, access, resources, credibility, standing, platforms should <em>use them</em> to address injustice.  It&rsquo;s a <em>good</em> thing that we&rsquo;ve become more aware of the ways in which the urge to be more measured, or to make our words sweeter or easier to take, can cause us to mistake passivity or injustice for humility or modesty; or make it easier to tell other people suffering injustice to come back when they can &ldquo;put the message in a better envelope.&rdquo;</p>
<p>I think the thing that makes it hard to swallow is the way in which privileged, successful, wealthy people have steadily gentrified categories of oppression to rationalize their unwillingness to govern themselves, or to feel able act on the very human desire to participate in the conversation going on around them.</p>
<p>We each have to do our own math. There aren&rsquo;t any rules.</p>
<h2 id="twilight-apollo">Twilight Apollo</h2>
<p>I&rsquo;m very sorry <a href="https://apolloapp.io">Apollo</a> isn&rsquo;t long for this world. It&rsquo;s the best way to do Reddit under any circumstances, and really shines if you care about the distinct conversations under a post. It has helped me come to know individuals in a few communities over the years. I can&rsquo;t imagine reddit without it. So I&rsquo;m browsing the few subs I subscribe to these days with a sense of impending loss. Not too many more days and it will shut down; reddit will be much harder to keep up with, and a much worse experience in general.</p>
<h2 id="markdown-blogging">Markdown blogging</h2>
<p>A while back I wrote <a href="https://gist.github.com/pdxmph/9271cbb22d90f7e73a4b88664e0eaadd">a Ruby script to make it easier to do Hugo blogging</a>. It doesn&rsquo;t do a ton, but it does make it simple to enter title, tags, and category from the command line to make a Markdown file in the right place. It includes a switch for making daily posts with my house style.</p>
<p>I&rsquo;ve been blogging via <code>ox-hugo</code> since mid-April, so the script hasn&rsquo;t seen much use. Today I took another look at it, cleaned up one glitch in the way it does frontmatter, fixed up its daily post naming convention, and used it to make this post.</p>
<p>Gotta say, it just feels less fragile and less &hellip; think-y. There are some nice things about blogging with org-mode, for sure. I really like the document editing features. There are some things about blogging in a monolithic file that get sort of weird now and then. Sometimes it adds steps that feel needless. There are some things that are just clumsy or sort of a pain to remember. Every now and then you accidentally move a space in a previous entry and then you&rsquo;re left wondering why a post from two months ago suddenly regenerated its own Markdown.</p>
<p>Markdown, on the other hand, is good enough for blogging. I don&rsquo;t get any advantage from org-mode&rsquo;s syntax for most of what I&rsquo;m doing here, and Emacs&rsquo; markdown-mode does the same basic trick I like most from org-mode, which is tab-folding headings as I work through a post.</p>
<p>Like I said, when I decide I have another book in me I&rsquo;ll probably write it in org-mode. Until then, I&rsquo;m just going with the VHS of lightweight markup languages.</p>
<h2 id="bbedit-and-lsp">BBEdit and LSP</h2>
<p>I almost went full heretic and tried to see how I&rsquo;d feel about Markdown blogging with BBEdit. I was sort of excited about BBEdit&rsquo;s recent-ish support for <a href="https://en.wikipedia.org/wiki/Language_Server_Protocol">LSP</a>, and wanted to try out <a href="https://github.com/artempyanykh/marksman">Marksman</a>. Well, the two use cases I care most about for LSP &mdash; Ruby and Markdown &mdash; don&rsquo;t work. I managed to get the servers for YAML, JSON, CSS, HTML, and Python all working. Nothing doing for Marksman or <a href="https://solargraph.org">Solargraph</a>, the Ruby LSP server. They both work great under Doom Emacs, which also has great integration with Rubocop to make up for Solargraph&rsquo;s missing beautifying capabilities.</p>
<p>So, fine.</p>
<p>I&rsquo;ve got Emacs in a great place right now. I trimmed a lot of needless stuff from my configuration, it behaves just how I like, and it integrates well with Obsidian if I feel like doing more long-form writing and don&rsquo;t want to use Obsidian to do it. This miiiight be the first time I&rsquo;ve ever gone so completely Emacsimalist, then climbed back down from my worst excesses, but kept on using it for everyday stuff, too.</p>
<p>I even did a quick nostalgia tour of Sublime Text, VSCode, and Nova. Something about each of them irritated me.</p>
<h2 id="goodbye-remarkable">Goodbye, reMarkable</h2>
<p>As threatened, my reMarkable has a new home. Wow did I want to like that thing. I tried. In the end, I think it just came down to not being a handwritten notes kind of person at all. Or rather, if I am hand writing a note, it is just a small thing I am jotting down, or a way to fidget and stay a little engaged. I know what people say about recall and believe that is probably true, but that&rsquo;s just one dimension &mdash; there are also search, storage, portability, and just basic convenience.</p>
<p>If I had great handwriting I might have benefitted from the reMarkable, with its searchable handwritten text. But I don&rsquo;t have great handwriting. So it suffered from the same problem ebook editions of reference works suffer from: Paper notebooks have a certain spatial quality to them, and you can flip through them in lieu of being able to grep through them. My handwriting isn&rsquo;t good enough to be greppable by a machine, and the electronic &ldquo;notebook&rdquo; can&rsquo;t be thumbed through.</p>
<p>I guess, when I think back, that I imagined its more paper-like feel, its slimness, and its single-purpose nature were what would give it an edge over any number of iPad notebook apps. No. Turns out that I am just happier when I&rsquo;m typing notes.</p>
<p>As if to drive the lesson home, I shipped the reMarkable off yesterday and found myself downtown today at my favorite paper store. I briefly eyed a few nice notebooks and pens, thought to myself &ldquo;well, it was probably the <em>digital</em> stuff you didn&rsquo;t warm up to &hellip;&rdquo; then had a second thought and felt a little relieved that the paper coming out of the cognitive slot read in very plain, block lettering, &ldquo;YOU DON&rsquo;T ACTUALLY LIKE TRYING TO LIVE OUT OF A NOTEBOOK.&rdquo;</p>
<p>So I bought some shoes.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Daily Notes for 2023-06-15</title>
      <link>https://mike.puddingtime.org/posts/2023-06-15-daily-notes/</link>
      <pubDate>Thu, 15 Jun 2023 00:00:00 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2023-06-15-daily-notes/</guid>
      <description>Excruciating Multiplicity of Approaches to Cat-Skinning. I slay me. Denote-org-to-Denote-Markdown. Golden Ratio window management.</description>
      <content:encoded><![CDATA[<h2 id="golden-ratio">Golden ratio</h2>
<p>This is kind of cool. The <a href="https://github.com/roman/golden-ratio.el">golden-ratio</a> package dynamically resizes Emacs windows within frames as they become the active window. It works <em>okay</em> on a desktop machine, and I really like it on my laptop. Opening up a window for LSP output, for instance, kept the code buffer at a better size while still being able to track the LSP to the side.</p>
<p>It doesn&rsquo;t work out of the box with Doom Emacs &mdash; it needs an incantation:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span class="line"><span class="cl"><span class="p">(</span><span class="nv">use-package!</span> <span class="nv">golden-ratio</span>
</span></span><span class="line"><span class="cl">  <span class="nb">:after-call</span> <span class="nv">pre-command-hook</span>
</span></span><span class="line"><span class="cl">  <span class="nb">:config</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nv">golden-ratio-mode</span> <span class="mi">+1</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="c1">;; Using this hook for resizing windows is less precise than</span>
</span></span><span class="line"><span class="cl">  <span class="c1">;; `doom-switch-window-hook&#39;.</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nv">remove-hook</span> <span class="ss">&#39;window-configuration-change-hook</span> <span class="nf">#&#39;</span><span class="nv">golden-ratio</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">  <span class="p">(</span><span class="nv">add-hook</span> <span class="ss">&#39;doom-switch-window-hook</span> <span class="nf">#&#39;</span><span class="nv">golden-ratio</span><span class="p">))</span></span></span></code></pre></div>
<p>Demo/tutorial video:</p>
<div style="text-align:center;">
  <iframe width="560" height="315" src="https://www.youtube.com/embed/k5Nwwo4QTmI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen>
  </iframe>
</div>
<p>I understand that Golden Ratio is no longer maintained. Some people say <a href="https://github.com/cyrus-and/zoom">Zoom</a> is as good, so maybe I&rsquo;ll try it if I hit any of those bugs people talk about.</p>
<h2 id="when-you-feel-the-heat-coming-around-the-corner-dot-dot-dot">&ldquo;When you feel the heat coming around the corner &hellip;&rdquo;</h2>
<p>I think I lost an hour to figuring out how to take a batch of existing Denote notes in org format and move them into Markdown, so I got very, very patient
with ChatGPT and together we came up with this:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">os</span>
</span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">re</span>
</span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">argparse</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">datetime</span>
</span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">pypandoc</span>
</span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">shutil</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">org_dir</span> <span class="o">=</span> <span class="s1">&#39;/Users/mph/org/notes&#39;</span>  <span class="c1"># Replace with your directory path</span>
</span></span><span class="line"><span class="cl"><span class="n">md_dir</span> <span class="o">=</span> <span class="s1">&#39;/Users/mph/org/notes-md&#39;</span>  <span class="c1"># Replace with the desired directory path for markdown files</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">convert_org_to_md</span><span class="p">(</span><span class="n">org_file</span><span class="p">,</span> <span class="n">org_path</span><span class="p">,</span> <span class="n">md_dir</span><span class="p">,</span> <span class="n">with_hashtags</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="c1"># Recreate the directory structure in the markdown directory</span>
</span></span><span class="line"><span class="cl">    <span class="n">org_relative_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">relpath</span><span class="p">(</span><span class="n">org_path</span><span class="p">,</span> <span class="n">org_dir</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">md_relative_dir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">org_relative_path</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">md_output_dir</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">md_dir</span><span class="p">,</span> <span class="n">md_relative_dir</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">md_output_dir</span><span class="p">,</span> <span class="n">exist_ok</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="n">md_file</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">splitext</span><span class="p">(</span><span class="n">org_file</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="s1">&#39;.md&#39;</span>
</span></span><span class="line"><span class="cl">    <span class="n">md_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">md_output_dir</span><span class="p">,</span> <span class="n">md_file</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="c1"># Copy org file to markdown directory</span>
</span></span><span class="line"><span class="cl">    <span class="n">shutil</span><span class="o">.</span><span class="n">copy2</span><span class="p">(</span><span class="n">org_path</span><span class="p">,</span> <span class="n">md_path</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">md_path</span><span class="p">,</span> <span class="s1">&#39;r&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">file</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">        <span class="n">org_content</span> <span class="o">=</span> <span class="n">file</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="c1"># Extract frontmatter variables from org file</span>
</span></span><span class="line"><span class="cl">    <span class="n">title_match</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;#\+title:\s+(.+)&#39;</span><span class="p">,</span> <span class="n">org_content</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">identifier_match</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;#\+identifier:\s+(.+)&#39;</span><span class="p">,</span> <span class="n">org_content</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="n">tags_match</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;#\+filetags:\s+(.+)&#39;</span><span class="p">,</span> <span class="n">org_content</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="n">frontmatter</span> <span class="o">=</span> <span class="p">{}</span>
</span></span><span class="line"><span class="cl">    <span class="k">if</span> <span class="n">title_match</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">        <span class="n">frontmatter</span><span class="p">[</span><span class="s1">&#39;title&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">title_match</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="k">if</span> <span class="n">identifier_match</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">        <span class="n">frontmatter</span><span class="p">[</span><span class="s1">&#39;identifier&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">identifier_match</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">    <span class="k">if</span> <span class="n">tags_match</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">        <span class="n">tags_string</span> <span class="o">=</span> <span class="n">tags_match</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">        <span class="n">tags_list</span> <span class="o">=</span> <span class="p">[</span><span class="n">tag</span><span class="o">.</span><span class="n">strip</span><span class="p">(</span><span class="s1">&#39;:&#39;</span><span class="p">)</span> <span class="k">for</span> <span class="n">tag</span> <span class="ow">in</span> <span class="n">tags_string</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;:&#39;</span><span class="p">)</span> <span class="k">if</span> <span class="n">tag</span><span class="o">.</span><span class="n">strip</span><span class="p">()]</span>
</span></span><span class="line"><span class="cl">        <span class="n">frontmatter</span><span class="p">[</span><span class="s1">&#39;tags&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">tags_list</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="c1"># Update date stamp format</span>
</span></span><span class="line"><span class="cl">    <span class="n">org_content</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="sa">r</span><span class="s1">&#39;\[(\d</span><span class="si">{4}</span><span class="s1">-\d</span><span class="si">{2}</span><span class="s1">-\d</span><span class="si">{2}</span><span class="s1">) (\w</span><span class="si">{3}</span><span class="s1"> \d</span><span class="si">{2}</span><span class="s1">:\d</span><span class="si">{2}</span><span class="s1">)\]&#39;</span><span class="p">,</span> <span class="sa">r</span><span class="s1">&#39;\1T\2:00-07:00&#39;</span><span class="p">,</span> <span class="n">org_content</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="c1"># Convert org to markdown using Pandoc</span>
</span></span><span class="line"><span class="cl">    <span class="n">md_content</span> <span class="o">=</span> <span class="n">pypandoc</span><span class="o">.</span><span class="n">convert_text</span><span class="p">(</span><span class="n">org_content</span><span class="p">,</span> <span class="s1">&#39;gfm&#39;</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="s1">&#39;org&#39;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="c1"># Generate new frontmatter content</span>
</span></span><span class="line"><span class="cl">    <span class="n">updated_frontmatter</span> <span class="o">=</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">        <span class="s1">&#39;title&#39;</span><span class="p">:</span> <span class="n">frontmatter</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;title&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="s1">&#39;date&#39;</span><span class="p">:</span> <span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s1">&#39;%Y-%m-</span><span class="si">%d</span><span class="s1">T%H:%M:%S-07:00&#39;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="s1">&#39;identifier&#39;</span><span class="p">:</span> <span class="n">frontmatter</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;identifier&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="s1">&#39;tags&#39;</span><span class="p">:</span> <span class="n">frontmatter</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;tags&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">    <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="c1"># Generate the new frontmatter string</span>
</span></span><span class="line"><span class="cl">    <span class="n">frontmatter_string</span> <span class="o">=</span> <span class="s1">&#39;---</span><span class="se">\n</span><span class="s1">&#39;</span>
</span></span><span class="line"><span class="cl">    <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">updated_frontmatter</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
</span></span><span class="line"><span class="cl">        <span class="n">frontmatter_string</span> <span class="o">+=</span> <span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">key</span><span class="si">}</span><span class="s1">: </span><span class="si">{</span><span class="n">value</span><span class="si">}</span><span class="se">\n</span><span class="s1">&#39;</span>
</span></span><span class="line"><span class="cl">    <span class="n">frontmatter_string</span> <span class="o">+=</span> <span class="s1">&#39;---</span><span class="se">\n</span><span class="s1">&#39;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="c1"># Add updated frontmatter to the markdown content</span>
</span></span><span class="line"><span class="cl">    <span class="n">md_content</span> <span class="o">=</span> <span class="n">frontmatter_string</span> <span class="o">+</span> <span class="n">md_content</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="c1"># Insert tags as hashtags on the last line if enabled</span>
</span></span><span class="line"><span class="cl">    <span class="k">if</span> <span class="n">with_hashtags</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">        <span class="n">tags_line</span> <span class="o">=</span> <span class="s1">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="sa">f</span><span class="s1">&#39;#</span><span class="si">{</span><span class="n">tag</span><span class="si">}</span><span class="s1">&#39;</span> <span class="k">for</span> <span class="n">tag</span> <span class="ow">in</span> <span class="n">frontmatter</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;tags&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">split</span><span class="p">()])</span>
</span></span><span class="line"><span class="cl">        <span class="n">md_content</span> <span class="o">+=</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">&#39;</span> <span class="o">+</span> <span class="n">tags_line</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="c1"># Save the markdown file</span>
</span></span><span class="line"><span class="cl">    <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">md_path</span><span class="p">,</span> <span class="s1">&#39;w&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">file</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">        <span class="n">file</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">md_content</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">def</span> <span class="nf">convert_directory</span><span class="p">(</span><span class="n">org_dir</span><span class="p">,</span> <span class="n">md_dir</span><span class="p">,</span> <span class="n">with_hashtags</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">    <span class="n">org_files</span> <span class="o">=</span> <span class="p">[]</span>
</span></span><span class="line"><span class="cl">    <span class="k">for</span> <span class="n">root</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">files</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">walk</span><span class="p">(</span><span class="n">org_dir</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">        <span class="k">for</span> <span class="n">file</span> <span class="ow">in</span> <span class="n">files</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">            <span class="k">if</span> <span class="n">file</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s1">&#39;.org&#39;</span><span class="p">):</span>
</span></span><span class="line"><span class="cl">                <span class="n">org_files</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">root</span><span class="p">,</span> <span class="n">file</span><span class="p">))</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="k">for</span> <span class="n">org_path</span> <span class="ow">in</span> <span class="n">org_files</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">        <span class="n">org_file</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="n">org_path</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">        <span class="n">convert_org_to_md</span><span class="p">(</span><span class="n">org_file</span><span class="p">,</span> <span class="n">org_path</span><span class="p">,</span> <span class="n">md_dir</span><span class="p">,</span> <span class="n">with_hashtags</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Parse command-line arguments</span>
</span></span><span class="line"><span class="cl"><span class="n">parser</span> <span class="o">=</span> <span class="n">argparse</span><span class="o">.</span><span class="n">ArgumentParser</span><span class="p">(</span><span class="n">description</span><span class="o">=</span><span class="s1">&#39;Convert org files to markdown.&#39;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">parser</span><span class="o">.</span><span class="n">add_argument</span><span class="p">(</span><span class="s1">&#39;--with-hashtags&#39;</span><span class="p">,</span> <span class="n">action</span><span class="o">=</span><span class="s1">&#39;store_true&#39;</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="s1">&#39;Insert tags as hashtags on the last line&#39;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">args</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">parse_args</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Convert org files to markdown</span>
</span></span><span class="line"><span class="cl"><span class="n">convert_directory</span><span class="p">(</span><span class="n">org_dir</span><span class="p">,</span> <span class="n">md_dir</span><span class="p">,</span> <span class="n">args</span><span class="o">.</span><span class="n">with_hashtags</span><span class="p">)</span></span></span></code></pre></div>
<p>I thiiiink that&rsquo;s according to the Denote spec for Markdown, and I <em>think</em> that makes it good enough for Hugo, too, excepting links in the
<code>[[denote:12345678]]</code> format.</p>
<p>So, what is it good for? Mostly just getting from an org-mode-based Denote corpus to a Markdown-based one. At least, it seems to &ldquo;just work&rdquo; to do that.</p>
<p>If you&rsquo;re not heavily cross-linked and don&rsquo;t mind cleaning up <code>denote:</code>-style links I suppose you could drop the whole thing into Obsidian. In fact, I did. Works well minus, again, <code>denote:</code> links. I was also personally curious about whether the whole mess would work well with <a href="https://github.com/artempyanykh/marksman">Marksman</a> &mdash; an LSP server for Markdown that has some interesting &ldquo;make a wiki out of simple Markdown&rdquo; features &mdash; but I&rsquo;m missing something about Marksman. It doesn&rsquo;t work well with the stock LSP under Doom, and while it doesn&rsquo;t crash using Eglot, I&rsquo;m still not sure of its utility.</p>
<p>I also tossed in a command line switch that adds the tags as hashtags at the bottom of the file, which is where I tend to put them, and also what I thought I needed to do until I realized that Obsidian actually understands the <code>tags: [&quot;foo&quot;,&quot;bar&quot;,&quot;baz&quot;]</code> notation in YAML frontmatter if you do a <code>tag:#foo</code> search in its search tool. So &mdash; if you&rsquo;re a frontmatter person, just run it plain. If you&rsquo;re not then <code>--with-hashtags</code> is your friend.</p>
<h2 id="obsidian-dot-el">Obsidian.el</h2>
<p>Another option, I guess, is <a href="https://github.com/licht1stein/obsidian.el">obsidian.el</a>, which is meant to provide a way to get around an Obsidian vault within Emacs. You point it at your vault directory, designate an inbox folder, and it provides ways to search by tag, etc.</p>
<p>I dunno. At this point it&rsquo;s all just messing around and seeing how all this stuff hangs together (or doesn&rsquo;t.) Fun.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
