librelist archives

« back to archive

Adding footnotes to a blog post

Adding footnotes to a blog post

From:
Jacopo Notarstefano
Date:
2012-04-09 @ 11:45
Hey everyone!

I've added some footnotes to a post on my blog and found the process very
tedious. It involved writing most of the HTML by hand, nullifying the
advantages of Markdown.

Here is my commit:

https://github.com/Jacquerie/jacquerie.it/commit/7fea4d70797cab07c778b9d1f7baa5420c7ea175#diff-0(scroll
on the right to see what's changed).

Did I miss something, or is this how I'm supposed to write footnotes?

Cheers,
Jacopo

Re: [nesta] Adding footnotes to a blog post

From:
Graham Ashton
Date:
2012-04-10 @ 08:36
On 9 Apr 2012, at 12:45, Jacopo Notarstefano wrote:

> Here is my commit: 
https://github.com/Jacquerie/jacquerie.it/commit/7fea4d70797cab07c778b9d1f7baa5420c7ea175#diff-0
(scroll on the right to see what's changed).
> 
> Did I miss something, or is this how I'm supposed to write footnotes?

I've never used footnotes on the web like that, but from what I can see 
Markdown doesn't seem to have any particularly obvious way of doing it.

Re: [nesta] Adding footnotes to a blog post

From:
Andrew Premdas
Date:
2012-04-10 @ 09:48
On 9 April 2012 12:45, Jacopo Notarstefano <jacopo.notarstefano@gmail.com>wrote:

> Hey everyone!
>
> I've added some footnotes to a post on my blog and found the process very
> tedious. It involved writing most of the HTML by hand, nullifying the
> advantages of Markdown.
>
> Here is my commit:
> 
https://github.com/Jacquerie/jacquerie.it/commit/7fea4d70797cab07c778b9d1f7baa5420c7ea175#diff-0(scroll
on the right to see what's changed).
>
> Did I miss something, or is this how I'm supposed to write footnotes?
>
> Cheers,
> Jacopo
>

It looks to me (your markdown is really hard  to read, restricting it to
72chars per line would be a great improvement) that the old way was trying
to use [1] to link to the first referenced link, [2] to the second etc. But
the links were defined with string e.g. [The Harmless Way]: ...

This is not in the markdown spec (
http://daringfireball.net/projects/markdown/syntax#link). The things in the
square brackets have to match

e.g. blah [1]

[1]: url "optional label"

or blah [The Harmless Way]

[The Harmless Way]: url "optional label.

This has nothing to do with nesta.

HTH

Andrew

-- 
------------------------
Andrew Premdas
blog.andrew.premdas.org

Re: [nesta] Adding footnotes to a blog post

From:
Max Sadrieh
Date:
2012-04-10 @ 12:42
In more general terms, what's missing is the ability to create an
arbitrary element (tag) with an id to link to from within the page. On
the other hand, on your example page, I don't think you need the <a
href="#id">, you can use simple Markdown links.

To be able to create elements with id (including divs), you probably
need to ask the people of Markdown / whatever parser nesta uses.
Theoretically a plugin could be written to manually preprocess MD
looking syntax, but that sounds pretty inelegant and fragile to me.

Once that functionality is in, it's probably reasonably easy to have a
plugin to automatically generate backlinks or even parse inline notes.

I haven't used it, but I would have a look at the [Maldini plugin]. It
is supposed to generate citations and references, which should be
similar (that is, mentioned inline but shown at the end of the text).
(I just looked at the code really quickly and it seems the author
simply calls ruby functions by using the #{code} syntax. Is that
possible in vanilla Markdown? That'd make things a lot easier and a
plugin based on Maldini would be very doable)

[Maldini plugin] http://nestacms.com/docs/plugins/maldini

-Max Sadrieh
On Tue, Apr 10, 2012 at 5:48 AM, Andrew Premdas <apremdas@gmail.com> wrote:
> On 9 April 2012 12:45, Jacopo Notarstefano <jacopo.notarstefano@gmail.com>
> wrote:
>>
>> Hey everyone!
>>
>> I've added some footnotes to a post on my blog and found the process very
>> tedious. It involved writing most of the HTML by hand, nullifying the
>> advantages of Markdown.
>>
>> Here is my commit:
>> 
https://github.com/Jacquerie/jacquerie.it/commit/7fea4d70797cab07c778b9d1f7baa5420c7ea175#diff-0
>> (scroll on the right to see what's changed).
>>
>> Did I miss something, or is this how I'm supposed to write footnotes?
>>
>> Cheers,
>> Jacopo
>
>
> It looks to me (your markdown is really hard  to read, restricting it to
> 72chars per line would be a great improvement) that the old way was trying
> to use [1] to link to the first referenced link, [2] to the second etc. But
> the links were defined with string e.g. [The Harmless Way]: ...
>
> This is not in the markdown spec
> (http://daringfireball.net/projects/markdown/syntax#link). The things in the
> square brackets have to match
>
> e.g. blah [1]
>
> [1]: url "optional label"
>
> or blah [The Harmless Way]
>
> [The Harmless Way]: url "optional label.
>
> This has nothing to do with nesta.
>
> HTH
>
> Andrew
>
> --
> ------------------------
> Andrew Premdas
> blog.andrew.premdas.org
>

Re: [nesta] Adding footnotes to a blog post

From:
Max Sadrieh
Date:
2012-04-11 @ 20:59
Hey,

I wrote a super simple plugin with hardcoded HTML (but hopefully with
useful classes so you can modify how it looks easily) that lets you
add footnotes pretty easily.

The basics:
- Dont use ids that look like footnote-[x] or ref-[x]
- Use haml and switch to markdown in the file so you can call ruby methods
- Create a Nesta::Plugin::Footnote::Footnotes object (say `fn`)
- Insert #{fn.footnote("My footnote")} wherever you want to add a
reference to a footnote
- Insert #{fn.printfootnotes} wherever you want to print the footnotes (duh)

See more at https://github.com/ms/nesta-plugin-footnote

Cheers.

-Max

On Tue, Apr 10, 2012 at 8:42 AM, Max Sadrieh <max.sadrieh@gmail.com> wrote:
> In more general terms, what's missing is the ability to create an
> arbitrary element (tag) with an id to link to from within the page. On
> the other hand, on your example page, I don't think you need the <a
> href="#id">, you can use simple Markdown links.
>
> To be able to create elements with id (including divs), you probably
> need to ask the people of Markdown / whatever parser nesta uses.
> Theoretically a plugin could be written to manually preprocess MD
> looking syntax, but that sounds pretty inelegant and fragile to me.
>
> Once that functionality is in, it's probably reasonably easy to have a
> plugin to automatically generate backlinks or even parse inline notes.
>
> I haven't used it, but I would have a look at the [Maldini plugin]. It
> is supposed to generate citations and references, which should be
> similar (that is, mentioned inline but shown at the end of the text).
> (I just looked at the code really quickly and it seems the author
> simply calls ruby functions by using the #{code} syntax. Is that
> possible in vanilla Markdown? That'd make things a lot easier and a
> plugin based on Maldini would be very doable)
>
> [Maldini plugin] http://nestacms.com/docs/plugins/maldini
>
> -Max Sadrieh
> On Tue, Apr 10, 2012 at 5:48 AM, Andrew Premdas <apremdas@gmail.com> wrote:
>> On 9 April 2012 12:45, Jacopo Notarstefano <jacopo.notarstefano@gmail.com>
>> wrote:
>>>
>>> Hey everyone!
>>>
>>> I've added some footnotes to a post on my blog and found the process very
>>> tedious. It involved writing most of the HTML by hand, nullifying the
>>> advantages of Markdown.
>>>
>>> Here is my commit:
>>> 
https://github.com/Jacquerie/jacquerie.it/commit/7fea4d70797cab07c778b9d1f7baa5420c7ea175#diff-0
>>> (scroll on the right to see what's changed).
>>>
>>> Did I miss something, or is this how I'm supposed to write footnotes?
>>>
>>> Cheers,
>>> Jacopo
>>
>>
>> It looks to me (your markdown is really hard  to read, restricting it to
>> 72chars per line would be a great improvement) that the old way was trying
>> to use [1] to link to the first referenced link, [2] to the second etc. But
>> the links were defined with string e.g. [The Harmless Way]: ...
>>
>> This is not in the markdown spec
>> (http://daringfireball.net/projects/markdown/syntax#link). The things in the
>> square brackets have to match
>>
>> e.g. blah [1]
>>
>> [1]: url "optional label"
>>
>> or blah [The Harmless Way]
>>
>> [The Harmless Way]: url "optional label.
>>
>> This has nothing to do with nesta.
>>
>> HTH
>>
>> Andrew
>>
>> --
>> ------------------------
>> Andrew Premdas
>> blog.andrew.premdas.org
>>

Re: [nesta] Adding footnotes to a blog post

From:
Graham Ashton
Date:
2012-04-12 @ 08:55
On 11 Apr 2012, at 21:59, Max Sadrieh wrote:

> I wrote a super simple plugin with hardcoded HTML (but hopefully with
> useful classes so you can modify how it looks easily) that lets you
> add footnotes pretty easily.

Nice one. Hey, isn't it time you mentioned your other plugin on this list?

Re: [nesta] Adding footnotes to a blog post

From:
Brad Weslake
Date:
2012-04-11 @ 22:17
Another option for footnotes is the following.  First specify Kramdown as 
your Markdown processor:

	http://nestacms.com/docs/creating-content/changing-the-markdown-processor

Then use the PHP Markdown Extra syntax to write footnotes:

	http://kramdown.rubyforge.org/syntax.html#footnotes

Brad.

Assistant Professor of Philosophy
University of Rochester
http://bweslake.org/

On Apr 11, 2012, at 4:59 PM, Max Sadrieh wrote:

> Hey,
> 
> I wrote a super simple plugin with hardcoded HTML (but hopefully with
> useful classes so you can modify how it looks easily) that lets you
> add footnotes pretty easily.
> 
> The basics:
> - Dont use ids that look like footnote-[x] or ref-[x]
> - Use haml and switch to markdown in the file so you can call ruby methods
> - Create a Nesta::Plugin::Footnote::Footnotes object (say `fn`)
> - Insert #{fn.footnote("My footnote")} wherever you want to add a
> reference to a footnote
> - Insert #{fn.printfootnotes} wherever you want to print the footnotes (duh)
> 
> See more at https://github.com/ms/nesta-plugin-footnote
> 
> Cheers.
> 
> -Max
> 
> On Tue, Apr 10, 2012 at 8:42 AM, Max Sadrieh <max.sadrieh@gmail.com> wrote:
>> In more general terms, what's missing is the ability to create an
>> arbitrary element (tag) with an id to link to from within the page. On
>> the other hand, on your example page, I don't think you need the <a
>> href="#id">, you can use simple Markdown links.
>> 
>> To be able to create elements with id (including divs), you probably
>> need to ask the people of Markdown / whatever parser nesta uses.
>> Theoretically a plugin could be written to manually preprocess MD
>> looking syntax, but that sounds pretty inelegant and fragile to me.
>> 
>> Once that functionality is in, it's probably reasonably easy to have a
>> plugin to automatically generate backlinks or even parse inline notes.
>> 
>> I haven't used it, but I would have a look at the [Maldini plugin]. It
>> is supposed to generate citations and references, which should be
>> similar (that is, mentioned inline but shown at the end of the text).
>> (I just looked at the code really quickly and it seems the author
>> simply calls ruby functions by using the #{code} syntax. Is that
>> possible in vanilla Markdown? That'd make things a lot easier and a
>> plugin based on Maldini would be very doable)
>> 
>> [Maldini plugin] http://nestacms.com/docs/plugins/maldini
>> 
>> -Max Sadrieh
>> On Tue, Apr 10, 2012 at 5:48 AM, Andrew Premdas <apremdas@gmail.com> wrote:
>>> On 9 April 2012 12:45, Jacopo Notarstefano <jacopo.notarstefano@gmail.com>
>>> wrote:
>>>> 
>>>> Hey everyone!
>>>> 
>>>> I've added some footnotes to a post on my blog and found the process very
>>>> tedious. It involved writing most of the HTML by hand, nullifying the
>>>> advantages of Markdown.
>>>> 
>>>> Here is my commit:
>>>> 
https://github.com/Jacquerie/jacquerie.it/commit/7fea4d70797cab07c778b9d1f7baa5420c7ea175#diff-0
>>>> (scroll on the right to see what's changed).
>>>> 
>>>> Did I miss something, or is this how I'm supposed to write footnotes?
>>>> 
>>>> Cheers,
>>>> Jacopo
>>> 
>>> 
>>> It looks to me (your markdown is really hard  to read, restricting it to
>>> 72chars per line would be a great improvement) that the old way was trying
>>> to use [1] to link to the first referenced link, [2] to the second etc. But
>>> the links were defined with string e.g. [The Harmless Way]: ...
>>> 
>>> This is not in the markdown spec
>>> (http://daringfireball.net/projects/markdown/syntax#link). The things in the
>>> square brackets have to match
>>> 
>>> e.g. blah [1]
>>> 
>>> [1]: url "optional label"
>>> 
>>> or blah [The Harmless Way]
>>> 
>>> [The Harmless Way]: url "optional label.
>>> 
>>> This has nothing to do with nesta.
>>> 
>>> HTH
>>> 
>>> Andrew
>>> 
>>> --
>>> ------------------------
>>> Andrew Premdas
>>> blog.andrew.premdas.org
>>>