Proving a renderer

A file with many RakuDoc components and some idea about what is expected.

SYNOPSIS§

Assuming a new renderer has been developed and installed (eg using zef) at Rakudoc::To::MyRender, the render this file using a raku --rakudoc=MyRenderer terminal command. The renderer will be consistent with the RakuDoc v2 specification if all the blocks are rendered appropriately, and warnings are generated by the statements marked as incorrect below.

Purpose§

This file is intended to prove a RakuDoc v2 renderer. It can be used in several ways:

  • to generate the AST representation of all the RakuDoc components in the specification
  • to prove a renderer that a new renderer should be able to process this file
  • to visualise how the final output of a RakuDoc source will look after processing

An attempt has been made to utilise all RakuDoc components, it is not an exhaustive test of all components in all possible combinations. Please suggest additional combinations if they turn out to have unusual effects.

Several mistakes have been included where the RakuDoc v2 specification indicates how inconsistent behaviours or unknown components should be handled.

The the end of the rendering of this source file, a number of warning messages should be included.

Short table of contents§

A short index§

elements to be placed:  § This is third level heading
formatting code:  § Adding index entries to your text
index:  § Adding index entries to your text,  § Adding index entries to your text,  § Adding index entries to your text,  § Adding index entries to your text,  § Adding index entries to your text,  § Adding index entries to your text,  § Adding index entries to your text,  § Adding index entries to your text,  § Adding index entries to your text
inline formatting:  § Adding index entries to your text

This is a first heading§

text

This is a second level heading§

text

v2developers can attach notes to blocks associated with versions This is third level heading§

A paragraph to illustrate Basis type formatting.

A paragraph to illustrate Important type formatting.

A paragraph to illustrate Unusual type formatting.

A paragraph to illustrate Strikethrough type formatting.

A paragraph to illustrate Superscript type formatting. (For text output, many terminals do not support superscript/subscript font positions, so consider using a colouration as well.)

A paragraph to illustrate Subscript type formatting.

A paragraph to illustrate Code type formatting. It can contain other markup, eg. A<> markup.

A paragraph to illustrate Verbatim type formatting. It can contain other RakuDoc, eg. P<defn:Happy> without executing it.

A paragraph to illustrate some >< formatting (in the source has Z<Zero width> between >< ).

A paragraph to illustrate Keyboard formatting.

A paragraph to illustrate Replacement formatting.

A paragraph to illustrate Terminal formatting.

A paragraph to illustrate several G<G undefined type>, Q<Q undefined type>, W<W undefined type>, Y<Y undefined type> formatting; warnings are expected.

Various entities are possible such as « or the same thing using unicode «. Entities can be double unicodes, such as 🇺🇦, which is the Ukrainian flag.

In case you have forgotten, here is something aliased at the start: Do not consider this a disquisition of possible combinations.

This is an example of an Alias where A<DECLARATION> was replaced by the contents of the =alias directive. Aliases are scoped, see below, but cannot be specified before being used in the document. Here is an undeclared forward reference, which was written as A<an undeclared|XXX>. The use of an undeclared alias causes a warning.

We can also make an inline definition. This whole paragraph will be referenced later.

A developer note can be attachedv1.2.3 ^.. v2.0.0 highly deprecated to text. A renderer may show the text or only show it for contexts compliant with the version.

But a note without meta no versioning here is ignored and a warning generated.

When we want a formula use F<> markup.

Links can be made internally say to the first heading or externally say to the raku documentation site.

A renderer should provide the opportunity to customise text using M<...|..,..;...> markup. The renderer should not recognise this functionality and issue a warning.

A note [ 1 ] will not itself be rendered inline, but the text will be rendered in a footnote or popup. A marker or number will be rendered to point to the text.

Suppose we want to place the definition ⦗

We can also make an inline definition. This whole paragraph will be referenced later.

⦘ here. And to confound pedants, here is a definition ⦗
Happy
when not blue
⦘ defined using a =defn block.

Normally extra spaces are removed with paragraphs, but sometimes we truly dot dot dot   dash dash dash       want them.

Good text will contain elements to be placed in an index. The index has already been placed at the start of the document, although content is generated here.

1. This is a numbered heading, level 1

text

1.1. This is a second level heading

text

1.1.1. A third level

text

1.1.2. Another third level

text

1.2. Back to second

text

1.2.1. A third level

Although this heading has the same text in the heading, the Table of Contents should provide a unique target for it (this may not be possible in some formats such as MarkDown)

1.2.2. Another third level

text

Lists§

Unnumbered up to four levels of bulleting are required, a renderer can offer more.

  • The start of a unnumbered item list
  • Next item
  • now next level
  • another at two
  • a third level
  • fourth level
  • fourth level
  • level five
  • level six
  • level seven
  • reset to level one
  • jump levels

to put space between lists, probably a =para without text is needed.

  1. The start of a numbered item list
  2. Next item
  3. now next level
  4. another at two
  5. a third level
  6. reset to level one
  7. jump levels
  • an unnumbered item
  1. but we can resume after a break

