Comments (5)
Hi there,
I'll be working on a solution for this, probably using the wrap-ansi
package. If that's okay I'd like to ask a question:
Should the text wrap just enough so that there is no wrap-around, or should it default to a smaller number?
from boxen.
@Areadrill No wrap-around I think. Just go for it :)
Please test the CJK character cases.
Here are some sentences for your test:
Chinsese:
Apple 员工不只创造产品,他们的奇思妙想更引领着整个行业的潮流。员工多样化的背景带来了**的碰撞,从令人惊叹的科技到业界领先的环保措施,我们所做的一切都闪耀着他们的灵感与创新。加入 Apple,和我们一道让世界变得更美好。
Japanese:
Appleで働く人々は、ただ製品を作っているだけではありません。あらゆる業界に革命をもたらす、ある種の驚きを生み出しています。驚異的なテクノロジーの開発から業界をリードする環境への取り組みまで、私たちのすべての活動に革新をもたらすのは、多様な人々と彼らが生み出す多彩なアイデアです。あなたもAppleに参加し、協力してください。出会った時よりも良い世界を、未来に渡すために。
Korean:
Apple 직원들이 만드는 것은 제품만이 아닙니다. 산업 전반을 송두리째 바꾸는 기적을 창조해내죠. 놀라운 기술 개발에서 업계를 주도하는 환경 보호 노력에 이르기까지, Apple이 하는 모든 일의 이면에는 혁신이 살아 숨쉬고 있습니다. 그 혁신을 뒷받침하는 것이 바로 구성원들의 다양성과 아이디어죠. Apple의 일원이 되어, 더 살기 좋은 세상을 만드는 이 위대한 여정에 동참해보세요.
from boxen.
It doesn't currently support text wrapping. For now you could use wrap-ansi
before passing it to Boxen. I'll leave it open as a feature request. Pull request welcome.
from boxen.
In light of issue #35, which directly impacts my solution since I'm using wrap-ansi
on strings which might have ANSI styles applied, should I come up with a way to rectify the string's ANSI codes post-split?
I ask because chalk might not be the only relevant use case and if that's so, a more generic fix should probably be applied.
from boxen.
Hi again! My solution is pretty much good to go, with ANSI codes being correctly split and everything but I have one last question: How do I write tests for this?
This particular package is dependent on the size of the window it is run on. Even some of the tests that are currently implemented will fail if one makes a small enough window, so testing for a test case where the content is supposed to wrap would, again, depend on the size of the window.
from boxen.
Related Issues (20)
- Boxen colors don't get saved to console logs HOT 1
- Problem with BorderStyle HOT 2
- Do you mind if I do some code refactoring? HOT 2
- Border style type issue HOT 5
- New option width HOT 1
- Text wrapping doesn't account for margin
- Multiple boxes on same line (feature request) HOT 2
- New option: title HOT 1
- cropping leading whitespace in new version ?? HOT 4
- Upgrade `cli-boxes` dependency HOT 1
- Update widest-line vulnerability? HOT 2
- Upgrade `boxen-cli` HOT 3
- require() of ES Module not supported. With Typescript 4.6 and boxen 6.0.0 or higher. HOT 1
- Newlines get stripped out HOT 6
- ES module not supported HOT 1
- Max width option HOT 3
- Allow border to be optional. HOT 2
- Mark Spacing properties optional
- boxen is not working HOT 2
- Table border wrongly formatted HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boxen.