From c33803ad2e84cdce6e4ebf2c66d450216aefbe7f Mon Sep 17 00:00:00 2001 From: David Wolever Date: Tue, 26 Feb 2008 21:02:34 +0000 Subject: Added an example of how to use footnotes, fixed a small bug where the return link's title always said "Jump back to footnote 1" --- mdx_footnotes.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mdx_footnotes.py') diff --git a/mdx_footnotes.py b/mdx_footnotes.py index bc8688b..4464c50 100644 --- a/mdx_footnotes.py +++ b/mdx_footnotes.py @@ -13,6 +13,14 @@ Footnote functionality is attached by calling extendMarkdown() method of FootnoteExtension. The method also registers the extension to allow it's state to be reset by a call to reset() method. + +Example: + Footnotes[^1] have a label[^label] and a definition[^!DEF]. + + [^1]: This is a footnote + [^label]: A footnote on "label" + [^!DEF]: The footnote for definition + """ FN_BACKLINK_TEXT = "zz1337820767766393qq" @@ -124,7 +132,7 @@ class FootnoteExtension (markdown.Extension): backlink.setAttribute('href', '#' + self.makeFootnoteRefId(i)) backlink.setAttribute('class', 'footnoteBackLink') backlink.setAttribute('title', - 'Jump back to footnote %d in the text' % 1) + 'Jump back to footnote %d in the text' % i) backlink.appendChild(doc.createTextNode(FN_BACKLINK_TEXT)) if li.childNodes : -- cgit v1.2.3