DropCap Plugin for Movable Type
Current version: 1.1 (7/12/04)
- Download (.tar.gz file)
- Plugin Code (.pl file)
- About the DropCap Plugin
- Version History
This Movable Type plugin implements a set of template tags for displaying the first letter of a section of text as a "drop cap." A drop cap is a large initial letter of a paragraph that spans more than one line of text. The CSS2 standard lets you create drop caps using the
first-letter pseudo-element. However, this will not display properly in older browsers, and it also doesn't allow you to use images for your drop caps. This plugin is designed to let you do drop caps the old-fashioned way, by using an HTML table or image with
align="left", which will cause the paragraph to wrap around the drop cap.
The DropCap plugin currently only formats the first letter of the entire piece of text you specify (i.e. your entry body), not the first letter of each paragraph. Future versions might add the option to apply formatting to paragraphs within your text.
To install the DropCap plugin, upload the file DropCap.pl to the plugins directory within your Movable Type directory. If you do not already have a plugins directory, create one before uploading the file. For more information about Movable Type plugins, see the documentation.
Please use the support forums for all support requests, bug reports, feature requests, questions, and comments regarding this plugin.
This container tag goes around whatever text you want to format with a drop cap. It finds the first letter of the text, ignoring any initial tags and/or whitespace. It replaces this letter with the contents of
MTDropCapFormat, inserting the letter wherever
The following example uses a large font size to create a basic drop cap:
<MTDropCap> <!--this is the formatting that will replace the first letter of the text--> <MTDropCapFormat> <table align="left"><tr valign="bottom"><td> <p style="font-size:28pt"> <!--here's where the letter will go--> <$MTDropCapLetter$> </p> </td></tr></table> </MTDropCapFormat> <!--whatever's within MTDropCap but outside MTDropCapFormat is the text whose first letter will be replaced--> <$MTEntryBody$> </MTDropCap>
Note that the tags do not actually know anything about how drop caps work. They simply replace the first letter of the text with the formatting you specify. It's up to you to choose an appropriate size for the drop cap, give it appropriate spacing, etc.
The tag takes the following attribute:
- case="upper|lower" (optional)
By default, the plugin does not change the case of the initial letter; it inserts it into the formatting just as it was originally. To force the letter to be either
lowercase, use this attribute.
MTDropCap, this container tag delimits the HTML code that will be inserted in place of the first letter. It should contain a
MTDropCapLetter at the point where you want the letter to be placed.
MTDropCapFormat, indicates where the initial letter should go.
The following example will create graphical drop caps, using images in the directory
letters that are named
<MTDropCap case="lower"> <MTDropCapFormat> <img align="left" src="/images/letters/<$MTDropCapLetter$>.gif"> </MTDropCapFormat> <$MTEntryBody$> </MTDropCap>
7/12/04 - version 1.1
- Plugin now registers itself with MT 3 interface.
- Added $VERSION variable and package declaration.
- All container tags now pass conditions along when building contents, so they'll work outside conditional tags within MTEntries, etc.
11/14/03 - version 1.02
- Multiple instances of MTDropCapLetter within the same format container are now replaced properly (Steve Rushe)
11/12/02 - version 1.01
\1in regex that was causing a warning
7/18/02 - version 1.0 released