Definitions
can be placed in lists
Happy
when not blue
Blue
when not happy
Being assertive

Just shout why don't you?

This is an ordinary paragraph

1. Lemma 1
do not make trouble
2. Lemma 2
do not shout at people
3. Lemma 3
just phone the SWAT team

An ordinary paragraph creates the definition list.

4. Lemma 4
Claim you are the victim here

Taking a bullet§

The project originally consisted of five phases, of which two are already complete and two have been abandoned:

  • Investigate existing solutions
  • Define a minimal initial feature set
  • Implement this minimal set of features
  • Secure 100 million in venture capital
  • Abscond to the Bahamas with the cash

The major sources of sustainable energy are:

  • wind
  • hydroelectric
  • solar
  • geothermal
  • fusion
  • (eventually)

Blocks that are processed differently§

my $x = 2;
# a brilliant program!
my $x = 3;
# a renderer should observe the basis markup
# and the markup but render R<markup> verbatim
# indenting causes an implicit code block
my $raku = 'fantastic';
This is a text with basis markup that conserves
all spacing      when trying    to get column
just using       white spaces   naively
better           to             use tables
This is almost the same as input
but may have a different styling

Occasionally some text that is inset from the margin is required. So enclose it in a nested block.

The following semantic block was included at the beginning in source, but it is now included here.

Unrelenting hype§

Richard Hainsworth, aka finanalyst

Fabulous identity§

Unknown MyBlock§

=begin MyBlock :caption<A customised block> :headlevel(2)

Actually it fails because no customisation has been made.
It
should
be
rendered without spaces      being chewed up.
=end MyBlock

Some silly text which will have its own extraordinary ToC entry

You are reminded that: Do not consider this a disquisition of possible combinations.

Some tables§

A visual table§

AnimalLegsEats
Zebra4Cookies
Human2Pizza
Shark0Fish

A visual table with a stupendously long caption§

AnimalLegsEats
Zebra4Cookies
Human2Pizza
Shark0Fish

A procedural table§

DateSamplesMean

Sample 1

Sample 2

Sample 3

2023-03-080.40.10.30.26667
2023-04-140.80.60.50.63333
2023-06-230.20.90.00.36667
Mean:0.466670.533330.266670.42222

Adding index entries to your text§

An index entry is an inline formatting code that is rendered normally (i.e. with no special identifying styling) within the text, but which is also added to the index. Index entries may be specified with subentries, including multilevel subentries, though a renderer is not required to represent anything more than the first level. A single index entry can specify two or more separate entries in the index, all of which will refer back to the same point in the text.

Scoping examples§

Configuration and aliases are scoped.

Without configuration embedded B<markup> is rendered verbatim.

With configuration embedded <span class="basis">basis</span> markup is rendered.

How short the season when roses are red.

But configuration directives only B<apply> inside a block scope.

Did I mention before that: Do not consider this a disquisition of possible combinations.

Placements§

Renderers are required to place text and RakuDoc sources, but may fallback to text messages for other formats.

Text placement§

ABSOLUTELY NO WARRANTY IS IMPLIED. NOT EVEN OF ANY KIND. WE HAVE SOLD YOU THIS SOFTWARE WITH NO HINT OF A SUGGESTION THAT IT IS EITHER USEFUL OR USABLE. AS FOR GUARANTEES OF CORRECTNESS...DON'T MAKE US LAUGH! AT SOME TIME IN THE FUTURE WE MIGHT DEIGN TO SELL YOU UPGRADES THAT PURPORT TO ADDRESS SOME OF THE APPLICATION'S MANY DEFICIENCIES, BUT NO PROMISES THERE EITHER. WE HAVE MORE LAWYERS ON STAFF THAN YOU HAVE TOTAL EMPLOYEES, SO DON'T EVEN *THINK* ABOUT SUING US. HAVE A NICE DAY.

RakuDoc placement§

A ware§

Absolutely no warranty is implied. Not even of any kind. We have sold you this software with no hint of a suggestion that it is either useful or usable. As for guarantees of correctness...don't make us laugh!

B ware§

At some time in the future we might deign to sell you upgrades that purport to address some of the application's many deficiencies, but no promises there either. We have more lawyers on staff than you have total employees, so don't even think about suing us.

Have a nice day. ☺

HTML placement§

Complete disclaimer

A ware

Absolutely no warranty is implied. Not even of any kind. We have sold you this software with no hint of a suggestion that it is either useful or usable. As for guarantees of correctness...don't make us laugh!

B ware

At some time in the future we might deign to sell you upgrades that purport to address some of the application's many deficiencies, but no promises there either. We have more lawyers on staff than you have total employees, so don't even think about suing us. Have a nice day. ☺

JPEG image placement§

JPEG image placement

Png image placement§

Png image placement

Text finishes after version number

Credits§

Richard Hainsworth, aka finanalyst

LICENSE§

Artistic-2.0

VERSION§

Footnotes

1 |^| such as this one