polkadot-wiki-old
polkadot-wiki-old copied to clipboard
Start crosslinking the definitions in the Terms page to relevant places throughout
We can use relative paths to link to the Terms page for the different words we introduce throughout the wiki. This way when we use a word that may be unfamiliar with the reader we can send them to the definition without having to repeat the definition for every page we introduce the concept.
Since it's using .md
all we need to do for this would be to do a relative link. Example, let's say we have the word validator
on a page for the first time. Instead of defining what a validator is inline, we make it into a link to the terms page:
some example text blah blah [validator](../learn/terms-and-definitions.md#validator) blah blah more example text
Bonus Task - Find or create a mkdocs plugin
or markdown extension
which enables the pop-up window on hover which display the definition so the user doesn't even need to click the link.
We can manually add pop-up tooltips by adding the quote as a second argument, e.g.
Welcome to the [Polkadot](./polkadot/build "cats are cool") wiki

We would have to copy/paste the definition, however, which leads to the possibility of our definitions getting out of sync (e.g. if the definition of validator changes, we'd have to replace both the text in all of the pop-ups and in the glossary. We could probably rig together a shell script which warns us whenever we edit a definition to modify the pop-ups (and find them via grep).
Oh what! Where did you find this documented? I never knew this about markdown...
Anyway I already made a plug-in for this which uses the syntax @(polkadot)
and will parse the glossary.md
file. Some caveats to this, the glossary file needs to be located in a specific location (top level of the docs directory) and the glossary entry must match the word inside the parenthesis exactly. So I can see what you're proposing being used in some other circumstances than what would be covered already by this plug-in.
http://nestacms.com/docs/creating-content/markdown-cheat-sheet (see the "Links" section... there's no target for me to link directly to it)
Oh I didn't realize you had already made a plugin for this (which would work better than my semi-manual method). I guess we'd just need to spend some time grepping for the words in the glossary and manually adding in the necessary syntax to make a pop-up?
Yep essentially that's what needs to be done.
We're also adding SRML specific "Terminology" to Rust documentation PRs from https://github.com/paritytech/substrate-developer-hub/projects/1