1   Header on including page

A page to test the "[[Include]]" macro and the ".. include::" directive with reStructuredText pages.

A snippet

  • A page to play around with design features of reStructuredText.

    Main text may contain a sidebar as it is the case here (above this paragraph).


    A title should work as expected.


    And a subtitle as well.

Works with partial pages. However, by default the included part is interpreted as the default Wiki syntax - the #format rst directive in the header seems to be ignored. However, a special markup in the included page can make up for this. Combined with a nice separator for the snippet use

.. StartInclude {{{#!rst

before the snippet to include and

.. }}} EndInclude

after it. This switches from normal syntax to reStructuredText syntax as needed.

Also works with complete pages:

Header from macro

Real title

Real subtitle

Above are real reST titles and subtitle. Need to be first in reST to get rendered as such. However, in MoinMoin they are not rendered as titles.



A page to play around with design features of reStructuredText.

Main text may contain a sidebar as it is the case here (above this paragraph).


A title should work as expected.


And a subtitle as well.

And what about images? The options for images in most Wiki languages are rather reduced. How is it here?

Tux of Liberty.

Scaling doesn't work - may be because of a missing PIL library

A figure has even more useful options. Do they work as well?

Tux of Liberty.

Tux of Liberty

The crown and the torch are taken from the statue of liberty.

The rest is taken from the famous Linux mascot.

Alignment seems to work. Including text besides the image if the image is bigger. Things like <p class="caption"> and <div class="legend"> work when CSS support is given.

Text in boxes

Sidebars work as proven above. The question was whether there are more options to create a box around a text. This means more or less what the CSS says and as such could be changed there.

However, the .. highlights:: directive could be the syntax element we are looking for.

  • As usual in reStructuredText this should be flexible.
  • And for instance bulleted lists should be possible.

As always the highlighted section ends with the text being indented no more.

Well, highlights seem not to be supported by the reStructuredText-CSS currently used. However, simple plain admonitions seem to do what we want:

An title for the admonition

Again arbitrary content can go in the body of the admonition.

Works :-) .


Parent page

  1. ..

  2. ../

    Works well for reStructuredText.

  3. /../

    Works for reStructuredText but only if HTTP/browser contracts path.

  4. wiki:..

  5. wiki:../

  6. wiki:/../

  7. wiki:Self:..

  8. wiki:Self:../

  9. wiki:Self:/../

  10. Self:..

  11. Self:../

  12. Self:/../

Other relatives

Anchors on external pages

Signatures and the like

Macro substitution generally works. But does it for signatures?

[[-- StefanMerten 2007-11-17 18:42:05]]

Not very well. In particular the macro seems to be rendered as a block in any case. Also the brackets are shown as well.

What about multiple

[[-- StefanMerten 2007-11-17 18:44:44]] substitutions?

No, multiple substitutions don't work :-( .

What would be needed is a real substitution depending on the format. This would also work for creation of good code. Should check whether this idea is already made real in more recent MoinMoin versions.

There could be a style in reStructuredText which expands the content as a macro. This would guarantee that it is inline. Then a definition of SIG could be really nice in expanding to a reST link and a macro containing the date.

Actually there is another hack working inline:

2007-11-18 (which is actually a "@ DATE @" as a link). However, this does not produce nice output since there is still a <p> at the beginning of the included HTML. This makes the substitution idea superfluous - though a real style would still be better than this hack.

Special body elements

Beyond sidebars reST supports a number of other special body elements. How does embedding in MoinMoin work?

A topic block

A separate block of text not contained in the normal flow. For instance used to explain a notion used in the main text.

Some normal text after the topic.

A rubric

A rubric is like an informal heading that doesn't correspond to the document's structure.

An epigraph is an apposite (suitable, apt, or pertinent) short inscription, often a quotation or poem, at the beginning of a document or section.


Some normal text after the epigraph.

  • A highlights block is used
  • to stand out
  • a couple of key points
  • for instance

Some normal text after the highlights.

A pull-quote is a small selection of text "pulled out and quoted", typically in a larger typeface. Pull-quotes are used to attract attention, especially in long articles.

Some normal text after the pull-quote.

This is part of a container which in this case has a class center.

The class, however, needs to be supported by the stylesheet to be useful.

Some text after the container.

This is a local label defined on the parent page. The following is the contents of an included sub page.

#language en

This is a child page which references a local label in the parent which doesn't work here but should do so if included.

And even a later local label does work with this version of MoinMoin.

It uses a local table of contents.

2   Header 1

2.1   Header 2

Some text two levels deep in the child.

And now back to the parent where local label can be referenced easily and also Header 1 and Header 2 in the included page. But probably a later local label won't work on the inclusion.

What doesn't work with the reST include:: directive is the automatic rebuilding of the page. You need to delete the cache to see changes from include::d pages.

WikiSandBox/reSTInclude (last edited 2007-04-12 17:43:34 by StefanMerten)

Creative Commons License
This work is licensed under a Creative Commons License (details).
All pages are immutable until you log in