Markdown is, I think it is fair to say, a frustrating "specification". It's origins are a back-of-a-fag-packet document and a buggy Perl script - and we've been dealing with the consequences ever since. There are now multiple Markdown parsers, each with their own idiosyncrasies. To make matters worse, there's a set of extensions popularly known as "Markdown Extra". Extra has support for things like tables, footnotes, and - in some dialects - autolinks. Most of the time, when an author writes …
Continue reading →
As a dedicated and professional computer scientician, I believe that all indices must start at zero. Not one, not two, but zero. The zeroth element is sacrosanct to our creed; for in the beginning there was nothing. If you're using WordPress's JetPack, it uses an ancient version of Markdown Extra. You can either monkeypatch this, or install a separate Markdown plugin. I've patched my fork of it in two specific places. Firstly, I set $this->footnote_counter = 0; in the initial config of the …
Continue reading →
A scrap of code which I hope helps you. Problem You installed the WordPress JetPack plugin and wrote all your blog posts in Markdown. Now you want to remove JetPack or replace it with a better Markdown parser. You turn off JetPack's "Write posts or pages in plain-text Markdown syntax". You click edit on a post and see the HTML version of your page. Where did the Markdown version go? Background When you write using JetPack's Markdown plugin, the Markdown version is stored in…
Continue reading →
I've launched a WordPress Plugin for an extremely niche use-case. WP GeSHi Highlight Redux works with WordPress's Classic Editor to convert Markdown to syntax highlighted code. That allows me to write: ```php $a = "Hello"; $b = 5 * 2; echo $a . str($b); ``` And have it displayed as: $a = "Hello"; $b = 5 * 2; echo $a . str($b); I've previously written about the WP GeSHi Highlight plugin. My plugin is a fork of that. It has the following changes: RSS & Atom feeds - disable code…
Continue reading →
I've been thinking a lot about footnotes in Markdown. I've contributed a patch to make them slightly better in WordPress. Now I'm wondering how to make them more useful by enhancing their pop-up title text. To that end, I'm writing a patch for PHP Markdown which will display the first ~200 characters of a footnote in the pop-up title text. Hover over the superscript number and you'll get a preview of the footnote. Dealing with all sorts of weird HTML & Markdown edge-cases is tricky. So, if…
Continue reading →
Mostly notes to myself - I hope you find them useful. So, you want to write your dissertation or thesis in Markdown. But how do you manage all your citations? Install Zotero Install the Better BibTex plugin Restart Zotero. The BBT plugin will launch a configuration screen - use it to set your preferences Install VS Code (or VS Codium) Install the VS Code Zotero plugin Now, when you want to enter a citation in Markdown, the combined plugins will generate something like this: ## Abstract …
Continue reading →
Previously, I've written about using Footnotes in WordPress Markdown. A reader notified me that the footnotes weren't very accessible. This blog post describes the problem and proposes a solution. The Problem Using WordPress's JetPack, markdown footnotes are rendered as: Some text <sup id="fnref-1234-1"><a href="#fn-1234-1" class="jetpack-footnote">1</a></sup> ... <li id="fn-1234-1">The footnotes. <a href="#fnref-1234-1">↩</a></li> There are two main problems with this: The <sup>1</sup> …
Continue reading →
Did you know - WordPress Markdown supports footnotes? There is some documentation but I thought I'd write a slightly more comprehensive guide. The code is pretty simple. Write [^1] where you want your first footnote link to appear. Then, later in the document, write [^1]: The text of the note. It doesn't matter what number you put inside the [^…], WordPress automatically generates a sequential number when displaying the links. For example, this one is [^3] In order to keep your thoughts s…
Continue reading →