Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Create Footnote Workaround #253

Closed
strand opened this Issue Oct 28, 2011 · 7 comments

Comments

Projects
None yet
4 participants

strand commented Oct 28, 2011

Create a workaround to allow Markdown Extra style footnotes with a leftwards arrow with a hook. This workaround should let a blogger type a footnote '[^1]' and that text will be transformed into valid HTML5. There currently exists a pull request for a similar functionality in RDiscount, but that is moving slowly.

[^1]: This is a footnote.

For background review the twitter conversation captured below.

Twitter conversation between @octopress, @austintaylor and @strand (@strabd on twitter).

@austintaylor @octopress Also, is there a good way to do footnotes?
@octopress @austintaylor Neither redcarpet nor Rdiscount have support for footnotes yet. Other markdown processors slaughter html5. Gotta wait. :(
@strabd @octopress Does it make sense to create a Liquid tag to fill the gap till a decent Markdown translator has this feature? @austintaylor
@octopress @strand @austintaylor Ideally it would process the post content and work just like the markdown extension. post_filters might help.
@austintaylor @octopress Speaking of, did you see my reply on the HTML5 thing? github.com/rtomayko/rdisc…
@octopress @strand @austintaylor but yeah, I think it makes sense, but only if it functions just like markdown. I'm hoping to write this eventually.
@strabd @octopress There's already a pull request for footnotes in RDiscount, github.com/rtomayko/rdisc… but I'll look at post_filters. @austintaylor
@octopress @austintaylor ah yes. I did see that. Not sure what to do about it though. They seem a fairly unresponsive bunch.

strand commented Oct 28, 2011

Example

Text excerpted from A Footnote to History by Robert Louis Stevenson. HTML modeled after Daring Fireball's "About the Footnotes."

Markdown

There was some unedifying disputation as to whether he had waited ten or twenty minutes, whether he had been officially or unofficially informed by Wilson that Sewall was on the way, whether the statement had been made to himself or to Weber[^1] in answer to a question, and whether he had heard Wilson’s answer or only Weber’s question: all otiose; if he heard the question, he was bound to have waited for the answer; if he heard it not, he should have put it himself; and it was the manifest truth that he rejoiced in his occasion.

[^1]: Brother and successor of Theodor.

HTML5

<p>There was some unedifying disputation as to whether he had waited ten or twenty minutes, whether he had been officially or unofficially informed by Wilson that Sewall was on the way, whether the statement had been made to himself or to Weber<sup id="refBody1"><a href="#refAnchor1">1</a></sup> in answer to a question, and whether he had heard Wilson’s answer or only Weber’s question: all otiose; if he heard the question, he was bound to have waited for the answer; if he heard it not, he should have put it himself; and it was the manifest truth that he rejoiced in his occasion.</p>

<div class="footnotes">
<hr />
<ol>
<li id="refAnchor1">
<p>Brother and successor of Theodor.
<a href="#refBody1"  class='footnoteBackLink'  title="Jump back to footnote 1 in the text.">&#8617;</a></p>
</li>
</ol>
</div> 

Final

There was some unedifying disputation as to whether he had waited ten or twenty minutes, whether he had been officially or unofficially informed by Wilson that Sewall was on the way, whether the statement had been made to himself or to Weber1 in answer to a question, and whether he had heard Wilson’s answer or only Weber’s question: all otiose; if he heard the question, he was bound to have waited for the answer; if he heard it not, he should have put it himself; and it was the manifest truth that he rejoiced in his occasion.


  1. Brother and successor of Theodor.

sfahmy commented Oct 29, 2011

Note that if you change your Markdown parser to kramdown (change it in _config.yml), footnotes are supported in the manner you've shown. Can't speak for HTML5 compatibility.

strand commented Oct 30, 2011

Looks like kramdown may not have the most responsive maintainers. gettalong/kramdown#4

sfahmy commented Oct 30, 2011

Saw that yesterday. Strange though, as when I emailed the maintainer regarding a syntax question on classes, I got a reply almost immediately. It looks like it has been stuck since May, but maybe it's just that the maintainer is busy, plus he seems to be offering releases through many channels, which might make updating a less common occurrence.
http://kramdown.rubyforge.org/news.html

switz commented Jan 7, 2012

+1

Owner

imathis commented May 23, 2012

For now I'm closing this. The ruby markdown libraries which support this aren't fast enough for using them as the default parser. I'd really rather do this with a markdown extension, but for that I'll have to wait for Rdsicount or Redcloth2 to support it.

@imathis imathis closed this May 23, 2012

@pfhawkins pfhawkins referenced this issue in davidfstr/rdiscount Nov 16, 2012

Closed

Support for Discount 2.0.7's footnotes option #34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment