DropCap ideas wanted...and general markup plugin questions

Creating and modifying plugins.
Post Reply
User avatar
RobA
Regular
Posts: 317
Joined: Wed Apr 27, 2005 5:11 pm
Contact:

DropCap ideas wanted...and general markup plugin questions

Post by RobA » Mon May 16, 2005 7:59 pm

I found a clever way of making DropCaps that I mentioned in my blog here.

The most flexable way of doing a dropcap is just to use the span style in the text manually, but this may be awkward...so I figured it might be better to make it a plugin....but maybe not.

Here is the question... should something like a "First Letter Drop Cap" be a part of the "style" and not require an article editor to enter it? If so, I guess a plugin lile the nl2br one that just automatically turns the first alpha character into a dropcap makes sense...but might not be dered in all cases...

Alternately, is this situation more like a "markup"? For example (as a quick test) I added the line:

Code: Select all

          '/(?<!\\\\)\[dropcap(?::\w+)?\](.*?)\[\/dropcap(?::\w+)?\]/si'                                  => "<span style=\"float:left;font-size:80px;line-height:50px;padding-top:2px;font-family: Times,serif,Georgia;opacity: 0.75;\">\\1</span>",

into the serendipity_event_bbcode plugin as a test. This lets an article author put in a dropcap anywhere they want by using [dropcap]L[dropcap].

Does this approach make more sense (not necessarily in the BBCode plugin...I just used that for a test)?

Lastly, what is the purpose of the s9y markup plugin? Does it provide markup that other types don't? (can't locate a document on it). Would this be the most sensible place to "extend" markups?

Alternately, would a content_rewrite that supports regexp be too dangerous? Then one could easily define any type of markup rewrite from the backend-admin.

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: DropCap ideas wanted...and general markup plugin questio

Post by garvinhicking » Tue May 17, 2005 2:02 pm

RobA, yes I think a plugin like BBCode would be suited best for this thing, so I agree to put that functionality there.

Does, BTW, CSS not support something like a DropCap attribute? It at least has the support for large caps, so just a thought...

The s9y markup plugin does indeed not offer any extra functionality that is not part in other markups. In fact it is mostly use to enclodes words with "*" or "_" to underline/bold the text. It is very restricted, but some people got used to it.

I for one would rather suggest to enhance the BBCode plugin or provide its own plugin for that effect...

You could also use the content_rewrite stuff, that is true. But many people do not seem to get a hold of configuring that plugin properly; if you work it out for yourself... I must admit I've never tried to use the content_rewrite stuff for anything than to replace hardcoded strings; if you want it to replace generic strings I'm not really sure if it would work out.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

User avatar
RobA
Regular
Posts: 317
Joined: Wed Apr 27, 2005 5:11 pm
Contact:

Post by RobA » Tue May 17, 2005 6:22 pm

You can see how I implemented dropcaps on my blog using a technique described http://ffaat.pointclark.net/blog/archives/16-Drop-Caps-part-Deux.html

The short and sweet summary is:
-Define a .dropcap class in css
-modify the BBCode plugin to allow inserting a dropcap using [dropcap][/dropcap] type syntax by wrapping the contents in the defined class.

I also wanted to credit Dan Armeneau, at whose site http://www.terremoto.ca/ I first saw this use of dropcaps.

Oh - and I did check out the use of the CSS first-letter function, but found it rather inflexible :)

As always, comments welcome.

-Rob A>

Chindogu
Regular
Posts: 6
Joined: Wed Jun 01, 2005 8:04 pm
Location: Vancouver, BC
Contact:

Post by Chindogu » Wed Jun 01, 2005 8:36 pm

Hi, I've got a drop cap solution that works great.

In my CSS I have this set up:

.dropcap {
float: left;
width: .8em;
font-size: 4em;
line-height: 83%;
}


And for whichever letter I want affected I put this code around it:

<span class="dropcap"></span>


You can check an example at my site: http://www.chindogu.ca

Chindogu

Post Reply