GithubHelp home page GithubHelp logo

damaru-inc / generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from asyncapi/generator

0.0 2.0 0.0 1013 KB

Use your AsyncAPI definition to generate literally anything. Markdown documentation, Node.js code, HTML documentation, anything!

License: Apache License 2.0

JavaScript 55.73% HTML 31.63% CSS 3.01% Java 8.63% Dockerfile 0.63% Shell 0.28% Makefile 0.09%

generator's Introduction

AsyncAPI Generator

Use your AsyncAPI definition to generate literally anything. Markdown documentation, Node.js code, HTML documentation, anything!

npm npm



⚠️ This package doesn't support AsyncAPI 1.x anymore. We recommend to upgrade to the latest AsyncAPI version using the AsyncAPI converter. If you need to convert documents on the fly, you may use the Node.js or Go converters.

Install

npm install -g asyncapi-generator

Or just use Docker:

docker run --rm -it \
-v [ASYNCAPI FILE LOCATION]:/app/asyncapi.yml \
-v [GENERATED FILES LOCATION]:/app/output \
asyncapi/generator [COMMAND HERE]
# Example that you can run inside generator directory after cloning this repository. First you specify mount in location of your AsyncAPI file and then you mount in directory where generation result should be saved.
docker run --rm -it \
-v ${PWD}/test/docs/streetlights.yml:/app/asyncapi.yml \
-v ${PWD}/output:/app/output \
asyncapi/generator -o ./output asyncapi.yml markdown

Usage

From the command-line interface (CLI)

  Usage: ag [options] <asyncapi> <template>


  Options:

    -V, --version                  output the version number
    -w, --watch                    watches the templates directory and the AsyncAPI document for changes, and re-generate the files when they occur
    -o, --output <outputDir>       directory where to put the generated files (defaults to current directory)
    -d, --disable-hook <hookName>  disable a specific hook
    -n, --no-overwrite <glob>      glob or path of the file(s) to skip when regenerating
    -p, --param <name=value>       additional param to pass to templates
    -t, --templates <templateDir>  directory where templates are located (defaults to internal templates directory)
    --force-install                forces the installation of the template dependencies. By default, dependencies are installed and this flag is taken into account only if `node_modules` is not in place.
    -h, --help                     output usage information
    --force-write                  force writing of the generated files to given directory even if it is a git repo with unstaged files or not empty dir (defaults to false)

Please check out the templates directory to get a list of the supported languages/formats.

Examples

The shortest possible syntax:

ag asyncapi.yaml markdown

Specify where to put the result:

ag -o ./docs asyncapi.yaml markdown

Passing parameters to templates:

ag -o ./docs --param title='Hello from param' asyncapi.yaml markdown

In the template you can use it like this: {{ params.title }}

As a module

See API documentation.

Authoring templates

See authoring templates and the list of templates recipes.

Requirements

  • Node.js v8.5+

Contributing

Contributions are more than welcome. If you want to contribute, please make sure you go through the following steps:

  1. Pick or create an issue. It's always a good idea to leave a message saying that you're going to work on it before you start any actual work.
  2. Fork the repository and work there.
  3. Open a Pull Request pointing to the master branch.
  4. A maintainer will review and, eventually, merge your Pull Request. Please, be patient as most of us are doing this in our spare time.

Author

Fran Méndez (@fmvilas)

generator's People

Contributors

csimi avatar damaru-inc avatar dependabot[bot] avatar derberg avatar fmvilas avatar giannicoene avatar joaoritter avatar jonaslagoni avatar jorge07 avatar laat avatar m-mohr avatar marcortw avatar mikeralphson avatar netoec84 avatar rmelian avatar rogelio-o avatar simonalbrecht avatar stefanseeger avatar tdietmaier avatar treeder avatar waleedashraf avatar yli-cpr avatar

Watchers

 avatar  avatar

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.