Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fill with text #1

Merged
merged 4 commits into from Jul 27, 2014
Merged

Fill with text #1

merged 4 commits into from Jul 27, 2014

Conversation

apaszke
Copy link
Contributor

@apaszke apaszke commented Jul 26, 2014

I've added a possibility to fill the box with text. There are various options like align and auto line breaks.

wesolyromek added 3 commits July 26, 2014 12:34
Now Box accepts a string to display inside (can be multiline)
Supports different aligns, automatic line breaks and stretching the box.
@IonicaBizau
Copy link
Owner

🌟 This is really cool! ⭐

Even we can use overlap module for such things, I will merge this!


However, there are some things to solve before merge:

  • I tried to align text horizontally/vertically, but text is not aligned:

    > console.log(Box("40x10", {text: "Lorem ipsum", hAligh: "left"}).toString())
    +--------------------------------------+
    |                                      |
    |                                      |
    |                                      |
    |                                      |
    |             Lorem ipsum              |
    |                                      |
    |                                      |
    |                                      |
    |                                      |
    |                                      |
    +--------------------------------------+
    > console.log(Box("40x10", {text: "Lorem ipsum", vAligh: "top"}).toString())
    +--------------------------------------+
    |                                      |
    |                                      |
    |                                      |
    |                                      |
    |             Lorem ipsum              |
    |                                      |
    |                                      |
    |                                      |
    |                                      |
    |                                      |
    +--------------------------------------+
  • Don't forget to create contributors field in package.json and add yourself there.

@IonicaBizau
Copy link
Owner

See the inline comments as well.

@apaszke
Copy link
Contributor Author

apaszke commented Jul 26, 2014

I'll check it. The problem you had with the align is because you have a typo. You wrote "hAligh" instead on "hAlign" ;)
I'm glad that you like it! 😄

Added contributors to package.json, removed console.dir from index.js,
updated tests and removed typos from README
@apaszke
Copy link
Contributor Author

apaszke commented Jul 26, 2014

Hahahaha yeah, I've just found it. My fault, sorry. I've also updated the tests. It should be all fine by now 😆

IonicaBizau added a commit that referenced this pull request Jul 27, 2014
@IonicaBizau IonicaBizau merged commit 8ca7fb7 into IonicaBizau:master Jul 27, 2014
@IonicaBizau
Copy link
Owner

Thanks, it works fine! 🎆

@apaszke
Copy link
Contributor Author

apaszke commented Jul 27, 2014

Great! Thanks! 👍

@apaszke apaszke deleted the fill-with-text branch July 27, 2014 19:02
@IonicaBizau
Copy link
Owner

@WesolyRomek I wrote a blog post about a new library where this feature is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants