Giter Site home page Giter Site logo

Comments (5)

haltcase avatar haltcase commented on July 28, 2024

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.

tjconcept avatar tjconcept commented on July 28, 2024

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.

haltcase avatar haltcase commented on July 28, 2024

@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.

tjconcept avatar tjconcept commented on July 28, 2024

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.

haltcase avatar haltcase commented on July 28, 2024

Closed by #6

from tablemark.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.