yeoman / yosay

Tell Yeoman what to say
BSD 2-Clause "Simplified" License
205 stars 43 forks source link

MaxLength alignement fix needed? #1

Closed hemanth closed 10 years ago

hemanth commented 10 years ago
$ yosay "Yo! How's it going" --maxLength 4

     _-----_
    |       |    .------.
    |--(o)--|    |  Yo! |
   `---------´   | How's |
    ( _´U`_ )    |  it  |
    /___A___\    | going |
     |  ~  |     '------'
   __'.___.'__   
 ´   `  |° ´ Y ` 
stephenplusplus commented 10 years ago

I'm not sure what the correct handling of this is. When maxLength is specified as a length greater than your longest word (how's and going = 5).

sindresorhus commented 10 years ago

minLength (private) should be the length of the longest word.

stephenplusplus commented 10 years ago

So yosay would return a properly formatted quote bubble with the required extra spacing, but ignore the user's maxLength specification?

sindresorhus commented 10 years ago

If maxLength is smaller than the longest word, yes.

SBoudrias commented 10 years ago

If maxLength is smaller than the longest word, yes.

Still this is tricky as there might be a very long (user inputted) word.

Maybe the best (not easiest) behavior should be to cut these long words?

hemanth commented 10 years ago

Something like CSS hyphenation would help?

Update: hyper

stephenplusplus commented 10 years ago

4 for the first attempt.