This PR adds a new shortcode plugin. Here is the content of the README.md file:
Wikipedia
A Nikola shortcode plugin to generate HTML elements containing the first paragraph of the summary of a given Wikipedia article. By adding appropriate CSS styles, the resulting HTML can be made to behave as tooltips.
The shortcode takes a mandatory argument article and an optional one, text, which, if set, is used as the text of the link in lieu of article. Here are two examples:
{{% wikipedia article="DNA" %}}
{{% wikipedia article="DNA" text="DNA molecule" %}}
This is the HTML structure that is returned by {{% wikipedia article="DNA" %}}:
<span class="wikipedia_tooltip"><a href="https://en.wikipedia.org/wiki/DNA" target="_blank">DNA</a>
<span class="wikipedia_summary">
<a href="https://en.wikipedia.org/wiki/DNA" target="_blank" class="wikipedia_wordmark">
<img src="https://upload.wikimedia.org/wikipedia/commons/b/bb/Wikipedia_wordmark.svg"><span class="wikipedia_icon"></span>
</a>
Deoxyribonucleic acid (DNA) is a polymer composed of two polynucleotide chains that coil around each other to form a double helix. The polymer carries genetic instructions for the development, functioning, growth and reproduction of all known organisms and many viruses. DNA and ribonucleic acid (RNA) are nucleic acids. Alongside proteins, lipids and complex carbohydrates (polysaccharides), nucleic acids are one of the four major types of macromolecules that are essential for all known forms of life.
</span>
</span>
Nota Bene: the plugin uses Wikipedia-API to obtain the summaries from Wikipedia. This procedure is carried out every time nikola builds the pages where the shortcode is invoked. Don't forget to connect to the internet before building the website!
CSS style examples
The following CSS code (adapted from here) can be used to style the tooltip:
This PR adds a new shortcode plugin. Here is the content of the
README.md
file:Wikipedia
A Nikola shortcode plugin to generate HTML elements containing the first paragraph of the summary of a given Wikipedia article. By adding appropriate CSS styles, the resulting HTML can be made to behave as tooltips.
The shortcode takes a mandatory argument
article
and an optional one,text
, which, if set, is used as the text of the link in lieu ofarticle
. Here are two examples:This is the HTML structure that is returned by
{{% wikipedia article="DNA" %}}
:Nota Bene: the plugin uses Wikipedia-API to obtain the summaries from Wikipedia. This procedure is carried out every time
nikola
builds the pages where the shortcode is invoked. Don't forget to connect to the internet before building the website!CSS style examples
The following CSS code (adapted from here) can be used to style the tooltip:
And here is a screenshot: