Skip to content

12 Contents, collapsible content and footnotes

mgledhill edited this page Mar 14, 2025 · 68 revisions

PAL Logo showing Wiki Documentation heading

12SpacerContents, collapsible content and footnotes

Tables of contents (TOCs) form an important part of a Wiki, PracticalSeries Wikis all have a table of contents in the sidebar, these are in a collapsible form that can be expanded or contracted by clicking a small black arrow at the side of the link.

Each entry in the TOC is a link that navigates to the appropriate section when clicked. This section explains how to construct a table of contents, how to make it collapsible and how to automatically produce the TOC entries.

Footnotes are also covered in this section. Footnotes are a peculiarity with GitHub Wikis; normally, footnotes can be created directly in the Markdown and using specific formatting characters that tell GitHub it’s a footnote and GitHub then creates a link to the footnote entry and from there, back to the original point in the body text. At least it does in normal Markdown files in a repository.

For some reason, footnotes don’t work in Wiki Markdown files. I have no reason why this should be. But there we go.

I’ve come up with a workaround to allow footnotes and their linkage to work on Wiki pages, and it is explained in this section.

⬆️ Top



12.1SpacerA basic table of contents

A table of contents (TOC) is simply a list of the heading on a page (or on many Wiki pages) that form navigable links to the appropriate page and heading.

