Preformatted is a great way to write haikus and poetry, because spaces and linebreaks are respected.
Should we rename the block to "Poetry", perhaps change the font to be the same as the base font? Or should "poetry" be a separate new block? Or should we add a "style" choice to the block that lets you write with the same font as the body text has, but with the benefits of preformatting? Should we add word-break?
Let's work this out together.
I think changing the font would be good so it's not just like code. Needs to be monospaced though.
Not sure if I like "Poetry" because it can be used for much more.
An alternative is that this is a separate block.
But we have to answer the question whether we need both a Code block and a Preformatted block.
So you can just write poetry already without doing anything special? :) That said, if you want to have it some special styling (like italic), it should probably be an enhanced text block?
I does seem that pre is well suited for this, and we could have a dedicated poetry block, but I would definitely keep the preformatted text block with the standard styling, as we do now in core, with unstyled, monospaced text.
Please not "Poetry". It would be strange for some websites for some companies. Keep it serious.
I noticed that spaces _are_ in fact saved, and respected, as Ella suggested. That's half of it.
Multiple linebreaks are not, though — a <p></p> without an inside collapse.
So I still see a usecase. The question becomes — is Preformatted useful to anyone, given we have a Code block also? If yes, then Poetry should be a separate block. If Preformatted is just confusing and few use it (as some initial confusion suggested), perhaps we rename it?
Yeah I agree there's still a use case.
I would create a separate block called "Verse" or something like that, which could be used for poems, songs, and alternative forms such as a message where the spacing is important.
Here's a wonderful example which illustrates a few use cases:
http://www.gutenberg.org/files/11/11-h/11-h.htm
I wouldn't classify all of these as poems:
‘How doth the little crocodile
Improve his shining tail,
And pour the waters of the Nile
On every golden scale!
‘How cheerfully he seems to grin,
How neatly spread his claws,
And welcome little fishes in
With gently smiling jaws!’
A "tale":
‘Fury said to a
mouse, That he
met in the
house,
“Let us
both go to
law: I will
prosecute
you.—Come,
I’ll take no
denial; We
must have a
trial: For
really this
morning I’ve
nothing
to do.”
Said the
mouse to the
cur, “Such
a trial,
dear Sir,
With
no jury
or judge,
would be
wasting
our
breath.”
“I’ll be
judge, I’ll
be jury,”
Said
cunning
old Fury:
“I’ll
try the
whole
cause,
and
condemn
you
to
death.”’
A song:
‘I speak severely to my boy,
I beat him when he sneezes;
For he can thoroughly enjoy
The pepper when he pleases!’
CHORUS.
‘Wow! wow! wow!’
Message:
Alice’s Right Foot, Esq.
Hearthrug,
near The Fender,
(with Alice’s love).
Decoration (use case for preformatted text, certainly not code):
* * * * * * *
* * * * * *
* * * * * * *
I guess you could argue that songs are poems, and ASCII art is code, but 🙃.
Icon idea: Quill.
I agree on your assessment @iseulde in terms of "not everything is a poem"... I'd personally still like "Poetry" as I feel it would send a strong message even if it can be used for far more than just poetry. Mostly because intuitively I feel people would _get_ "Poetry" but other labels more semantically accurate like "Preformatted" would be hard to understand.
And yes I agree it should be a separate block, as we might enrich it with specific properties like title and author, deal with cases like multiple spaces, which wouldn't make much sense for other uses. Also, would allow to better deal with fonts (instead of the monospaced one used for code).
I'd add that semantically might be even make more sense to tag Poetry differently from Preformatted: shouldn't Poetry use p blocks with white-space: pre;, instead of pre?
Icon idea: Quill.
Great icon idea. 💯
I'd add that semantically might be even make more sense to tag Poetry differently from Preformatted: shouldn't Poetry use
pblocks withwhite-space: pre;, instead ofpre?
I'm not sure what's better for poetry than pre. I feel like p is unfit for this, because one verse is not one paragraph? The spec has a different take though:
https://www.w3.org/TR/html5/grouping-content.html#the-p-element
https://www.w3.org/TR/html5/grouping-content.html#the-pre-element
So they'd say that if whitespace other than line breaks is important in a poem, it should be pre, otherwise p, which I find a bit strange.
If you use p, should the whole poem be one p, or should it be one p per verse? If the latter, we may not need a poetry block (unless it has more controls), as you can write it correctly with just text blocks.
Getting really into this.
https://www.poetryfoundation.org/articles/69619/breaking-the-poetry-code
Getting really into this.
I'm with you there. The state of ePub is one of the reason that made me in 2010 to create Baker Framework. :)
So they'd say that if whitespace other than line breaks is important in a poem, it should be pre, otherwise p, which I find a bit strange.
Good point on how to split it. Makes me prefer using pre – I think the "need" of a poetry block is more semantic and signalling than the existence of an underlying structure. Also to make easy for people to use it: using p for poetry is hard, especially as one would need most of the times to write CSS to control it.
Most helpful comment
I think changing the font would be good so it's not just like code. Needs to be monospaced though.
Not sure if I like "Poetry" because it can be used for much more.