Coder Social home page Coder Social logo

Comments (6)

DannyBen avatar DannyBen commented on May 25, 2024

Glad you like it.

Can you give me an example of an expected markdown output?

from bashly.

roquie avatar roquie commented on May 25, 2024

Given that bashly supports nesting commands, the most convenient format for fully displaying documentation is to display it in a similar way as homebrew does in man (man brew). Example in the attachment. Markdown here will help with lists, titles, and highlighting options/flags/environment variables.

example.txt

Without strictly following the man rules, can just make it a similar format.

from bashly.

DannyBen avatar DannyBen commented on May 25, 2024

It shouldn't be too difficult to implement, the question is - should it be a part of bashly or not.

For the most part, the --help flag provides all the documentation you need. In the real world, you only need man pages or READMEs in case there is more information to share that is not available in the --help usage text.

If we implement this in bashly, the information will be identical, only formatted differently.

In addition, if we already generate a markdown documentation, someone else might want to generate man pages, or HTML documentation. So I am a little hesitant to create a "feature creep".

Let me think about it some more, and if you have thoughts on the above, feel free to share.

from bashly.

roquie avatar roquie commented on May 25, 2024

I see two ways.

First: implement this in bashly, because bashly.yaml an inseparable part of bashly and doc depends on it.

Second: make a plugin system for bashly, but I think for it is a large overhead. May be used a mixed solution: create an documentation abstraction in bashly for generate different formats. Anyone can add a HTML/PDF doc format.

from bashly.

DannyBen avatar DannyBen commented on May 25, 2024

I have already tried several approaches, but ultimately, ended up with a complex structure that is essentially generating the same thing as the usage text (--help) using different views.

Generating the script from the YAML today is a process that is done by using many small code snippets (see the views folder). This process needs to take into account many nuances, such as: Do we have subcommands or not? For each command, does it have flags? Default values? Required values? and many more.

from bashly.

DannyBen avatar DannyBen commented on May 25, 2024

I am closing this for now, the complexity of implementing it does not justify the benefits.

I am still open to be convinced otherwise.

from bashly.

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.