mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 01:54:08 +03:00
Enhance README
This commit is contained in:
parent
5bbdc1e2a8
commit
c6b1fc8e72
21
README.md
21
README.md
|
@ -17,15 +17,18 @@
|
|||
|
||||
## Features
|
||||
- Extremely easy deployment
|
||||
- It’s free and open-source project under MIT license
|
||||
- The widest OpenAPI features support (yes, it supports even `discriminator`)
|
||||
- Neat **interactive** documentation for nested objects
|
||||
|
||||
<img src="http://i.imgur.com/260gaV4.png" width="500">
|
||||
|
||||
- Code samples support (via vendor extension)
|
||||
- The widest OpenAPI features support (yes, it supports even `discriminator`) <br>
|
||||
![](docs/images/discriminator-demo.gif)
|
||||
- Neat **interactive** documentation for nested objects <br>
|
||||
![](docs/images/nested-demo.gif)
|
||||
- Code samples support (via vendor extension) <br>
|
||||
![](docs/images/code-samples-demo.gif)
|
||||
- Progressive loading with `lazy-rendering` options <br>
|
||||
![](docs/images/progressive-loading-demo.gif)
|
||||
- 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
|
||||
- [x] performance optimizations
|
||||
|
@ -38,7 +41,7 @@
|
|||
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
|
||||
- `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
|
||||
|
||||
|
|
79
demo/examples/multiple-apis/index.html
Normal file
79
demo/examples/multiple-apis/index.html
Normal 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>
|
|
@ -747,9 +747,6 @@ definitions:
|
|||
- photoUrls
|
||||
discriminator: petType
|
||||
properties:
|
||||
petType:
|
||||
description: Type of a pet
|
||||
type: string
|
||||
id:
|
||||
description: Pet ID
|
||||
allOf:
|
||||
|
@ -786,6 +783,9 @@ definitions:
|
|||
- available
|
||||
- pending
|
||||
- sold
|
||||
petType:
|
||||
description: Type of a pet
|
||||
type: string
|
||||
xml:
|
||||
name: Pet
|
||||
Tag:
|
||||
|
|
BIN
docs/images/code-samples-demo.gif
Normal file
BIN
docs/images/code-samples-demo.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 738 KiB |
BIN
docs/images/discriminator-demo.gif
Normal file
BIN
docs/images/discriminator-demo.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 263 KiB |
BIN
docs/images/nested-demo.gif
Normal file
BIN
docs/images/nested-demo.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 469 KiB |
BIN
docs/images/progressive-loading-demo.gif
Normal file
BIN
docs/images/progressive-loading-demo.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 510 KiB |
Loading…
Reference in New Issue
Block a user