# Shoes2 newbie question about documentation example

**URL:** <https://www.ruby-forum.com/t/shoes2-newbie-question-about-documentation-example/171945>\
**Category:** Ruby\
**Created:** [July 12, 2009, 2:55am UTC](https://www.ruby-forum.com/t/shoes2-newbie-question-about-documentation-example/171945 "2009-07-12T02:55:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [July 12, 2009, 2:55am UTC](https://www.ruby-forum.com/t/shoes2-newbie-question-about-documentation-example/171945/1 "2009-07-12T02:55:32Z")

</div>

Hi,

I following the documentation at [http://hackety.org/press/nks.pdf](http://hackety.org/press/nks.pdf)

It suggests the following code:  
Shoes.app do  
title “Title”  
subtitle “Subtitle”  
# [snip]  
end

will produce the output:  
Title 34px  
Subtitle 26px  
[snip]

First, to list the entries as show, the source list needs to be  
embedded in the block:  
stack do  
end

Secondly, the demo leads a newbie to think the pixel heights will be  
explicitly printed. Of course, no sizes are printed.

My question: is it easy to amend the source code to actually to be  
included in the output as suggested? (I just want to see if Shoe2 is  
really as easy as its advertisers suggest.

Thanks in Advance,  
Richard

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [July 12, 2009, 3:04am UTC](https://www.ruby-forum.com/t/shoes2-newbie-question-about-documentation-example/171945/2 "2009-07-12T03:04:29Z")

</div>

> My question: is it easy to amend the source code to actually to be  
> included in the output as suggested? (I just want to see if Shoe2 is  
> really as easy as its advertisers suggest.

you mean to print it out to the console?  
=r

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [July 12, 2009, 7:26am UTC](https://www.ruby-forum.com/t/shoes2-newbie-question-about-documentation-example/171945/3 "2009-07-12T07:26:00Z")

</div>

On Jul 11, 9:04 pm, Roger P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > My question: is it easy to amend the source code to actually to be  
> > included in the output as suggested? (I just want to see if Shoe2 is  
> > really as easy as its advertisers suggest.
> 
> ## you mean to print it out to the console? =r
> 
> Posted viahttp://www.ruby-forum.com/.

Currently, the output is a bunch of lines:  
Title  
Subtitle  
[snip]

The “Title” text appears to be 40 px tall as claimed in the tutorial  
Likewise, the “Subtitle” text appears to be 26 px.

I want each line to include a computation of its height and  
print that computational result appended to the the text.

So the output will be:  
Title 40px  
Subtitle 26px

just as presented in the tutorial. However, the heights are to be  
computed, not include as the literal text input.

Is that clear?

Best wishes,  
Richard

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [July 13, 2009, 6:44pm UTC](https://www.ruby-forum.com/t/shoes2-newbie-question-about-documentation-example/171945/4 "2009-07-13T18:44:55Z")

</div>

> So the output will be:  
> Title 40px  
> Subtitle 26px

It might be possible. Maybe 🙂  
Maybe ask in the shoes mailing list?  
=r

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [July 19, 2009, 5:05am UTC](https://www.ruby-forum.com/t/shoes2-newbie-question-about-documentation-example/171945/5 "2009-07-19T05:05:46Z")

</div>

On Jul 13, 12:45 pm, Roger P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > So the output will be:  
> > Title 40px  
> > Subtitle 26px
> 
> ## It might be possible. Maybe 🙂 Maybe ask in the shoes mailing list? =r
> 
> Posted viahttp://www.ruby-forum.com/.

Hi Roger,

> Maybe ask in the shoes mailing list?  
> I wanted to do that, but I could never find a URL for it. Your  
> suggestion spurred me to redouble my efforts to find it.

I happy to report SUCCESS: [http://news.gmane.org/gmane.comp.lib.shoes](http://news.gmane.org/gmane.comp.lib.shoes)

Many thanks for your response.

Best wishes,  
Richard

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [July 19, 2009, 8:55am UTC](https://www.ruby-forum.com/t/shoes2-newbie-question-about-documentation-example/171945/6 "2009-07-19T08:55:28Z")

</div>

RichardOnRails wrote:

> Hi,
> 
> I following the documentation at [http://hackety.org/press/nks.pdf](http://hackety.org/press/nks.pdf)

You got a page number? Sheesh!

> It suggests the following code:  
> Shoes.app do  
> title “Title”  
> subtitle “Subtitle”  
> # [snip]  
> end
> 
> will produce the output:  
> Title 34px  
> Subtitle 26px  
> [snip]

On page 23, there is a picture with similar output. To me the  
descriptions and pictures suggested this:

1. a para has a certain sized font
2. to display other sized fonts you can use other ‘tags’, e.g. banner,  
title, subtitle, etc.
3. the size of the font is shown next to the displayed strings in the  
picture to give you an idea of the size of the font corresponding to  
each tag.

> First, to list the entries as show, the source list needs to be  
> embedded in the block:  
> stack do  
> end

Ok. Not really a big deal.

> My question: is it easy to amend the source code to actually to be  
> included in the output as suggested? (I just want to see if Shoe2 is  
> really as easy as its advertisers suggest.

There’s nothing in the Nobody Knows Shoes manual that shows you how to  
get the default size of a tag. It shows you how to set the size, for  
example:

title “Hello World”, :size =\> 10

so there is a size property somewhere. But this doesn’t work:

title title.size

I would guess that the title tag creates a title instance, and the size  
is set on the title instance, and then the title instance is added to  
the main app.

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [July 23, 2009, 6:31pm UTC](https://www.ruby-forum.com/t/shoes2-newbie-question-about-documentation-example/171945/7 "2009-07-23T18:31:08Z")

</div>

On Jul 13, 12:45 pm, Roger P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > So the output will be:  
> > Title 40px  
> > Subtitle 26px
> 
> ## It might be possible. Maybe 🙂 Maybe ask in the shoes mailing list? =r
> 
> Posted viahttp://www.ruby-forum.com/.

Hi Roger, I’ve started looking into the Shoes list on GitHub. I just  
realized today that I hadn’t posted my acknowledgment of that advise.

So, belatedly: Thanks!

Best wishes,  
Richard

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [July 20, 2009, 12:42am UTC](https://www.ruby-forum.com/t/shoes2-newbie-question-about-documentation-example/171945/8 "2009-07-20T00:42:29Z")

</div>

7stud – wrote:

> There’s nothing in the Nobody Knows Shoes manual that shows you how to  
> get the default size of a tag. It shows you how to set the size, for  
> example:
> 
> title “Hello World”, :size =\> 10
> 
> so there is a size property somewhere. But this doesn’t work:
> 
> title title.size
> 
> I would guess that the title tag creates a title instance, and the size  
> is set on the title instance, and then the title instance is added to  
> the main app.

…but this doesn’t work either:

@t = title “Hello World”  
subtitle @t.size

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [July 23, 2009, 6:37pm UTC](https://www.ruby-forum.com/t/shoes2-newbie-question-about-documentation-example/171945/9 "2009-07-23T18:37:00Z")

</div>

On Jul 19, 6:42 pm, 7stud – [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Posted viahttp://www.ruby-forum.com/.  
> Hi 7Stud,

Thanks for your advice. I’ve been moving slowly on this. Your post  
will give me greater motivation. I’ll post back in a few days if I  
have any luck.

Best wishes,  
Richard
