WP Manifestindependent plugin directory
manifest / content / poem-scaler

Poem Scaler

wordpress plugin for scaling linebreaks without interrupting them

by Gaia Rajan · github.com/gaiarajan/poem-scaler

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/gaiarajan/poem-scaler/archive/refs/heads/main.zip

Poem Scaler for WordPress

Most litmags format experimentally spaced poems using images, but this reduces accessibility and makes the poems unsearchable. This is a Wordpress plugin to preserve whitespace formatting across the page by scaling down for narrower screen sizes.

Installation

  1. Upload the poem-scaler/ folder to /wp-content/plugins/
  2. Activate via the WordPress Plugins screen
  3. The [poem] shortcode is now available anywhere you write content

Demo

code result

(by e.e. cummings)

Usage

Basic

[poem]
               words          words
    word                  word
               words
[/poem]

Title

[poem title="words"]
...
[/poem]

Fonts

[poem font="mono"]: monospace
[poem font="serif"]: uses your theme's body font (default)
[poem font="sans"]: uses your theme's sans-serif font

Minimum scale

By default, poems will scale down to 35% of their natural width before the plugin falls back to horizontal scroll. Adjustable

[poem min_scale="0.5"]: won't scale below 50%; scrolls instead
[poem min_scale="0.2"]: allows very aggressive scaling

Editing tips

  • Use spaces instead of tabs if you want completely predictable column alignment (tabs render at 4 characters wide by default; this is configurable in poem-scaler.css via tab-size)
  • Use the Classic block in Gutenberg or the Classic Editor plugin when pasting the shortcode, Gutenberg's paragraph blocks may strip whitespace from shortcode content

Customization

You can edit poem-scaler.css to match the theme.

  • .poem-pre line-height — adjust vertical spacing
  • tab-size — how wide tabs render
  • .poem-scaler[data-scaled="true"]::after — "X% of original size" indicator, delete if you don't want it