Giter Site home page Giter Site logo

pearmaster / generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from asyncapi/generator

0.0 0.0 0.0 587 KB

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

License: Apache License 2.0

JavaScript 47.96% HTML 36.19% CSS 3.71% Java 11.00% Dockerfile 0.63% Shell 0.37% Makefile 0.13%

generator's Introduction

AsyncAPI Generator

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



⚠️ 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 use all the commands below using Docker by replacing ag in all the commands below with:

docker run --rm -it -v $PWD:/app -w /app asyncapi/generator [COMMAND HERE]

Usage

From the command-line interface (CLI)

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


  Options:

    -V, --version                  output the version number
    -o, --output <outputDir>       directory where to put the generated files (defaults to current directory) (default: /Users/fmvilas/www/asyncapi-generator)
    -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) (default: null)
    -h, --help                     output usage information

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.

Requirements

  • Node.js v8.5+

Contributing

Contributions are more than welcome. If you want to make a contribution, 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 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)

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.