Versed

Typographic control for verse, poetry, hymns and lyrics

Proper verse layout has two specific needs:

You should also be able to target individual lines with CSS. For instance, to add line numbers.

The only way to get this effect with sensible HTML is to wrap each line in a span (with its own class), and to write CSS to control runover lines and centering. That's a lot of work to do by hand. Versed does it for you in the browser.

  1. Link to versed.js and versed.css on your page.
  2. Mark up your verse in HTML with ps and brs, and wrap each piece in a div class="versed". You can do this easily in markdown, too.
See the code's README for instructions.

Samples

Here's a short poem with indented lines.

To One Who Has Been Long in City Pent

To one who has been long in city pent,
  ‘Tis very sweet to look into the fair
  And open face of heaven,—to breathe a prayer
Full in the smile of the blue firmament.
Who is more happy, when, with heart’s content,
  Fatigued he sinks into some pleasant lair
  Of wavy grass, and reads a debonair
And gentle tale of love and languishment?

Returning home at evening, with an ear
  Catching the notes of Philomel,—an eye
Watching the sailing cloudlet’s bright career,
  He mourns that day so soon has glided by:
E’en like the passage of an angel’s tear
  That falls through the clear ether silently.


And here's a longer poem with line numbers.

Gerontion

 Thou hast nor youth nor age
 But as it were an after dinner sleep
 Dreaming of both.

Here I am, an old man in a dry month,
Being read to by a boy, waiting for rain.
I was neither at the hot gates
Nor fought in the warm rain
Nor knee deep in the salt marsh, heaving a cutlass,
Bitten by flies, fought.
My house is a decayed house,
And the jew squats on the window sill, the owner,
Spawned in some estaminet of Antwerp,
Blistered in Brussels, patched and peeled in London.
The goat coughs at night in the field overhead;
Rocks, moss, stonecrop, iron, merds.
The woman keeps the kitchen, makes tea,
Sneezes at evening, poking the peevish gutter.

     I an old man,
A dull head among windy spaces.
Signs are taken for wonders. “We would see a sign”:
The word within a word, unable to speak a word,
Swaddled with darkness. In the juvescence of the year
Came Christ the tiger

In depraved May, dogwood and chestnut, flowering Judas,
To be eaten, to be divided, to be drunk
Among whispers; by Mr. Silvero
With caressing hands, at Limoges
Who walked all night in the next room;
By Hakagawa, bowing among the Titians;
By Madame de Tornquist, in the dark room
Shifting the candles; Fraulein von Kulp
Who turned in the hall, one hand on the door. Vacant shuttles
Weave the wind. I have no ghosts,
An old man in a draughty house
Under a windy knob.

After such knowledge, what forgiveness? Think now
History has many cunning passages, contrived corridors
And issues, deceives with whispering ambitions,
Guides us by vanities. Think now
She gives when our attention is distracted
And what she gives, gives with such supple confusions
That the giving famishes the craving. Gives too late
What’s not believed in, or if still believed,
In memory only, reconsidered passion. Gives too soon
Into weak hands, what’s thought can be dispensed with
Till the refusal propagates a fear. Think
Neither fear nor courage saves us. Unnatural vices
Are fathered by our heroism. Virtues
Are forced upon us by our impudent crimes.
These tears are shaken from the wrath-bearing tree.

The tiger springs in the new year. Us he devours. Think at last
We have not reached conclusion, when I
Stiffen in a rented house. Think at last
I have not made this show purposelessly
And it is not by any concitation
Of the backward devils.
I would meet you upon this honestly.
I that was near your heart was removed therefrom
To lose beauty in terror, terror in inquisition.
I have lost my passion: why should I need to keep it
Since what is kept must be adulterated?
I have lost my sight, smell, hearing, taste and touch:
How should I use it for your closer contact?

These with a thousand small deliberations
Protract the profit of their chilled delirium,
Excite the membrane, when the sense has cooled,
With pungent sauces, multiply variety
In a wilderness of mirrors. What will the spider do,
Suspend its operations, will the weevil
Delay? De Bailhache, Fresca, Mrs. Cammel, whirled
Beyond the circuit of the shuddering Bear
In fractured atoms. Gull against the wind, in the windy straits
Of Belle Isle, or running on the Horn,
White feathers in the snow, the Gulf claims,
And an old man driven by the Trades
To a sleepy corner.

     Tenants of the house,
Thoughts of a dry brain in a dry season.


Here's a simple classic with shorter lines.

I Wandered Lonely as a Cloud

I wandered lonely as a cloud
That floats on high o'er vales and hills,
When all at once I saw a crowd,
A host, of golden daffodils;
Beside the lake, beneath the trees,
Fluttering and dancing in the breeze.

Continuous as the stars that shine
And twinkle on the milky way,
They stretched in never-ending line
Along the margin of a bay:
Ten thousand saw I at a glance,
Tossing their heads in sprightly dance.

The waves beside them danced; but they
Out-did the sparkling waves in glee:
A poet could not but be gay,
In such a jocund company:
I gazed—and gazed—but little thought
What wealth the show to me had brought:

For oft, when on my couch I lie
In vacant or in pensive mood,
They flash upon that inward eye
Which is the bliss of solitude;
And then my heart with pleasure fills,
And dances with the daffodils.


Versed works fine for little extracts, too:

     Tenants of the house,
Thoughts of a dry brain in a dry season.


Contributions

If you have suggestions, add an issue on GitHub.