Coder Social home page Coder Social logo

Comments (4)

denisdefreyne avatar denisdefreyne commented on July 26, 2024

This is problematic to fix in a backwards-compatible way.

One idea I had was to parse the input as Markdown (kramdown to be precise) and convert the internal kramdown to something that is fit for terminal output.

from cri.

bmesuere avatar bmesuere commented on July 26, 2024

While markdown support would be great, maybe it's an option to add a metacharacter that gets translated into a newline?

from cri.

denisdefreyne avatar denisdefreyne commented on July 26, 2024

I just discovered tty-markdown, which might be a very good for this use case.

from cri.

esotericpig avatar esotericpig commented on July 26, 2024

I think just a simple {n} would be nice that StringFormatter would look for.

To make it backwards compatible, just add an option in Command that is set to false by default.

This command has 3 features:{n}
- awesome feature 1{n}
- awesome feature 2{n}
- awesome feature 3{n}

We also have a lot of options.
super_cmd = @app_cmd = Cri::Command.define(newline_metachar: true) do
  # ...
end

super_cmd.define_command(newline_metachar: true) do
  # ...
end

This is easier (just parse for {n}; don't have to include the tty-markdown gem) and backwards-compatible (newline_metachar or w/e name is set to false by default).

from cri.

Related Issues (20)

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.