Placing text on the same line with different styles

12 views
Skip to first unread message

dahearn

unread,
Nov 5, 2009, 8:42:46 AM11/5/09
to Prawn
What is the best/easiest way to achieve the following layout of text,
where the "labels" have a different style than the "values"?

NAME: XXXXXXXX
ADDRESS: XXXXXXXXXXXX
PHONE: XXXXXXXXX

I tried doing this just using the "text" method, but this method
always moves the document cursor down to the next line after inserting
the first piece of text.

Can multiples tables (one per line of text) be used to achieve this
layout? The key is I want to style the label differently than the
value.

Thanks,
Denis

Gregory Brown

unread,
Nov 5, 2009, 9:09:55 AM11/5/09
to prawn...@googlegroups.com
On Thu, Nov 5, 2009 at 8:42 AM, dahearn <de...@riverocktech.com> wrote:
>
> What is the best/easiest way to achieve the following layout of text,
> where the "labels" have a different style than the "values"?
>
> NAME: XXXXXXXX
> ADDRESS: XXXXXXXXXXXX
> PHONE: XXXXXXXXX
>
> I tried doing this just using the "text" method, but this method

See prawn-format.
http://lmgtfy.com/?q=prawn+format

dahearn

unread,
Nov 5, 2009, 9:48:15 AM11/5/09
to Prawn
Gregory

prawn-format is exactly what I was looking for, thanks!

I wasn't aware that prawn-format existed. Do you currently reference
this anywhere on the Prawn web site? If not, it might not be a bad
idea to have a "Prawn Extensions" section somewhere on the web site
that describes extensions of prawn that folks are using. I consumed
the web site prior to posting my question, so having a section like
that would've answered my particular question.

Regards,
Denis

Gregory Brown

unread,
Nov 5, 2009, 9:51:45 AM11/5/09
to prawn...@googlegroups.com
On Thu, Nov 5, 2009 at 9:48 AM, dahearn <de...@riverocktech.com> wrote:
>
> Gregory
>
> prawn-format is exactly what I was looking for, thanks!
>
> I wasn't aware that prawn-format existed.  Do you currently reference
> this anywhere on the Prawn web site?  If not, it might not be a bad
> idea to have a "Prawn Extensions" section somewhere on the web site
> that describes extensions of prawn that folks are using.  I consumed
> the web site prior to posting my question, so having a section like
> that would've answered my particular question.

It is in the README, it is installed by "gem install prawn", it is
listed on the first page of the wiki:
http://wiki.github.com/sandal/prawn, and in the CHANGELOG which the
gem tells you to read.

There is a Prawn extensions page, but prawn/format is officially
supported, so it is not there:
http://wiki.github.com/sandal/prawn/prawn-extensions-and-tools

I think I will redirect prawn.majesticseacreature.com to the wiki.
Maybe that would have helped?

dahearn

unread,
Nov 5, 2009, 10:14:49 AM11/5/09
to Prawn
Gregory,

What would've helped me is if prawn.majesticseacreature.com had a "-
Text formatting" section alongside the "- Built in support for UTF-8",
"- Easy image embedding", etc. sections. I definitely wouldn't have
missed it had it been listed there.

I also spent time looking through Prawn's online docs (http://
prawn.majesticseacreature.com/docs), but didn't see any mention of
Prawn::Format there.

Lastly, a "Learn More about Prawn" link on
prawn.majesticseacreature.com that links to the wiki would've been
helpful (I didn't know about the wiki).

Regards,
Denis

Gregory Brown

unread,
Nov 5, 2009, 10:39:20 AM11/5/09
to prawn...@googlegroups.com
On Thu, Nov 5, 2009 at 10:14 AM, dahearn <de...@riverocktech.com> wrote:

> Lastly, a "Learn More about Prawn" link on
> prawn.majesticseacreature.com that links to the wiki would've been
> helpful (I didn't know about the wiki).

My plan is to completely replace the homepage with the wiki. Please
add whatever you'd like there to help make this easier for others.

-greg

James Healy

unread,
Nov 5, 2009, 11:09:02 PM11/5/09
to prawn...@googlegroups.com
Gregory Brown wrote:
> > Lastly, a "Learn More about Prawn" link on
> > prawn.majesticseacreature.com that links to the wiki would've been
> > helpful (I didn't know about the wiki).
>
> My plan is to completely replace the homepage with the wiki. Please
> add whatever you'd like there to help make this easier for others.

I'm not such a fan of this idea, I find the github wiki's to be somewhat
annoying to browse. They're also a bit harder to find for people who
have only just discovered prawn.

A statically compiled site in version control can be fairly low
maintenance and still makes it easy for users to submit patches if they
notice things missing.

The ThinkingSphinx site is a good example imho.
- http://freelancing-god.github.com/ts/en/
- http://github.com/freelancing-god/freelancing-god.github.com

-- James Healy <ji...@deefa.com> Fri, 06 Nov 2009 15:08:22 +1100

Gregory Brown

unread,
Nov 6, 2009, 12:03:47 AM11/6/09
to prawn...@googlegroups.com
On Thu, Nov 5, 2009 at 11:09 PM, James Healy <ji...@deefa.com> wrote:
>
> Gregory Brown wrote:
>> > Lastly, a "Learn More about Prawn" link on
>> > prawn.majesticseacreature.com that links to the wiki would've been
>> > helpful (I didn't know about the wiki).
>>
>> My plan is to completely replace the homepage with the wiki.   Please
>> add whatever you'd like there to help make this easier for others.
>
> I'm not such a fan of this idea, I find the github wiki's to be somewhat
> annoying to browse. They're also a bit harder to find for people who
> have only just discovered prawn.
>
> A statically compiled site in version control can be fairly low
> maintenance and still makes it easy for users to submit patches if they
> notice things missing.

Okay, then maybe I'll just move it over to github pages and point the
CNAME there.
Is that sounding like a reasonable compromise?

-greg

James Healy

unread,
Nov 6, 2009, 12:20:53 AM11/6/09
to prawn...@googlegroups.com
Gregory Brown wrote:
> > A statically compiled site in version control can be fairly low
> > maintenance and still makes it easy for users to submit patches if they
> > notice things missing.
>
> Okay, then maybe I'll just move it over to github pages and point the
> CNAME there.
> Is that sounding like a reasonable compromise?

Sounds good to me.

-- James Healy <ji...@deefa.com> Fri, 06 Nov 2009 16:20:50 +1100

Reply all
Reply to author
Forward
0 new messages