NAME
PoeticForm
SYNOPSIS
PoeticForm.pl
DESCRIPTION
PoeticForm is a text-to-HTML filter; it translates an easy-to-read / easy-to-write structured text format into HTML. PoeticForm's text format is that of printed poetry where the expected form is lines grouped in stanzas. The final line of the entry may be a copyright notice separated by a blank line.
Example Input
As the street lamps light
In the twilight, children play
Games of kick the can
Copyright © 1988 David P. Henderson. All rights reserved.
Example Output
<div class="poem">
<p class="stanza">
<span class="line">As the street lamps light</span>
<span class="line">In the twilight, children play</span>
<span class="line">Games of kick the can</span>
</p>
<p class="copyrightNotice">
Copyright © 1988 David P. Henderson. All rights reserved.
</p>
</div>
PoeticForm will also attempt to maintain indentation at the start of a line. Currently, it recognizes up to three tabs at the start of a line.
PoeticForm generates the following class attribute values:
- poem
-
The class of the div tag which surrounds the poem
- stanza
-
The class of each p tag surrounding the stanza(s) of the poem
- line
-
The class of each span tag surrounding a line of the poem except for the following special cases:
- halfTabbedLine
-
The class of each span tag surrounding a line of the poem which is indented from one to three spaces
- singleTabbedLine
-
The class of each span tag surrounding a line of the poem which is indented one tab or four spaces
- doubleTabbedLine
-
The class of each span tag surrounding a line of the poem which is indented two tabs or eight spaces
- tripleTabbedLine
-
The class of each span tag surrounding a line of the poem which is indented three tab or twelve spaces
Note: That you must add these classes to your css style sheet. The intended use of the span tags is to set them to { display: block; } and each (half|single|double|triple)TabbedLine should have a desired indent level set via the { text-indent: value; }.
This file may be found on the Web at:
http://chaoswerks.com/PoeticForm.html
PoeticForm.pl available at:
http://chaoswerks.com/PoeticForm.zip
OPTIONS
PoeticForm has no options as yet. Whether this condition will change is dependent upon the number of requests for such features.
BUGS
To file bug reports or feature requests (other than topics listed in the Caveats section above) please send email to:
support@chaoswerks.com
Please include with your report: (1) the example input; (2) the output you expected; (3) the output PoeticForm actually produced.
VERSION HISTORY
1.0b3: 2005-03-16
Fixed faulty logic which failed to close open p and div tags
if no copyright notice existed.
1.0b2: 2005-03-12
Added value for indents of less than one tab length (4 spaces).
1.0b1: 2005-03-01
Initial public release.
AUTHOR
David P. Henderson
http://chaoswerks.com
COPYRIGHT AND LICENSE
Copyright © 2005, David P. Henderson. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of the Chaos Werks Design nor the names of
its contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.