These links are identical to those discussed in section 9.3 and section 9.4. The following is an extract of the TOC from this Wiki (it appears in the sidebar of the following page: https://github.com/practicalseries/GitHub-Wiki-Design-and-Implementation/wiki/01-Introducing-the-GitHub-Wiki).

Table of contents
Figure 12.1 — Table of contents in a sidebar

The Markdown behind this is:

Markdown and GitHub output
${\large \color{#0050C0}\text{M\ A\ R\ K\ D\ O\ W\ N}}$ 🔽

&emsp;&emsp;&ensp;&thinsp;&hairsp;[Home](home)<br><!-- HOME -->

&emsp;&emsp;&ensp;&thinsp;&hairsp;[Casenotes](casenotes)<br><!-- CASENOTES -->

&emsp;&emsp;&ensp;&thinsp;&hairsp;[The licences and other details](licence)<br><!-- LICENCE -->
&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;[The Licence](licence#the-licence)<br>
&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;[Why did I choose the MIT Licence?](licence#why-did-i-choose-the-mit-licence)<br>
&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;[Permissive licences](licence#permissive-licences)<br>
&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;[Copyleft licence](licence#copyleft-licence)<br>
&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;[Limiting liabilities](licence#limiting-liabilities)<br>
&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;[Which licence to use?](licence#which-licence-to-use)<br>
&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;[A note on spelling](licence#a-note-on-spelling-licence-or-license)<br>

&ensp;&nbsp;&nbsp;[1&ensp;&nbsp;&nbsp;&thinsp;Introducing the GitHub Wiki](01-Introducing-the-GitHub-Wiki)<br><!--SEC 01 -->
&emsp;&ensp;&hairsp;[1.3&emsp;&emsp;&nbsp;&nbsp;&thinsp;&hairsp;Creating a Wiki](01-Introducing-the-GitHub-Wiki#13creating-a-wiki-for-a-repository)<br>

${\large \color{#B00000}\text{G\ I\ T\ H\ U\ B}\space\ \space\text{O\ U\ T\ P\ U\ T}}$ 🔽

     Home

     Casenotes

     The licences and other details
       The Licence
       Why did I choose the MIT Licence?
       Permissive licences
       Copyleft licence
       Limiting liabilities
       Which licence to use?
       A note on spelling

   1    Introducing the GitHub Wiki
   1.3      Creating a Wiki

Table 12.1 — A basic table of contents in Markdown

Note

The <br> at the end of each line is required (the lines join up otherwise).

Ignoring all the special space characters at the start (these are just used to pad the links to the correct indentation), it becomes:

Markdown and GitHub output
${\large \color{#0050C0}\text{M\ A\ R\ K\ D\ O\ W\ N}}$ 🔽

[Home](home)<br>

[Casenotes](casenotes)<br>

[The licences and other details](licence)<br>
[The Licence](licence#the-licence)<br>
[Why did I choose the MIT Licence?](licence#why-did-i-choose-the-mit-licence)<br>
[Permissive licences](licence#permissive-licences)<br>
[Copyleft licence](licence#copyleft-licence)<br>
[Limiting liabilities](licence#limiting-liabilities)<br>
[Which licence to use?](licence#which-licence-to-use)<br>
[A note on spelling](licence#a-note-on-spelling-licence-or-license)<br>

[1. Introducing the GitHub Wiki](01-Introducing-the-GitHub-Wiki)<br>

Table 12.2 — A simplified table of contents

These are just standard markdown links covered in section 9.4, they are in the form:

     ${\LARGE \color{#0050C0}\text{[}\color{#C00000}\text{Substitute\ Text}\color{#0050C0}\text{](}\color{#4B0082}\text{pageName}}$Hash${\LARGE \color{#1F883D}\text{headingName}\color{#0050C0}\text{)}}$

If the link is just to a Wiki page (it will load at the top of the page), this is simplified to:

     ${\LARGE \color{#0050C0}\text{[}\color{#C00000}\text{Substitute\ Text}\color{#0050C0}\text{](}\color{#4B0082}\text{pageName}\color{#0050C0}\text{)}}$

The HTML equivalent is:

HTML and GitHub output
${\large \color{#00C050}\text{H\ T\ M\ L}}$ 🔽

&emsp;&emsp;&ensp;&thinsp;&hairsp;<a href="home">Home</a><br>

&emsp;&emsp;&ensp;&thinsp;&hairsp;<a href="casenotes">Casenotes</a><br>

&emsp;&emsp;&ensp;&thinsp;&hairsp;<a href="licence">The licences and other details</a><br>
&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;<a href="licence#the-licence">The Licence</a><br>
&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;<a href="licence#why-did-i-choose-the-mit-licence">Why did I choose the MIT Licence?</a><br>
&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;<a href="licence#permissive-licences">Permissive licences</a><br>
&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;<a href="licence#copyleft-licence">Copyleft licence</a><br>
&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;<a href="licence#limiting-liabilities">Limiting liabilities</a><br>
&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;<a href="licence#which-licence-to-use">Which licence to use?</a><br>
&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;<a href="licence#a-note-on-spelling-licence-or-license">A note on spelling</a><br>

&ensp;&nbsp;&nbsp;<a href="01-Introducing-the-GitHub-Wiki">1&ensp;&nbsp;&nbsp;&thinsp;Introducing the GitHub Wiki</a><br>
&emsp;&ensp;&hairsp;<a href="01-Introducing-the-GitHub-Wiki#13creating-a-wiki-for-a-repository">1.3&emsp;&emsp;&nbsp;&nbsp;&thinsp;&hairsp;Creating a Wiki</a><br>

${\large \color{#B00000}\text{G\ I\ T\ H\ U\ B}\space\ \space\text{O\ U\ T\ P\ U\ T}}$ 🔽

     Home

     Casenotes

     The licences and other details
       The Licence
       Why did I choose the MIT Licence?
       Permissive licences
       Copyleft licence
       Limiting liabilities
       Which licence to use?
       A note on spelling

   1    Introducing the GitHub Wiki
   1.3      Creating a Wiki

Table 12.3 — The basic table of contents in HTML

Again, these are in the standard HTML format for a link to a point on a page:

     ${\LARGE \color{#0050C0}\text{&lt;a\ href="}\color{#4B0082}\text{pageName}}$Hash${\LARGE \color{#1F883D}\text{headingName}\color{#0050C0}\text{"&gt;}\color{#C00000}\text{Substitute\ Text}\color{#0050C0}\text{&lt;/a&gt;}}$

The #headingName can be omitted if linking to the top of the page

⬆️ Top



12.2SpacerUnderstanding the space characters

In the above example (either Markdown or HTML) there are strings of special space characters at the start of each line (an example is shown below):

Markdown and GitHub output
${\large \color{#0050C0}\text{M\ A\ R\ K\ D\ O\ W\ N}}$ 🔽

&emsp;&ensp;&hairsp;[1.3.1&emsp;&nbsp;&nbsp;&nbsp;&nbsp;The first page]...

Table 12.4 — Special space characters in a TOC

These are used to indent the links so that they all line up, the alignment is as follows:

Table of contents
Figure 12.2 — Table of contents alignment in a sidebar

The general arrangement is that the chapter numbers all align on the left edge (with allowances for a collapsible area arrow, see section 12.4), this is shown by the solid pink line.

Section and subsection numbers are indented one numerical character (to align with a second digit of a chapter number), dotted pink line.

Chapter heading text is indented to align with the first full stop in a two-digit section number, dotted orange line.

If unnumbered chapter headings are used (CaseNotes and Home in the example of the previous section), these are indented to the same position, again, the dotted orange line.

Section and subsection texts are indented sufficiently to allow a number in the form nn.nn.nn (i.e. three, two-digit numbers) to precede the text, dotted green line.

These spacings are created by the strings of special space characters, e.g.:

   &emsp;&emsp;&ensp;&thinsp;&hairsp;

These force a correctly spaced gap before the heading number and heading text in the table of contents. By being inserted before the opening bracket, they do not form part of the heading itself, indenting the underline bar that indicates a clickable link.

These special space characters just make everything line up correctly and give a pleasing appearance. They are used extensively within the PracticalSeries Wikis and are discussed further in section 16.6.

⬆️ Top



12.3SpacerCollapsible content

Content within Markdown pages can be made collapsible (effectively hidden from view until clicked). Such content is often used within tables of contents, but can also be used for any text and even images.

The following shows two examples of collapsible content:

An example of lorem ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. In consectetur tortor a tortor ornare, non pretium diam faucibus. Morbi ut mollis dolor, nec pretium tellus. Suspendisse ornare neque placerat orci aliquam, eu sodales dui blandit.
A picture of Henry
Henry
Figure 1.1 — Henry the dog

Clicking either of the two right-pointing arrows above will display the hidden content (shown open below):

An example of lorem ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. In consectetur tortor a tortor ornare, non pretium diam faucibus. Morbi ut mollis dolor, nec pretium tellus. Suspendisse ornare neque placerat orci aliquam, eu sodales dui blandit.
A picture of Henry
Henry
Figure 1.1 — Henry the dog

When the content is expanded, the arrows point downwards (clicking the arrow again collapses the content once more).

Collapsible content is only possible with HTML, the code behind the first “lorem ipsum” example above is:

HTML
${\large \color{#00C050}\text{H\ T\ M\ L}}$ 🔽

<details><!-- START OF COLLAPSIBLE AREA -->
<summary>An example of lorem ipsum</summary><!-- VISIBLE TEXT -->
<!-- HIDDEN CONTENT -->Lorem ipsum dolor sit amet, consectetur adipiscing elit. In consectetur tortor a tortor ornare, non pretium diam faucibus. Morbi ut mollis dolor, nec pretium tellus. Suspendisse ornare neque placerat orci aliquam, eu sodales dui blandit.
</details><!-- END OF COLLAPSIBLE AREA -->

Table 12.5 — HTML for collapsible content

The format for any collapsible content is:

HTML
${\large \color{#00C050}\text{H\ T\ M\ L}}$ 🔽

${\color{#0050C0}\text{&lt;details&gt;}}$
${\color{#0050C0}\text{&lt;summary&gt;}\color{#C00000}\text{VisibleText}\color{#0050C0}\text{&lt;/summary&gt;}}$
${\color{#1F883D}\text{HiddenContent}}$
${\color{#0050C0}\text{&lt;/details&gt;}}$

The ${\color{#0050C0}\text{&lt;details&gt;}}$ tag is used to identify an area that contains additional information (details) that the user can open on demand.

The ${\large \color{#0050C0}\text{&lt;details&gt;}}$ tag is usually followed by a ${\large \color{#0050C0}\text{&lt;summary&gt;}}$ tag, anything within the ${\large \color{#0050C0}\text{&lt;summary&gt;}}$ tag becomes a ${\large \color{#C00000}\text{VisibleText}}$ heading for the ${\large \color{#0050C0}\text{&lt;details&gt;}}$ tag, it is always displayed and will have the little right-pointing arrow next to it.

Everything else between the ${\large \color{#0050C0}\text{&lt;details&gt;}}$ tags that is not enclosed in a ${\large \color{#0050C0}\text{&lt;summary&gt;}}$ tag will be hidden until the right-pointing arrow is clicked.

Note

There should only be one <summary> tag per <details> tag, if more than one is included, only the first will be displayed, subsequent entries will be shown as unordered list points

For completeness, the HTML for the second “Henry” picture is:

HTML
${\large \color{#00C050}\text{H\ T\ M\ L}}$ 🔽

<details><!-- START OF COLLAPSIBLE AREA -->
<summary>A picture of Henry</summary><!-- VISIBLE TEXT -->
<table align="center"><tr><td><!-- HIDDEN CONTENT -->
  <img width="400" src="11-0000/02-images/figm-99-01.png" alt="Henry">
  </td></tr>
  <tr><th align="center"><sup>Figure 1.1 &mdash; Henry the dog</sup></th></tr>
</table>
</details><!-- END OF COLLAPSIBLE AREA -->

Table 12.6 — HTML for collapsible image in a table

⬆️ Top



12.3.1SpacerDefaulting to open

By default, collapsible areas are closed when a page loads, it is possible to force a collapsible area to default to the expanded state by using the ${\large \color{#00B050}\text{open}}$ attribute within the ${\large \color{#0050C0}\text{&lt;details&gt;}}$ tag:

HTML and GitHub output
${\large \color{#00C050}\text{H\ T\ M\ L}}$ 🔽

<details open><!-- START OF COLLAPSIBLE AREA -->
<summary>An example of lorem ipsum</summary><!-- VISIBLE TEXT -->
<!-- HIDDEN CONTENT -->Lorem ipsum dolor sit amet, consectetur adipiscing elit. In consectetur tortor a tortor ornare, non pretium diam faucibus. Morbi ut mollis dolor, nec pretium tellus. Suspendisse ornare neque placerat orci aliquam, eu sodales dui blandit.
</details><!-- END OF COLLAPSIBLE AREA -->

${\large \color{#B00000}\text{G\ I\ T\ H\ U\ B}\space\ \space\text{O\ U\ T\ P\ U\ T}}$ 🔽
An example of lorem ipsum Lorem ipsum dolor sit amet, consectetur adipiscing elit. In consectetur tortor a tortor ornare, non pretium diam faucibus. Morbi ut mollis dolor, nec pretium tellus. Suspendisse ornare neque placerat orci aliquam, eu sodales dui blandit.
Table 12.7 — An expanded by default collapsible area

This causes the hidden text to be expanded by default when the page loads (clicking the arrow will close the expanded area as normal).

⬆️ Top



12.3.2SpacerMarkdown restrictions

There are certain restrictions with the ${\large \color{#0050C0}\text{&lt;summary&gt;}}$ tag:

It is not possible to put Markdown links (or indeed any Markdown formatting, not even **) inside a <summary> tag.

Any link or formatting that is required inside the ${\large \color{#0050C0}\text{&lt;summary&gt;}}$ tag must use HTML.

HTML can be used in the ${\large \color{#1F883D}\text{HiddenContent}}$ area, however, to do so there must be a blank line following the closing ${\large \color{#0050C0}\text{&lt;/summary&gt;}}$ tag.

⬆️ Top



12.4SpacerCollapsible TOC

The most widely used application of collapsible content is to manage tables of content.

Within the PracticalSeries Wikis, the TOC in the sidebar uses collapsible content to display only the chapter numbers and headings (the sections and subsections for each chapter being hidden). The contents for the current page are, however, expanded showing the section and subsections for that page.

The following is the sidebar TOC for chapter 2 of this Wiki:

Table of contents
Figure 12.3 — Collapsible TOC

To explain the collapsible TOC, consider the HTML (and Markdown) behind the chapter 2 TOC entry above:

HTML and GitHub output
${\large \color{#00C050}\text{H\ T\ M\ L}}$ 🔽

<details open><!-- SECTION 02 -->
<summary><a href="02-Cloning-a-Wiki">2&ensp;&nbsp;&nbsp;&thinsp;Cloning a Wiki</a>
</summary><!-- BLANK LINE BELOW -->

&emsp;&ensp;&hairsp;[2.1&emsp;&emsp;&nbsp;&nbsp;&thinsp;&hairsp;Why clone a Wiki?](02-Cloning-a-Wiki#21why-clone-a-wiki-to-a-local-machine)<br>
&emsp;&ensp;&hairsp;[2.2&emsp;&emsp;&nbsp;&nbsp;&thinsp;&hairsp;How to clone a Wiki](02-Cloning-a-Wiki#22how-to-clone-a-wiki-to-a-local-machine)<br>
&emsp;&ensp;&hairsp;[2.3&emsp;&emsp;&nbsp;&nbsp;&thinsp;&hairsp;Pushing changes to GitHub](02-Cloning-a-Wiki#23pushing-wiki-changes-back-to-github)<br>
&emsp;&ensp;&hairsp;[2.3.1&emsp;&nbsp;&nbsp;&nbsp;&nbsp;Configuring the Git credentials](02-Cloning-a-Wiki#231configuring-the-git-username-and-email-address)<br>
&emsp;&ensp;&hairsp;[2.3.2&emsp;&nbsp;&nbsp;&nbsp;&nbsp;Commit and synchronise to GitHub](02-Cloning-a-Wiki#232committing-the-changes-and-synchronising-with-github)<br>
</details><!-- END OF COLLAPSIBLE AREA -->

${\large \color{#B00000}\text{G\ I\ T\ H\ U\ B}\space\ \space\text{O\ U\ T\ P\ U\ T}}$ 🔽
2    Cloning a Wiki

   2.1      Why clone a Wiki?
   2.2      How to clone a Wiki
   2.3      Pushing changes to GitHub
   2.3.1     Configuring the Git credentials
   2.3.2     Commit and synchronise to GitHub

Table 12.8 — HTML for collapsible TOC

This collapsible TOC is simply a collapsible content area that contains links in a similar fashion to the basic TOC in section 12.1.

The only differences being that the visible link contained within the ${\large \color{#0050C0}\text{&lt;summary&gt;}}$ tag is coded as HTML (Markdown formatting is not permitted within the ${\large \color{#0050C0}\text{&lt;summary&gt;}}$ tag, see section 12.3.2) and the ${\large \color{#0050C0}\text{&lt;/summary&gt;}}$ tag is followed by a blank line.

The blank line after the ${\large \color{#0050C0}\text{&lt;/summary&gt;}}$ tag is necessary for GitHub, if it is not present, GitHub will not render the Markdown links correctly.

Once collapsible TOCs have been created for each chapter (in a particular sidebar), they can be copied en-masse to all other sidebars (all sidebars have the same contents allowing navigation to any page in the Wiki).

The only distinction between the sidebars, is that the TOC for the chapter associated with the current page should be set to ${\large \color{#00B050}\text{open}}$.

⬆️ Top



12.5SpacerTOCs in tables

TOCs can be inserted directly into HTML table (they can be inserted in to Markdown tables too, but Markdown tables require a heading row which isn’t required with a TOC).

HTML and GitHub output
${\large \color{#00C050}\text{H\ T\ M\ L}}$ 🔽

<table align="center">
<tr>
<td width="425" valign="top">
<details><!-- SECTION 01 -->
<summary><a href="https://github.com/practicalseries/GitHub-Wiki-Design-and-Implementation/wiki/01-Introducing-the-GitHub-Wiki">1&ensp;&nbsp;&nbsp;&thinsp;Introducing the GitHub Wiki</a>
</summary><!-- BLANK LINE BELOW -->

&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;[A note by the Author](01-Introducing-the-GitHub-Wiki#a-note-by-the-author)<br>
&emsp;&ensp;&hairsp;[1.1&emsp;&emsp;&nbsp;&nbsp;&thinsp;&hairsp;What are GitHub Wiki pages?](01-Introducing-the-GitHub-Wiki#11what-are-github-wiki-pages)<br>
&emsp;&ensp;&hairsp;[1.2&emsp;&emsp;&nbsp;&nbsp;&thinsp;&hairsp;Understanding the Wiki pages](01-Introducing-the-GitHub-Wiki#12understanding-the-wiki-pages)<br>
&emsp;&ensp;&hairsp;[1.3&emsp;&emsp;&nbsp;&nbsp;&thinsp;&hairsp;Creating a Wiki for a repository](01-Introducing-the-GitHub-Wiki#13creating-a-wiki-for-a-repository)<br>
&emsp;&ensp;&hairsp;[1.3.1&emsp;&nbsp;&nbsp;&nbsp;&nbsp;Creating the first Wiki page](01-Introducing-the-GitHub-Wiki#131creating-the-first-wiki-page)<br>
</details>
</td>

<td width="425" valign="top">
<details><!-- SECTION 02 -->
<summary><a href="02-Cloning-a-Wiki">2&ensp;&nbsp;&nbsp;&thinsp;Cloning a Wiki</a>
</summary><!-- BLANK LINE BELOW -->

&emsp;&ensp;&hairsp;[2.1&emsp;&emsp;&nbsp;&nbsp;&thinsp;&hairsp;Why clone a Wiki?](02-Cloning-a-Wiki#21why-clone-a-wiki-to-a-local-machine)<br>
&emsp;&ensp;&hairsp;[2.2&emsp;&emsp;&nbsp;&nbsp;&thinsp;&hairsp;How to clone a Wiki](02-Cloning-a-Wiki#22how-to-clone-a-wiki-to-a-local-machine)<br>
&emsp;&ensp;&hairsp;[2.3&emsp;&emsp;&nbsp;&nbsp;&thinsp;&hairsp;Pushing changes to GitHub](02-Cloning-a-Wiki#23pushing-wiki-changes-back-to-github)<br>
&emsp;&ensp;&hairsp;[2.3.1&emsp;&nbsp;&nbsp;&nbsp;&nbsp;Configuring the Git credentials](02-Cloning-a-Wiki#231configuring-the-git-username-and-email-address)<br>
&emsp;&ensp;&hairsp;[2.3.2&emsp;&nbsp;&nbsp;&nbsp;&nbsp;Commit and synchronise to GitHub](02-Cloning-a-Wiki#232committing-the-changes-and-synchronising-with-github)<br>
</details>
</td></tr>
</table>




It looks like this:

1    Introducing the GitHub Wiki

       A note by the Author
   1.1      What are GitHub Wiki pages?
   1.2      Understanding the Wiki pages
   1.3      Creating a Wiki for a repository
   1.3.1     Creating the first Wiki page

2    Cloning a Wiki

   2.1      Why clone a Wiki?
   2.2      How to clone a Wiki
   2.3      Pushing changes to GitHub
   2.3.1     Configuring the Git credentials
   2.3.2     Commit and synchronise to GitHub

Table 12.9 — TOC in a table

The code for the collapsible TOC is the same as in the previous section (it starts and ends with the <details> tags).

Around this is the code for a one-row, two-column table.

The only thing of note here is that each cell is set to a width of 425 px to make the column widths equal and each is vertically aligned to the top, this stops the alternate column from centring vertically when one TOC is expanded and the other isn’t.

⬆️ Top



12.6SpacerFootnotes

Footnotes are a slightly peculiar topic for the following reason:

GitHub Markdown has a structure for footnotes that works in Markdown files in a repository (a README.md file for example); the same structure does not, however, work in Wiki Markdown files.

In a repository Markdown file a footnote is indicated by entering [^nnn], where nnn is a unique identifier (usually a number indicating the number of the footnote).

The footnote text is given at some other point in the file with the format [^nnn]: FootnoteText. Here is an example:

Markdown and GitHub output
${\large \color{#0050C0}\text{M\ A\ R\ K\ D\ O\ W\ N}}$ 🔽

The LOX pump delivered fuel at the rate of 24,811 gallons per minute [^1] and the kerosene from the tankage to the combustion chamber at the rate of 15,741 gallons per minute.

[^1]: it would have filled a swimming pool twenty-five feet long, ten feet wide, and six feet deep in twenty-seven seconds.

Table 12.10 — A typical footnote in a repository Markdown file

It looks like this in a repository README.md file:

Read.me footnote
Figure 12.4 — A footnote in a repository Markdown file

The footnote reference appears as a superscript 1 in brackets, point ① above. The footnote itself appears at the end of the page, point ② (irrespective of where the footnote text is entered on the page). Clicking the footnote reference, point ①, navigates to the footnote text, clicking the return emoji, point ③, navigates back to the reference point.

Putting exactly the same code in a Wiki Markdown file does this:

Wiki footnote not working
Figure 12.5 — The same footnote in a Wiki Markdown file

Here, the footnote formatting is ignored and the entries appear as literal text.

I don’t know why footnotes work in repository Markdown files, but not in Wiki Markdown files, there doesn’t seem to be any explanations online either.

So what to do?

I want to use footnotes; they lend themselves to my style of writing. So I came up with my own version. It uses HTML anchor points, links and the note alert.

My version of the above footnote looks like this:

🔽🔽🔽🔽🔽🔽

The LOX pump had to deliver fuel at the rate of 24,811 gallons per minute and the kerosene from the tankage to the combustion chamber at the rate of 15,741 gallons per minute.

Note

💠1 It would have filled a swimming pool twenty-five feet long, ten wide and six deep in twenty-seven seconds.

🔼🔼🔼🔼🔼🔼

Breaking it down it looks like this:

PS footnote
Figure 12.6 — PracticalSeries footnote in a Wiki Markdown file

This has a footnote reference (albeit with a diamond instead of the brackets), point ① above. The footnote itself, point ②, is a note type alert (see section 8.6); this contains the footnote reference, point ③ and a return link, point ④, clicking either of these links back to the original footnote reference.

So how does it work?

This is the code behind it

HTML and GitHub output
${\large \color{#00C050}\text{H\ T\ M\ L}}$ 🔽

The LOX pump had to deliver fuel at the rate of 24,811 gallons per minute<a name="rn-01" href="#fn-01"><sup>💠1</sup></a> 
and the kerosene from the tankage to the combustion chamber at the rate of 15,741 gallons per minute.


> [!NOTE]<!-- 🟡FOOTNOTE CONTENT -->
> <a name="fn-01" href="#rn-01"><sup>💠1</sup></a>&emsp;It would have filled a swimming pool twenty-five feet long, 
ten wide and six deep in twenty-seven seconds.<a href="#rn-01"></a>

${\large \color{#B00000}\text{G\ I\ T\ H\ U\ B}\space\ \space\text{O\ U\ T\ P\ U\ T}}$ 🔽

The LOX pump had to deliver fuel at the rate of 24,811 gallons per minute💠1 and the kerosene from
the tankage to the combustion chamber at the rate of 15,741 gallons per minute.

[!NOTE] 💠1 It would have filled a swimming pool twenty-five feet long, ten wide and six deep in twenty-seven seconds.

Table 12.11 — A PracticalSeries footnote in a Wiki Markdown file

Examining the first bit, the footnote reference, it looks like this:

   <a name="rn-01" href="#fn-01"><sup>💠1</sup></a>

And has the general format:

   <a name="returnID" href="#footnoteID"><sup>VisibleText</sup></a>

Firstly, returnID and footnoteID must be unique within the page (I use rn-xx for the returnID and fn-xx for the footnoteID, I keep the number xx the same for both and increment by 1 for each successive footnote on the page).

The name="returnID" sets the return point from the footnote text, the href="#footnoteID" is the link to the footnote text (see section 9.5 for full details of linking to anchor points). The VisibleText is simply what is displayed as the footnote link (in this case it is in superscript).

The footnote itself has to be positioned within the Markdown file. I tend to position them at the end of the page within which they occur.

The footnote itself is a Markdown note alert (see section 8.6 for full details), this displays the blue ℹ in a circle and the note caption and puts a blue line down the left-hand side of the footnote (again see section 8.6).

The first part of the footnote shows the same VisibleText as the footnote reference above (a blue diamond with a number), this time the code is:

   <a name="fn-01" href="#rn-01"><sup>💠1</sup></a>

And has the general format:

   <a name="footnoteID " href="#returnID "><sup>VisibleText</sup></a>

The, returnID and footnoteID must be match those used in the footnote reference.

The name="footnoteID" sets the anchor point from the footnote text (this is linked to in the footnote reference), the href="#returnID" is the return link to the footnote reference in the body text. The VisibleText is simply what is displayed as the footnote link (it is identical to the footnote reference).

This anchor link is followed by the text of the footnote which terminates with:

   <a href="#rn-01">↩</a>

And has the general format:

   <a href="#returnID "><sup>VisibleText</sup></a>

This is just a return link to the footnote reference in the body text, this time with a return emoji.




Wiki contentsSpacer

Previous page Previous chapter Home Next chapter Next page
   Home

       The GitHub Wiki
       What does this guide cover?
       A note by the Author

     CaseNotes

   Licence

       The licences and other details
       The Licence
       Why did I choose the MIT Licence?
       Permissive licences
       Copyleft licence
       Limiting liabilities
       Which licence to use?
       A note on spelling: licence or license

1    Introducing the GitHub Wiki

   1.1      What are GitHub Wiki pages?
   1.2      Understanding the Wiki pages
   1.3      Creating a Wiki for a repository
   1.3.1     Creating the first Wiki page
   1.3.2     Creating additional pages
   1.3.3     Editing a Wiki page
   1.4      The Wiki is its own repository
   1.4.1     Viewing a Wiki page history
   1.4.2     How GitHub handles Wiki branche
   1.4.3     The Wiki link to the main repository
   1.5      Basic components of a Wiki page
   1.5.1     Title bar and revision
   1.5.2     Contents (pages) area
       Listing pages in the order you want
   1.5.3     Sidebars
   1.5.4     Footers
   1.6      Sidebars and footers
   1.6.1     Creating a sidebar and footer

2    Cloning a Wiki

   2.1      Why clone a Wiki?
   2.2      How to clone a Wiki
   2.3      Pushing local changes to GitHub
   2.3.1     Configuring username and email
   2.3.2     Modifying the local repository
   2.3.3     Committing and synchronising

3    A Wiki folder structure

   3.1      The default arrangement
   3.2      Create a sidebar or footer locally
   3.3      Page naming and Wiki limits
   3.3.1     Supported file types
   3.3.2     Page names and numbering
   3.3.3     Rules for page numbering
   3.3.4     Limits for Wiki pages
   3.4      A Practical Wiki folder structure
   3.4.1     Subfolder names for Wiki pages
   3.4.2     Storing images and other data

4    Different sidebars and footers

   4.1      How sidebars work
   4.1.1     The PracticalSeries sidebar
   4.2      How footers work
   4.2.1     The PracticalSeries footer

5    Markdown, GitHub Markdown and HTML

   5.1      Some useful Markdown sites
   5.2      An overview of Markdown
   5.3      How Markdown works
   5.4      Markdown flavours
   5.4.1     GitHub Flavoured Markdown (GFM)
   5.5      HTML and Markdown
   5.5.1     HTML with GFM
       GFM blacklisted HTML tags
       GFM whitelisted HTML tags
       GFM HTML tags - the grey area
       GFM whitelisted HTML attributes
   5.5.2     PracticalSeries and Markdown
   5.6      Markdown difference between files

6    Basic Markdown and text formatting

   6.1      Body text and fonts
   6.1.1     Body text responsive design
   6.1.2     Body text in sidebars and footers
   6.1.3     Rules for body text
   6.1.4     Body text examples
   6.1.5     Alignment of Body text
       Left aligned text (default)
       Right aligned text
       Centred text
       Justified text
   6.1.6     Body text propertie
   6.2      Paragraphs and line breaks
   6.2.1     Forced line break
   6.2.2     Blank line and a line break
   6.2.3     Trailing space line break
   6.2.4     Paragraph and line break rules
   6.2.5     Paragraph and line break examples
   6.3      Horizontal line
   6.3.1     Rules for horizontal lines
   6.4      Emphasis with bold
   6.4.1     Rules for bold
   6.4.2     Bold text examples
   6.5      Emphasis with italics
   6.5.1     Rules for italics
   6.5.2     Italic text examples
   6.6      Emphasis with bold and italics
   6.6.1     Rules for bold and italics
   6.6.2     Bold and italic text examples
   6.7      Emphasis with underlining
   6.7.1     Rules for underlining
   6.7.2     Underlining text examples
   6.8      Emphasis with strikethrough
   6.8.1     Rules for strikethrough
   6.8.2     Strikethrough text examples
   6.9      Superscript and subscript
   6.9.1     Rules for superscript and subscript
   6.9.2     Superscript and subscript examples
   6.10    Headings
       Alternatives for heading 1 and 2
   6.10.1   Headings Markdown rules
   6.10.2   Heading properties

7    Special characters and escaping characters

   7.1      Escape characters and codes
   7.1.1     Markdown escape sequences
   7.1.2     HTML escape sequences
   7.1.3     Decimal and hexadecimal codes
       Hexadecimal escape codes
   7.2      Special space characters
   7.2.1     Escape sequence restrictions
   7.3      Emojis and emoticons
       A note by the Author about emojis
   7.4      Comments

8    Block quotes, lists and alerts

   8.1      Block quotes
   8.1.1     Nested block quotes
   8.1.2     Adding other elements
   8.1.3     Rules for block quotes
   8.2      Unordered (unnumbered) lists
   8.2.1     Nested unordered lists
   8.2.2     Type of bullet point
   8.2.3     Indents and spacing
   8.2.4     Numbers in an unordered list
   8.2.5     Adding paragraphs
   8.2.6     Adding other elements
   8.2.7     Rules for unordered lists
   8.3      Ordered (numbered) lists
   8.3.1     Starting at a different number
   8.3.2     Nested ordered lists
   8.3.3     Type of numbering
   8.3.4     Indents and spacing
   8.3.5     Adding paragraphs
   8.3.6     Adding other elements
   8.3.7     Rules for ordered lists
   8.4      Mixing ordered and unordered lists
   8.5      Task lists (check boxes)
   8.5.1     Nested task lists
   8.6      Alerts
   8.6.1     Rules for alerts

9    Links

   9.1      Link to an external web page
   9.1.1     A direct link to a URL
   9.1.2     A link using substitute text
   9.1.3     A link using tooltips
   9.2      Link to another page in the Wiki
   9.2.1     Rules for linking to a Wiki page
   9.3      Link to headings on current page
   9.3.1     Converting a heading to a link
   9.3.2     An example of a heading link
   9.3.3     Heading link with tooltips
   9.4      Link to headings on a different page
   9.4.1     An example of a heading link
   9.5      Link to a named element
       A note by the Author
   9.5.1     Link to a point on another page
   9.6      Downloading a file
   9.6.1     The download attribute
   9.6.2     Spaces in filenames
   9.6.3     Downloading a .md file
   9.7      Reference style links
   9.8      Relative links
   9.8.1     Relative links from any Wiki page

10  Tables

   10.1    Markdown tables
   10.1.1   Horizontal alignment
   10.1.2   Table construction
   10.1.3   Vertical line breaks and alignment
   10.1.4   Making columns wider
   10.1.5   Other elements in a table
   10.1.6   Markdown table restrictions
   10.2    HTML tables
   10.2.1   A basic HTML table
   10.2.2   Aligning a table on a page
   10.2.3   Text wrap and side-by-side tables
       What this means in practice
       The problem with the align attribute
       How to stop text wrapping
   10.2.4   Setting the width of a table column
   10.2.5   Setting the height of a table row
   10.2.6   Horizontal alignment
   10.2.7   Vertical alignment
   10.2.8   Spanning columns and rows
   10.2.9   Table border
   10.2.10   Giving a table a navigable name
   10.2.11   Additional HTML tags

11  Images

   11.1    Markdown images
   11.1.1   Image size in Markdown
   11.1.2   Making the image a link
   11.1.3   Drag and drop image link
       A note by the Author
   11.2    HTML images
   11.2.1   A basic HTML image
   11.2.2   Image size in HTML
   11.2.3   Horizontal alignment
   11.2.4   Making the image a link
   11.2.5   Using a table to contain an image
   11.3    Forcing an image refresh
   11.4    Using a spacer image
   11.5    Mermaid diagrams
   11.5.1   Inserting a Mermaid diagram
   11.5.2   The rendered Mermaid diagram
   11.5.3   Supported version of Mermaid
   11.6    Interactive maps
   11.7    3D models

12  Contents (collapsible) and footnotes

   12.1    A basic table of contents
   12.2    Understanding the space characters
   12.3    Collapsible content
   12.3.1   Defaulting to open
   12.3.2   Markdown restrictions
   12.4    Collapsible TOC
   12.5    TOCs in tables
   12.6    Footnotes

13  Code fragments

   13.1    Inline code
   13.2    Code blocks
   13.2.1   Preferred mechanism
   13.3    Syntax highlighting
   13.3.1   Supported languages
   13.4    HTML code fragments
   13.4.1   Converting HTML to code

14  Mathematical formulae

   14.1    An overview of LaTex
   14.2    Inserting an inline formula
   14.2.1   Alternative delimiter
   14.3    A formula block
   14.4    Some example formulae
   14.5    LaTeX syntax
   14.5.1   Greek lowercase
   14.5.2   Greek uppercase and Hebrew
   14.5.3   Mathematical constructions
   14.5.4   Variable sized delimiters
   14.5.5   Variable sized symbols
   14.5.6   Variable sized symbols with limits
   14.5.7   Standard functions
   14.5.8   Operators and relational symbols
   14.5.9   Arrows
   14.5.10   Other symbols
   14.5.11   Accents
   14.5.12   Matrices
   14.5.13   Cases
       Aligning multiple equations
   14.5.14   Text formatting
       Font size
       Font colour
       The text command
       Font restrictions
   14.6    Abusing LaTeX
   14.6.1   Changing font colour with LaTeX

15  Navigation bars, badges and buttons

   15.1    Navigation bars
   15.1.1   Navigation bar practicalities
   15.2    Badges
   15.2.1   Creating a badge
   15.2.2   Static badge options
   15.2.3   Dynamic badges
   15.3    Buttons

16  PracticalSeries Wiki conventions

   16.1    The PracticalSeries Wiki page
   16.2    The PracticalSeries folder structure
   16.2.1   The root folder and home page
   16.2.2   Leading pages
   16.2.3   .gitkeep files
   16.2.4   Folder and Markdown file names
       Wiki pages that start at a section
   16.3    The page title area
   16.4    The page heading area
   16.4.1   Top of page marker
   16.4.2   Logo image
   16.4.3   Web ID badge
   16.5    Main body area
   16.5.1   Common page elements
       End of page marker
       End of section elements
   16.5.2   Headings
       Compensating for number widths
       Appendices headings
   16.5.3   Tables
       Links to a table
       A note on Markdown tables
   16.5.4   Images
       Images that open in a new tab
       Double images
       Links to a figure
   16.5.5   Lists
       Common points for all lists
       Basic unordered list
       Basic ordered list
       Mixed ordered and unordered lists
       Enhanced mixed lists
       Index list
       Reverse index list
       Index list with text wrap
       Reverse index list with text wrap
       Indexed, mixed list
       Reverse indexed, mixed list
       Task list
       Enhanced task list with observations
   16.5.6   Code fragments
   16.5.7   Formulae
       Standard formulae
       Alternate formulae
   16.6    Sidebar
   16.6.1   sidebar files and locations
   16.6.2   Sidebar title and location badge
   16.6.3   Navigation bar
   16.6.4   Table of contents
       Unnumbered, non-collapsible TOC
       Unnumbered, collapsible TOC
       Single digit, collapsible TOC
       Double digit, collapsible TOC
       TOCs for appendices
   16.6.5   End of page link
   16.7    Footer
   16.7.1   Footer files and locations
   16.7.2   Location badge
   16.7.3   Navigation bar
   16.7.4   Colophon
   16.7.5   Links and contacts

17  Managing a Wiki

   17.1    Revision control
   17.1.1   Managing commits
   17.2    Finding the first Wiki commit
   17.3    Rebasing the Wiki
   17.3.1   Summarising the rebase process
   17.3.2   Executing the rebase process
   17.4    Wikis and search engine visibility


Appendices
A    Unicode and HTML escape

   A.1     HTML Escape codes, full list
   A.2     Non-functional escape sequences

B    Full list of all emoji characters

   B.1      Emojis, a brief explanation
   B.1.1     Emoji short names
   B.1.2     Emoji escape codes
   B.1.3     Emoji variations
   B.1.4     Emoji numbers
   B.2      Emojis characters by category
       Smileys and emotion
       People and body
       Component
       Animals and nature
       Food and drink
       Travel and places
       Activities
       Objects
       Symbols
       Flags
   B.3      Emoji characters by Unicode

C    Segoe UI full character set

       A note by the Author
   C.1     Inserting Unicode characters
   C.2     Characters U+00000 to U+00FFF
   C.3     Characters U+01000 to U+01FFF
   C.4     Characters U+02000 to U+02FFF
   C.5     Characters U+03000 to U+09FFF
   C.6     Characters U+0A000 to U+0AFFF
   C.7     Characters U+0B000 to U+0FFFF
   C.8     Characters U+10000 to U+10FFF
   C.9     Characters U+11000 to U+11FFF
   C.10   Characters U+12000 to U+12FFF
   C.11   Characters U+13000 to U+15FFF
   C.12   Characters U+16000 to U+1CFFF
   C.13   Characters U+1D000 to U+1EFFF
   C.14   Characters U+1F000 to U+3FFFF

D   3D Model of a Sierpinski cube

       3D Sierpinski cube

E    Template

       COMMENT FIELDS
       HEADINGS
       TABLES
       FIGURES
       LISTS
       TASK LISTS
       CODE FRAGMENT
       FORMULAE
       LINKS
       BUTTONS
       ALERTS
       COLOURED TEXT
       INDEX NUMBERS
       END OF SECTION
       FOOTNOTE
       END OF PAGE

⬇️ End of page
Clone this wiki locally