This is sample content for the Pelican static site generator. Many of the
pages are filled with nonsense lorem ipsum words in order to provide
bulk for theme developers to work with. This allows play and testing with
various presentation methods for different kinds of text.
The content is adapted from the Pelican samples
folder, unknowingly
aided and abetted by David Colton, Roberto Alsina, Markdownum, Lipsum.com and ChatGPT.
Puer Cerealia cura animique non putant verum
Cadmi vinco ad sanguisque discrimen rector sustineat caelique his, erat
fuissem! Telo et inritata, altera pars plures, iuvenem locatas: verborum leti.
Quo dolet parentis, subsidunt, gravem tela instar accessit habebit longis usus
ora comas, cum, calenti o. Turis [saecula eburnea]; exhausto petendo. Haustus
virga, fratremque [et] nostra vultu, coniunx hostem ostendens prosunt
solidissima nunc, saevi.
hdd_sink = ebookLanguage / ipRepositoryHard + ebook(2, webmasterRgbMainframe,
drive_jpeg.drive(cableMacroApple, ddr_im_bankruptcy));
smsCybercrime.hashtagNetmaskRead = software_key_dcim;
if (offline_vlb_virus + urlNative(variable_box, northbridge, kde)) {
virus_management.backside.deviceAdapter(2, 1, dsl(publishing_emoticon, 2));
dvd = jfsNetworking;
matrix = 913307;
}
Click to read and post comments
Examine how Markdown is rendered with Pelican
This is a lightly modified copy of original article:
These examples of markdown are a modified form taken from Build A Blog With Pelican And Python - Pt. 2 Creating Content. I did find some issues that I mention as I go through all the examples. I've also augmented the original examples with some additional samples of my own.
As a nice side affect of putting this page together I now have a reference page should I decide to change the Pelican theme I'm using to ensure that all my other articles are still rendering as expected as this test page contains most, if not all, of the markdown styles that I use on a regular basis.
For a complete markdown reference refer to The Markdown Guide.
Markdown Examples Part 1
Before you learn anything else you should know be aware of the following:
Heading Best Practices
Markdown applications don’t agree on how to handle missing blank lines between a heading and the surrounding paragraphs. For compatibility, separate paragraphs and headings with one or more blank lines.
Paragraphs
To create paragraphs, use a blank line to separate one or more lines of text.
Line Breaks
To create a line break (<br>), end a line with two or more spaces, and then type return.
Some more examples
Basic markdown examples are shown below:
This text is **bold** and this text is also __bold__
This text is *italic* and this text is also _italic_
This text is **_italic and bold_**
This text is bold and this text is also bold
This text is italic and this text is also italic
This text is italic and bold
You can add headers to your markdown to divide your posts into related sections:
# A H1 heading
## A H2 heading
### A H3 heading
#### A H4 heading
##### A H5 heading
###### A H6 heading
A H1 heading
A H2 heading
A H3 heading
A H4 heading
A H5 heading
A H6 heading
A nice additional way to separate different sections of you post is to insert a horizontal line is to add three or more hyphens:
In Mathew's original post he defines a list with numbers as:
A list with numbers:
1. One
2. Two
3. Three
When rendered this looks like:
A list with numbers:
1. One
2. Two
3. Three
There are two issues with this:
- There should be an empty line between the text preceding the list and the list itself. See notes above about adding empty blank lines between headings and paragraphs. This rule applied to everything.
- Typically you don't provide the numbers. All items in the list are preceded with a
1.
and the list is then automatically numbered.
The correct way to define a list of numbers is:
A list with numbers:
1. One
1. Two
1. Three
And this is how it then correctly displays:
A list with numbers:
- One
- Two
- Three
You can also have a list of number with a sublist of numbers:
- Top Level
- Sub level 1
- Sub level 2
- Top Level Again
- Sub level again
And the markdown for sublists like this is:
1. Top Level
1. Sub level 1
1. Sub level 2
1. Top Level Again
1. Sub level again
The list with bullets example suffers from the same issue as the numbered list in that the example markdown given does not have a blank line between the text and the bulleted list. In markdown you always have to place a blank line:
A list with bullets:
* One
* Two
* Three
A list with bullets:
Here's a blockquote:
> Simple is better than complex
Simple is better than complex
For some reason the example given my Mathew used >
. Not sure why.
Here's the table example in Mathew's post:
| Column1 | Column 2 | Column 3 |
|---|---|---|
| Value 1 | Value 2 | Value 3 |
| Value 4 | Value 5 | Value 6 |
| Value 7 | Value 8 | Value 9 |
And here is the table rendered:
Column1 |
Column 2 |
Column 3 |
Value 1 |
Value 2 |
Value 3 |
Value 4 |
Value 5 |
Value 6 |
Value 7 |
Value 8 |
Value 9 |
|
|
|
I'm not sure it it's a Pelican thing or the template used but when rendered this looks really poor in my opinion. One way around this it to use HTML directly with CSS styling. I need to investigate this further.
Here's a HTML table with CSS Styling:
Results |
No |
Competition |
John |
Adam |
Robert |
Paul |
1 |
Swimming |
1:30 |
2:05 |
1:15 |
1:41 |
2 |
Running |
15:30 |
14:10 |
15:45 |
16:00 |
3 |
Shooting |
70% |
55% |
90% |
88% |
Table Generator is one simple way to generate HTML code for tables but there are many out there to choose from.
Markdown Examples Part 2
Images can be displayed in Markdown.
Text within the square brackets is the image name. The path to the image goes between the round brackets.
The {static} tag indicates the image is stored in the content folder. This setting can be changed in pelicanconf.py
.
Links to downloadable content such as PDF files are written similarly to image files but with no ! symbol at the beginning.
[Pelican Documentation]({static_dir}/pdf/pelican.pdf)
A link to a different blog post on our website is written exactly the same.
Text within the square brackets can be clicked on to travel to the website between the curly brackets.
The {filename}
tag indicates we want to follow the link to a webpage rather than the static file it was generated from.
First Post
Or we can link to another external website by supplying the web address.
Python Package Index
Refer to Mathew's page directly for the setting that need to be added to the peliconconf.py
file. One small disadvantage of having to define links using {static}
or {filename}
is that it makes editing the markdown files in a editor slightly more difficult as you are not actually going to see a preview or inline rendering of the link content. A small annoyance.
Markdown Examples Part 3
Code blocks are preceded by an indent (4 spaces), three :
symbols and the name of the language.
All of the following code will be highlighted while the text is indented.
def do_twice(func):
def wrapper_do_twice(*args, **kwargs):
return func(*args, **kwargs).lower()
return wrapper_do_twice
@do_twice
def say_whee(some_text):
print(some_text)
x = 'Whee!'
say_whee(x)
And the raw markdown to produce this code block looks like:
:::python
def do_twice(func):
def wrapper_do_twice(*args, **kwargs):
return func(*args, **kwargs).lower()
return wrapper_do_twice
...
Click to read and post comments
This is a lightly modified copy of rst-cheatsheet.rst from
https://github.com/ralsina/rst-cheatsheet/blob/master/rst-cheatsheet.rst
commit ``62ce5c7``
Inline Markup
Inline markup allows words and phrases within text to have character styles (like italics and boldface) and functionality (like hyperlinks).
*emphasis*
|
emphasis |
**strong emphasis**
|
strong emphasis |
`interpreted text`
|
The rendering and meaning of interpreted text
is domain- or application-dependent. |
``inline literal``
|
inline literal |
reference_
|
reference |
`phrase reference`_
|
phrase reference |
anonymous__
|
anonymous |
_`inline internal target`
|
inline internal target |
|substitution reference|
|
The result is substituted in from the
substitution definition. |
footnote reference [1]_
|
footnote reference |
citation reference [CIT2002]_
|
citation reference [CIT2002] |
http://docutils.sf.net/
|
http://docutils.sf.net/ |
Escaping with Backslashes
reStructuredText uses backslashes ("\") to override the special meaning given to markup characters and get
the literal characters themselves. To get a literal backslash, use an escaped backslash ("\\"). For example:
*escape* ``with`` "\"
|
escape with "" |
\*escape* \``with`` "\\"
|
*escape* ``with`` "\" |
Lists
- This is item 1. A blank line before the first
and last items is required.
- This is item 2
- Item 3: blank lines between items are optional.
- Item 4: Bullets are "-", "*" or "+".
Continuing text must be aligned after the bullet
and whitespace.
- This list item contains nested items
- Nested items must be indented to the same
level
|
- This is item 1. A blank line before the first
and last items is required.
- This is item 2
- Item 3: blank lines between items are optional.
- Item 4: Bullets are "-", "*" or "+".
Continuing text must be aligned after the bullet
and whitespace.
- This list item contains nested items
- Nested items must be indented to the same
level
|
3. This is the first item
4. This is the second item
5. Enumerators are arabic numbers,
single letters, or roman numerals
6. List items should be sequentially
numbered, but need not start at 1
(although not all formatters will
honour the first index).
#. This item is auto-enumerated
|
- This is the first item
- This is the second item
- Enumerators are arabic numbers,
single letters, or roman numerals
- List items should be sequentially
numbered, but need not start at 1
(although not all formatters will
honour the first index).
- This item is auto-enumerated
|
what
Definition lists associate a term with
a definition.
how
The term is a one-line phrase, and the
definition is one or more paragraphs or
body elements, indented relative to the
term. Blank lines are not allowed
between term and definition.
|
- what
- Definition lists associate a term with
a definition.
- how
- The term is a one-line phrase, and the
definition is one or more paragraphs or
body elements, indented relative to the
term. Blank lines are not allowed
between term and definition.
|
:Authors:
Tony J. (Tibs) Ibbs,
David Goodger
:Version: 1.0 of 2001/08/08
:Dedication: To my father.
|
Authors: | Tony J. (Tibs) Ibbs,
David Goodger |
Version: | 1.0 of 2001/08/08 |
Dedication: | To my father. |
|
-a command-line option "a"
-b file options can have arguments
and long descriptions
--long options can be long also
--input=file long options can also have
arguments
/V DOS/VMS-style options too
|
-a |
command-line option "a" |
-b file |
options can have arguments
and long descriptions |
--long |
options can be long also |
--input=file |
long options can also have
arguments |
/V |
DOS/VMS-style options too |
|
Section Structure
Title
=====
Titles are underlined (or over- and underlined) with
a nonalphanumeric character at least as long as the
text.
A lone top-level section is lifted up to be the
document's title.
Any non-alphanumeric character can be used, but
Python convention is:
* ``#`` with overline, for parts
* ``*`` with overline, for chapters
* ``=``, for sections
* ``-``, for subsections
* ``^``, for subsubsections
* ``"``, for paragraphs
|
Title
Titles are underlined (or over- and underlined) with
a nonalphanumeric character at least as long as the
text.
A lone top-level section is lifted up to be the
document's title.
Any non-alphanumeric character can be used, but
Python convention is:
- # with overline, for parts
- * with overline, for chapters
- =, for sections
- -, for subsections
- ^, for subsubsections
- ", for paragraphs
|
Blocks
This is a paragraph.
Paragraphs line up at their left edges, and are
normally separated by blank lines.
|
This is a paragraph.
Paragraphs line up at their left
edges, and are normally separated
by blank lines.
|
A paragraph containing only two colons indicates
the following indented or quoted text is a literal
block or quoted text is a literal block.
::
Whitespace, newlines, blank lines, and all kinds of
markup (like *this* or \this) is preserved here.
You can also tack the ``::`` at the end of a
paragraph::
It's very convenient to use this form.
Per-line quoting can also be used for unindented
blocks::
> Useful for quotes from email and
> for Haskell literate programming.
|
A paragraph containing only two colons
indicates that the following indented
or quoted text is a literal block.
Whitespace, newlines, blank lines, and
all kinds of markup (like *this* or
\this) is preserved by literal blocks.
You can also tack the :: at the end of a
paragraph:
It's very convenient to use this form.
Per-line quoting can also be used for
unindented blocks:
> Useful for quotes from email and
> for Haskell literate programming.
|
| Line blocks are useful for addresses,
| verse, and adornment-free lists.
|
| Each new line begins with a
| vertical bar ("|").
| Line breaks and initial indents
| are preserved.
| Continuation lines are wrapped
portions of long lines; they begin
with spaces in place of vertical bars.
|
Line blocks are useful for addresses,
verse, and adornment-free lists.
Each new line begins with a
vertical bar ("|").
Line breaks and initial indents
are preserved.
Continuation lines are wrapped
portions of long lines; they begin
with spaces in place of vertical bars.
|
Block quotes are just:
Indented paragraphs,
and they may nest.
|
Block quotes are just:
Indented paragraphs,
and they may nest.
|
Doctest blocks are interactive
Python sessions. They begin with
"``>>>``" and end with a blank line.
>>> print "This is a doctest block."
This is a doctest block.
|
Doctest blocks are interactive
Python sessions. They begin with
">>>" and end with a blank line.
>>> print "This is a doctest block."
This is a doctest block.
|
A transition marker is a horizontal line
of 4 or more repeated punctuation
characters.
------------
A transition should not begin or end a
section or document, nor should two
transitions be immediately adjacent.
|
A transition marker is a horizontal line
of 4 or more repeated punctuation
characters.
A transition should not begin or end a
section or document, nor should two
transitions be immediately adjacent.
|
Tables
There are two syntaxes for tables in reStructuredText. Grid tables are complete but cumbersome to create. Simple
tables are easy to create but limited (no row spans, etc.).
+------------+------------+-----------+
| Header 1 | Header 2 | Header 3 |
+============+============+===========+
| body row 1 | column 2 | column 3 |
+------------+------------+-----------+
| body row 2 | Cells may span columns.|
+------------+------------+-----------+
| body row 3 | Cells may | - Cells |
+------------+ span rows. | - contain |
| body row 4 | | - blocks. |
+------------+------------+-----------+
|
Header 1 |
Header 2 |
Header 3 |
body row 1 |
column 2 |
column 3 |
body row 2 |
Cells may span columns. |
body row 3 |
Cells may
span rows. |
|
body row 4 |
|
===== ===== ======
Inputs Output
------------ ------
A B A or B
===== ===== ======
False False False
True False True
False True True
True True True
===== ===== ======
|
Inputs |
Output |
A |
B |
A or B |
False |
False |
False |
True |
False |
True |
False |
True |
True |
True |
True |
True |
|
Explicit Markup
Explicit markup blocks are used for constructs which float (footnotes), have no direct paper-document representation
(hyperlink targets, comments), or require specialized processing (directives).
They all begin with two periods and whitespace, the "explicit markup start".
Footnote references, like [5]_.
Note that footnotes may get
rearranged, e.g., to the bottom of
the "page".
.. [5] A numerical footnote. Note
there's no colon after the ``]``.
|
Footnote references, like .
Note that footnotes may get
rearranged, e.g., to the bottom of
the "page".
|
Autonumbered footnotes are
possible, like using [#]_ and [#]_.
.. [#] This is the first one.
.. [#] This is the second one.
They may be assigned 'autonumber
labels' - for instance,
[#fourth]_ and [#third]_.
.. [#third] a.k.a. third_
.. [#fourth] a.k.a. fourth_
|
Autonumbered footnotes are
possible, like using and .
They may be assigned 'autonumber
labels' - for instance,
and .
|
Auto-symbol footnotes are also
possible, like this: [*]_ and [*]_.
.. [*] This is the first one.
.. [*] This is the second one.
|
Auto-symbol footnotes are also
possible, like this: and .
|
Citation references, like [CIT2002]_.
Note that citations may get
rearranged, e.g., to the bottom of
the "page".
.. [CIT2002] A citation
(as often used in journals).
Citation labels contain alphanumerics,
underlines, hyphens and fullstops.
Case is not significant.
Given a citation like [this]_, one
can also refer to it like this_.
.. [this] here.
|
Citation references, like [CIT2002].
Note that citations may get
rearranged, e.g., to the bottom of
the "page".
[CIT2002] | (1, 2) A citation
(as often used in journals). |
Citation labels contain alphanumerics,
underlines, hyphens and fullstops.
Case is not significant.
Given a citation like [this], one
can also refer to it like this.
|
External hyperlinks, like Python_.
.. _Python: http://www.python.org/
|
External hyperlinks, like Python. |
External hyperlinks, like `Python
<http://www.python.org/>`_.
|
External hyperlinks, like Python. |
Internal crossreferences, like example_.
.. _example:
This is an example crossreference target.
|
Internal crossreferences, like example.
This is an example crossreference target.
|
Python_ is `my favourite
programming language`__.
.. _Python: http://www.python.org/
__ Python_
|
Python is my favourite
programming language. |
Titles are targets, too
=======================
Implict references, like `Titles are targets, too`_.
|
Titles are targets, too
Implict references, like
Titles are targets, too.
|
Directives are a general-purpose extension mechanism, a way of adding support for new constructs without adding
new syntax. For a description of all standard directives, see reStructuredText Directives (http://is.gd/2Ecqh). |
For instance:
.. image:: magnetic-balls.jpg
:width: 55pt
:alt: silver balls in an arc
|
For instance:
|
Substitutions are like inline directives, allowing graphics and arbitrary constructs within text. |
The |biohazard| symbol must be used on containers used to
dispose of medical waste.
.. |biohazard| image:: biohazard.png
:align: middle
:width: 12
|
The symbol must be used on containers used to
dispose of medical waste. |
Any text which begins with an explicit markup start but doesn't use the syntax of any of the constructs above, is a comment. |
.. This text will not be shown
(but, for instance, in HTML might be
rendered as an HTML comment)
|
|
An "empty comment" does not
consume following blocks.
(An empty comment is ".." with
blank lines before and after.)
..
So this block is not "lost",
despite its indentation.
|
An "empty comment" does not
consume following blocks.
(An empty comment is ".." with
blank lines before and after.)
So this block is not "lost",
despite its indentation.
|
Click to read and post comments
Some cool stuff!
This article builds it's metadata using the filename.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu est
mauris. Integer pharetra sodales velit, non dictum massa dictum id.
Aliquam non tortor a turpis porta lobortis. Curabitur a leo
pellentesque, egestas tellus et, ultrices diam.
- In hac habitasse platea dictumst
- Suspendisse id felis euismod, elementum erat at, luctus mi.
- Proin tincidunt ligula justo, id dignissim massa suscipit in.
- Suspendisse potenti.
Click to read and post comments