Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

idea: JBang Catalog Generator #11

Open
nandorholozsnyak opened this issue Jan 25, 2022 · 6 comments
Open

idea: JBang Catalog Generator #11

nandorholozsnyak opened this issue Jan 25, 2022 · 6 comments

Comments

@nandorholozsnyak
Copy link

In this issue we talked about a JBang catalog generator (jbangdev/jbang#1202) and here is my solution for this one. I'm thinking on where it should be "hosted" or make it available.
https://github.com/nandorholozsnyak/jbang-catalog-doc-generator

@nandorholozsnyak
Copy link
Author

Here is a sneak preview about this repository's jbang-catalog.json

Catalogs

Aliases

hello
Usage: jbang hello [args...]

Script reference: hello.java

Description: Script that says hello back for each argument


properties
Usage: jbang properties [args...]

Script reference: properties.java

Description: Dump table of System properties


env
Usage: jbang env [args...]

Script reference: env.java

Description: Dump table of Environment Variables


gavsearch
Usage: jbang gavsearch [args...]

Script reference: gavsearch.java

Description: gavsearch lets you use search.maven.org from command line.
Example: gavsearch hibernate will search for artifacts with hibernate in its name.
You can use any of the search modifiers search.maven.org supports, i.e.:
gavsearch c:QuarkusTest will search for artifacts with class QuarkusTest


git
Usage: jbang git [args...]

Script reference: jgit.java

Description: Git command line tool implemented with jgit. Lets you do basic git features without installing git!


bouncinglogo
Usage: jbang bouncinglogo [args...]

Script reference: bouncinglogo.java


h2
Usage: jbang h2 [args...]

Script reference: com.h2database:h2:1.4.200

Arguments:

  • -webAllowOthers
  • -tcpAllowOthers

catalog2readme
Usage: jbang catalog2readme [args...]

Script reference: catalog2readme.java


httpd
Usage: jbang httpd [args...]

Script reference: httpd.java

Description: httpd runs a webserver serving out the content of a directory.
Example: jbang httpd@jbangdev -d _site will serve out the _site folder on localhost:8000.


getjava
Usage: jbang getjava [args...]

Script reference: getjava.java

Description: Experimental utility to download Java distributions using api.foojay.io.


Templates

github
Usage: jbang init -t=github script.java [args...]

Description: Simple cli to querying github


File references:


jitpack
Usage: jbang init -t=jitpack script.java [args...]

Description: Initializes a bare-bone jitpack.yml to enable publishing a jbang script as a maven artifact via jitpack.

Example: jbang init -t jitpack@jbangdev myapp.java and then commit this to github and visit jitpack.io to trigger its build.


File references:


junit
Usage: jbang init -t=junit script.java [args...]

Description: Basic template for JUnit tests


File references:


Created with JBang Catalog @ 2022-01-25 21:22

@quintesse
Copy link
Contributor

Good job. The layout can be improved, but that can always be done later 😄

Btw, shouldn't the "Usage" lines show the repo name? Eg. jbang git@jbangdev [args...] instead of jbang git [args...]?

@nandorholozsnyak
Copy link
Author

@quintesse I think you are right. I will change it and I was thinking on to have HTML template as well if you want to host it on somewhere else, but as I said the template is probably the smallest part of it. I just have to document all the keys that could be used in the template.

@quintesse
Copy link
Contributor

The template is not that bad either, but the names are very small which makes them look unimportant. :-)

@quintesse
Copy link
Contributor

quintesse commented Jan 26, 2022

Btw, a cool feature would be to have an index at the start of the doc. (The generator could also generate .adoc files instead of .md, AsciiDoc already has support for automatically creating an index)

@nandorholozsnyak
Copy link
Author

Yeah I was thinking on AsciiDoc template as well. I may create different ones. Would make it more versatile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants