npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

swagger2aglio

v1.2.16

Published

Swagger API Documentation HTML Generator

Downloads

580

Readme

Swagger to Aglio API Documentation

Build Status Coverage Status Code Climate npm version Dependency Status devDependency Status semantic-release

Swagger2Aglio is a REST API documentation generator. It converts a Swagger API description into the API Blueprint format and then to Aglio documentation. The final output is a single static HTML page, easily served from any webserver.

Currently supports Swagger version 2.0.

Example Output

Three column streak theme screenshot:

Three column streak theme screenshot

Example output is generated from the IBM Watson API

Installation and Usage

There are two ways to use swagger2aglio: as an executable or as a library for Node.js.

Executable

Install swagger2aglio via NPM. You need Node.js installed.

npm install -g swagger2aglio

Then, start generating HTML.

# Default theme
swagger2aglio -i input.yml -o output.html

# Use three-column layout
swagger2aglio -i input.yml --theme-template triple -o output.html

# Built-in color scheme
swagger2aglio --theme-variables slate -i input.yml -o output.html

# Customize a built-in style
swagger2aglio --theme-style default --theme-style ./my-style.less -i input.yml -o output.html

Node.js Library

You can also use swagger2aglio as a library. First, install and save it as a dependency:

npm install --save swagger2aglio

Then, convert some Swagger to HTML:

var swagger2aglio = require('swagger2aglio');
var options = {
  input: './petstore_expanded.yml',
  themeVariables: 'default'
}
swagger2aglio.convert(options, function (err, html) {
    if (err) return console.log(err);

    console.log(html);
});

Reference

swagger2aglio.convert (options, callback)

Render a Swagger file to HTML. Available options are:

| Option | Type | Default | Description | | ----------- | ------- | ------------- | ------------------------------------- | | input | string | | The input Swagger definition file | | theme | string | 'default' | Theme name to load for rendering | | noMinify | boolean | false | If false, does not minify output |

In addition, the default theme provides the following options:

| Option | Type | Default | Description | | ---------------- | ------ | --------- | -------------------------------------------- | | themeVariables | string | default | Built-in color scheme or path to LESS or CSS | | themeCondenseNav | bool | true | Condense single-action navigation links | | themeFullWidth | bool | false | Use the full page width | | themeTemplate | string | | Layout name or path to custom layout file | | themeStyle | string | default | Built-in style name or path to LESS or CSS |

Development

For development, first clone the repository. Then install dependencies:

npm install

To start the development hot reload server, run:

npm run start

Then, in a browser go to http://localhost:3000 and select an example. Changes made to any of the Jade templates will be automatically reloaded and displayed in the browser.

License

Copyright (c) 2016 Paul Sastrasinh