-
Notifications
You must be signed in to change notification settings - Fork 5
90.05 Basic components of a Wiki
GitHub Wiki pages have various standard (and in some cases, optional) components. These can be seen by examining the PAL Software Wiki home page as it currently appears (below):
Figure 90.9 — The PAL Software Wiki home page |
The GitHub Wiki pages are all hosted and constructed by GitHub itself and GitHub applies a certain structure to the page: Title, revision information, Contents (pages) list, sidebar and footer.
Taking them in order:
At the top left is the title of the particular page (point 1 in the above image, Home in this case). The title is always the name of the .md
file containing the content of the page (in this case the file is called Home.md
and the page title is thus “Home”).
Beneath the title is the revision information (point 2 in the above image), this again is generated by GitHub. It shows the user name of the last person to edit the page, when the page was edited and how many revisions of the particular page exist.
Clicking the number of revisions (2 revisions in this case), will take you to the History page and list all the changes that have been made to the particular Wiki page (remember the Wiki is a repository in its own right).
The third point (point 3 in Figure 90.9) is the Contents or Pages area, this contains a list of all the pages present in the Wiki. Clicking the little arrow will expand the area, for the PAL Software Wiki it looks like this:
Figure 90.10 — The Wiki contents page |
When expanded, the headings within a page are shown in black (it irritates me the way these headings break across lines).
I’ll say right from the start I’m not a fan of the default Contents area and I don’t use it. It would be nice if there was a way to turn it off.
I can see what GitHub is doing, it is making sure that all the pages in the Wiki are accessible, the problem I have is the way it does it:
The order of the pages in the Pages area is listed in alphanumeric order (based on the ASCII table https://www.ascii-code.com/).
Let’s say that a Wiki numbers its pages by Chapter and Section and has multiple instances of each. if pages were numbered directly with Chapter, Section and Division then the following pages:
5.5 The fifth section in chapter five
And
5.10 The tenth section in chapter five
Would appear in the Pages area as:
Figure 90.11 — Pages listed in the wrong order |
I.e. the 5.10 Section appears before the 5.5 Section. GitHub puts them in the wrong order.
It’s even worse if there are no section numbers and the pages are just given a title, under these circumstances the pages will appear in alphabetical order and this is probably not the order that is required.
The best way to get around the problem is to give pages a numbering structure, let’s say Chapter, Section and Division, each being a two-digit number with leading zeros.
This can be seen in the following example:
Figure 90.12 — Pages listed in the right order |
The key is to always use leading zeros. This arrangement always works.
To summarise, the rules for this naming convention are:
Pages that start with a new Chapter should be named:
Cc Chapter title text.md
Pages that start with a new Section should be named:
Cc.Ss Section title text.md
And pages that start with a new Division should be named:
Cc.Ss.Dd Division title text.md
The rules are thus:
-
Cc
,Ss
andDd
must always be two numerical digits, leading spaces must be used where necessary -
Ss
andDd
must be preceded by a full stop character.
, i.e..Ss
and ```.Dd`` -
The title text must be separated from the last numerical digit with a space character
-
The title text (the
.md
filename) must be correctly capitalised (this is how GitHub will generate the title).
The sidebar and footer are optional components of the GitHub Wiki and are configurable by the user.
In Figure 90.9, the sidebar (point 4) is located in the top-right area below the GitHub generated Contents/pages section. The footer is at the bottom of the page (point 5).
By default there will be no sidebar or footer.
In the simplest terms, a sidebar is a common area to top-right of all Wiki document pages. When you create a sidebar (see below), that sidebar will appear on every page in the Wiki.
Similarly, a footer is a common area that will, once created, appear at the bottom of every page in the Wiki.
GitHub, I think, intends the sidebar to hold a custom navigation list that allows the user to specify the order in which pages appear &c. The footer is intended to hold common information such as a copyright or licence message.
GitHub intends the sidebar and footer to be simple elements that are common to all pages.
This approach may be fine for GitHub, but the PAL Software Wiki needs something a bit more advanced. The navigation tables shown in Figure 90.9 above (with the arrows and home symbol) take the user to previous or next chapters and pages, consequently, these have to be adaptable from one page to the next and this requires each page to have unique (ish) sidebars and footers.
It is possible to have separate sidebars and footers on each page, however GitHub does not explain how to do it. This template contains a full description of how to have different sidebars and footers for each Wiki page, it is explained fully in section xxx.
First of all let’s examine what GitHub intended with a sidebar and a footer:
If no sidebar or footer exists, GitHub will prompt for them to be made on the Home page:
Figure 90.13 — Creating a sidebar or footer |
Clicking either option will open the correct editor and allow entries to be made.
Sidebars and footers that already exist can be edited from the home page by clicking the pencil symbols at the top right of each area (highlighted below for the sidebar):
Figure 90.14 — Editing a sidebar or footer |
Creating a sidebar or footer using this method creates common sidebars and footers that are visible on every page of the Wiki. Section xxx explains how to create individual sidebar and footer areas for each page.
Sidebars and footers can also be created in a local copy of the Wiki and then pushed to GitHub, I use VS Code as my local text editor (hence the images below).
The sidebar and footer are stored in the files _Sidebar.md
and _Footer.md
in the root directory of the local repository. This can be seen below, the _Sidebar.md
file is shown:
Figure 90.15 — Editing a sidebar or footer in VS Code |
Creating or changing these files within VS Code and pushing the changes to GitHub will change the common sidebar and footer used by all pages.
The PracticalSeries of Publications — Copyright © 2021 Michael Gledhill
⬆️ Top | [email protected] | PracticalSeries of Publications | PAL website
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 PAL
1.1. The approach taken
1.1.1 The structure of the software
1.1.2 The standard modules
1.1.3 The user interface
1.1.4 Templates and documentation
Template modules
Documentation modules
1.2. Background to the Project
1.3. Regulations and standards
1.4. Assumptions and limitations
2. The controller software and structure
2.1. Internal structure of the Controllers
2.1.1 Programmable blocks
Organisation blocks (OBs)
Functions (FCs)
Function blocks (FBs)
2.1.2 Data storage blocks
Data blocks (DBs)
Instance data blocks (iDBs)
User data types (UDTs)
2.1.3 Built-in system blocks
2.1.4 Block numbering and quantities
2.2. Execution of Controller software
2.2.1 Cyclic programme execution
90. How to build a GitHub Wiki
90.1. What are GitHub Wiki pages?
90.2. Understanding the Wiki pages
90.3. Creating a Wiki for a repository
90.4. Cloning a Wiki to a local machine
90.5. Basic components of a Wiki
90.5.1 Title bar and revision
90.5.2 Contents area
90.5.3 Listing pages in the order you want
90.6. Sidebars and footers
90.6.1 What are sidebars and footers?
90.6.2 Create a sidebar or footer in GitHub
90.6.3 Create a sidebar or footer locally
91. Imposing a folder structure on a Wiki
91.1. The default arrangement
91.2. A practical Wiki folder structure
91.2.1 Page Numbering in the Wiki
91.2.2 Rules for page numbering
91.2.2 Subfolder names for Wiki pages
91.2.3 Page names for Wiki pages
91.2.4 Storing images and other data
92. Markdown, GitHub Markdown and HTML
A note by the Author
Some useful Markdown sites
92.1. An overview of Markdown
92.2. How Markdown works
92.3. Markdown flavours
92.3.1 GitHub Flavoured Markdown (GFM)
92.4. HTML and Markdown
92.4.1 HTML with GitHub Markdown
GFM Blacklisted HTML tags
GFM Whitelisted HTML tags
GFM HTML tags — the grey area
GFM whitelisted HTML attributes
92.5. PracticalSeries Markdown
⬇️ End of page |