Comments (5)
Yo @tjconcept - thanks for the writeup. I'm back from vacation ( a terrible non-vacation really since it resulted in a totaled car and leaving early due to hurricane ) and will review this and your other PRs when I get a chance.
Right now I think your proposal is the way to go, though maybe make <br />
the default.
from tablemark.
I'm sorry to hear about your vacation, but welcome back.
I went ahead and implemented this for the challenge, first as a prototype, then I couldn't stop. It was.. much more complex than I had imagined. Things as word wrapping (visual length ≠ .length
due to unicode), and generating and rendering a matrix for each row.
Anyway, I am satisfied with the result. I'm gonna put up a PR for you to peak at the code soon.
though maybe make
<br />
the default.
I was inclined to newlines because my primary use case is "pretty printing" in the terminal. But I guess this package (reasonably) has "valid markdown" as the primary use case.
from tablemark.
@tjconcept Either way shouldn't be too bad as a default. A shorthand flag on the CLI would make either one easy enough to trigger, like -n
for using newlines or -b
for breaks or something.
Unicode lengths may need a little extra love. Might be worth adding in string-length for that but there could also be alternatives.
I've made you a collaborator for both the module & the CLI so you can make pushes. I'll just jump in with reviews as we've been doing, but you've been putting in a load of time for these so it'll be easier for you to work on things. Thanks for your efforts 👍
from tablemark.
Unicode lengths may need a little extra love. Might be worth adding in string-length for that but there could also be alternatives.
I ended up writing a new package for this as we need the wrapped result back as an array, not a string, we need the string length counter to be tied to the wrapper (returning the same result), and we need hard wrapping (some packages had hard wrapping, but would still overflow on words longer than the column).
It's not that bad to count too much, as long as you wrap by the same the same metric, and only wraps on explicit white space. It will only result in some excess whitespace.
I've made you a collaborator for both the module & the CLI so you can make pushes. I'll just jump in with reviews as we've been doing, but you've been putting in a load of time for these so it'll be easier for you to work on things.
Awesome! Give PRs an approval when you think they are ready then.
Thanks for your efforts 👍
No problem. I'm scratching my own itches here (this being the last one I think, for now).
from tablemark.
Closed by #6
from tablemark.
Related Issues (9)
- Release version HOT 1
- super neat package; no issues HOT 1
- Params does not affect output HOT 1
- Soften or remove `os` module dependency HOT 1
- vscode extension
- Option for compact headers HOT 3
- Extra dash is generated when label is shorter than content (with padHeaderSeparator: true)
- Passing an empty array throws error
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 tablemark.