polkadot-wiki-old icon indicating copy to clipboard operation
polkadot-wiki-old copied to clipboard

Start crosslinking the definitions in the Terms page to relevant places throughout

Open lsaether opened this issue 5 years ago • 5 comments

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.

lsaether avatar Apr 10 '19 07:04 lsaether

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
Screenshot 2019-05-03 at 14 19 03

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).

laboon avatar May 03 '19 12:05 laboon

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.

lsaether avatar May 03 '19 12:05 lsaether

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?

laboon avatar May 03 '19 12:05 laboon

Yep essentially that's what needs to be done.

lsaether avatar May 03 '19 12:05 lsaether

We're also adding SRML specific "Terminology" to Rust documentation PRs from https://github.com/paritytech/substrate-developer-hub/projects/1

ltfschoen avatar May 04 '19 22:05 ltfschoen