Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add footnotes to GitHub-flavoured Markdown?

I am just trying to add footnotes in my GitHub Gist, but it doesn't work:

Some long sentence. [^footnote]  [^footnote]: Test, [Link](https://google.com). 

I am following this guide and I don't think I'm doing anything wrong. Can someone point out my mistake?

like image 484
Enrico Susatyo Avatar asked Aug 30 '14 07:08

Enrico Susatyo


People also ask

How do you add a footnote in Markdown?

To create a footnote reference, add a caret and an identifier inside brackets ( [^1] ). Identifiers can be numbers or words, but they can't contain spaces or tabs. Identifiers only correlate the footnote reference with the footnote itself — in the output, footnotes are numbered sequentially.

How do I add bullets to a readme in GitHub?

You can create bullet points in an unordered list in markdown format using an asterisk “*” at the beginning of the line. Links can be inserted anywhere in the readme.md. The structure is very similar to an image file, but without the exclamation mark at the beginning of the line.

How do you indicate code in Markdown?

There are two ways to format code in Markdown. You can either use inline code, by putting backticks (`) around parts of a line, or you can use a code block, which some renderers will apply syntax highlighting to.

What GitHub Flavored Markdown is and how it is used?

GitHub Flavored Markdown, often shortened as GFM, is the dialect of Markdown that is currently supported for user content on GitHub.com and GitHub Enterprise. This formal specification, based on the CommonMark Spec, defines the syntax and semantics of this dialect. GFM is a strict superset of CommonMark.


2 Answers

Expanding a little bit on the previous answer, you can make the footnote links clickable here as well. First define the footnote at the bottom like this

<a name="myfootnote1">1</a>: Footnote content goes here 

Then reference it at some other place in the document like this

<sup>[1](#myfootnote1)</sup> 
like image 200
suryasankar Avatar answered Oct 09 '22 23:10

suryasankar


GitHub Flavored Markdown doesn't support footnotes, but you can manually fake it¹ with Unicode characters or superscript tags, e.g. <sup>1</sup>.

¹Of course this isn't ideal, as you are now responsible for maintaining the numbering of your footnotes. It works reasonably well if you only have one or two, though.

like image 23
Chris Avatar answered Oct 09 '22 23:10

Chris