So, if you want to retain the white-space in your poems, there are several ways to do this using CSS. Here is an extremely simple one:
title: And They Obey
@@white-space:pre-wrap;
SMASH down the cities.
Knock the walls to pieces.
Break the factories and cathedrals, warehouses
and homes
Into loose piles of stone and lumber and black
burnt wood:
You are the soldiers and we command you.
Build up the cities.
Set up the walls again.
Put together once more the factories and cathedrals,
warehouses and homes
Into buildings for life and labor:
You are workmen and citizens all: We
command you.
@@
This use the CSS property white-space. See the documentation for the differences between pre
and pre-wrap
.
Perhaps nicer is to have a stylesheet tiddler that handles Poems:
title: Poetry Stylesheet
tags: $:/tags/Stylesheet
type: text/css
[data-tags*="Poem"] .tc-tiddler-body {
white-space: pre-wrap;
}
This adds a stylesheet with just a single selector, which captures the bodies of all tidders that have the tag Poem
, and assigns the value pre-wrap
to the property white-space
. I would probably for non-demo give the tiddler a name inside the system namespace, perhaps something like $:/my-project/styles/poems
, but for a demo Poetry Stylesheet
is fine. We use it by giving a tiddler the tag Poem
:
title: And They Obey
tags: Poem
SMASH down the cities.
Knock the walls to pieces.
Break the factories and cathedrals, warehouses
and homes
Into loose piles of stone and lumber and black
burnt wood:
You are the soldiers and we command you.
Build up the cities.
Set up the walls again.
Put together once more the factories and cathedrals,
warehouses and homes
Into buildings for life and labor:
You are workmen and citizens all: We
command you.
Again, you can download this and drag the resulting file to a wiki to see this in action:
Poetry.json (4.2 KB)