Enhance README

This commit is contained in:
Roman Hotsiy 2017-01-31 12:09:46 +02:00
parent 5bbdc1e2a8
commit c6b1fc8e72
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
7 changed files with 94 additions and 12 deletions

View File

@ -17,15 +17,18 @@
## Features ## Features
- Extremely easy deployment - Extremely easy deployment
- Its free and open-source project under MIT license - The widest OpenAPI features support (yes, it supports even `discriminator`) <br>
- The widest OpenAPI features support (yes, it supports even `discriminator`) ![](docs/images/discriminator-demo.gif)
- Neat **interactive** documentation for nested objects - Neat **interactive** documentation for nested objects <br>
![](docs/images/nested-demo.gif)
<img src="http://i.imgur.com/260gaV4.png" width="500"> - Code samples support (via vendor extension) <br>
![](docs/images/code-samples-demo.gif)
- Code samples support (via vendor extension) - Progressive loading with `lazy-rendering` options <br>
![](docs/images/progressive-loading-demo.gif)
- Responsive three-panel design with menu/scrolling synchronization - Responsive three-panel design with menu/scrolling synchronization
- Integrate API introduction into side menu - ReDoc takes advantage of markdown headings from OpenAPI description field. It pulls them into side menu and also supports deep linking. - Integrate API Introduction into side menu - ReDoc takes advantage of markdown headings from OpenAPI description field. It pulls them into side menu and also supports deep linking.
- High-level grouping in side-menu via [`x-tagGroups`](docs/redoc-vendor-extensions.md#x-tagGroups) vendor extension
- Multiple ReDoc instances on single page ([example](demo/examples/index.html))
## Roadmap ## Roadmap
- [x] performance optimizations - [x] performance optimizations
@ -38,7 +41,7 @@
We host the latest and all the previous ReDoc releases on GitHub Pages-based **CDN**: We host the latest and all the previous ReDoc releases on GitHub Pages-based **CDN**:
- particular release, e.g. `v1.2.0`: https://rebilly.github.io/ReDoc/releases/v1.2.0/redoc.min.js - particular release, e.g. `v1.2.0`: https://rebilly.github.io/ReDoc/releases/v1.2.0/redoc.min.js
- `v1.x.x` release: https://rebilly.github.io/ReDoc/releases/v1.x.x/redoc.min.js - `v1.x.x` release: https://rebilly.github.io/ReDoc/releases/v1.x.x/redoc.min.js
- `latest` release: https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js **[not for production]** - `latest` release: https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js this file is updated with each release of ReDoc and may introduce breaking changes. **Not recommended to use in production.** Use particular release or `v1.x.x`.
## Deployment ## Deployment

View File

@ -0,0 +1,79 @@
<!DOCTYPE html>
<html>
<head>
<title>ReDoc Demo: Multiple apis</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
margin: 0;
padding-top: 40px;
}
nav {
position: fixed;
top: 0;
width: 100%;
z-index: 100;
}
ul#links_container {
margin: 0;
padding: 0;
background-color: #0033a0;
}
li {
display: inline-block;
padding: 10px;
color: white;
cursor: pointer;
}
</style>
</head>
<body>
<!-- Top navigation placeholder -->
<nav>
<ul id="links_container">
</ul>
</nav>
<redoc scroll-y-offset="body > nav"></redoc>
<script src="https://rebilly.github.io/ReDoc/releases/v1.x.x/redoc.min.js"> </script>
<script>
// list of APIS
var apis = [
{
name: 'PetStore',
url: 'https://rebilly.github.io/ReDoc/swagger.yaml'
},
{
name: 'Instagram',
url: 'https://api.apis.guru/v2/specs/instagram.com/1.0.0/swagger.yaml'
},
{
name: 'Google Calendar',
url: 'https://api.apis.guru/v2/specs/googleapis.com/calendar/v3/swagger.yaml'
}
];
// initially render first API
Redoc.init(apis[0].url);
function onClick() {
var url = this.getAttribute('data-link');
Redoc.init(url);
}
// dynamically building navigation items
var $list = document.getElementById('links_container');
apis.forEach(function(api) {
var $listitem = document.createElement('li');
$listitem.setAttribute('data-link', api.url);
$listitem.innerText = api.name;
$listitem.addEventListener('click', onClick);
$list.appendChild($listitem);
});
</script>
</body>
</html>

View File

@ -747,9 +747,6 @@ definitions:
- photoUrls - photoUrls
discriminator: petType discriminator: petType
properties: properties:
petType:
description: Type of a pet
type: string
id: id:
description: Pet ID description: Pet ID
allOf: allOf:
@ -786,6 +783,9 @@ definitions:
- available - available
- pending - pending
- sold - sold
petType:
description: Type of a pet
type: string
xml: xml:
name: Pet name: Pet
Tag: Tag:

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

BIN
docs/images/nested-demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 KiB