Skip to content

Commit d133f5c

Browse files
committedOct 6, 2017
MOAR DOCS
1 parent f6206d3 commit d133f5c

14 files changed

+303
-117
lines changed
 

‎docs/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
# Swagger-UI
2+
3+
Welcome to the Swagger-UI documentation!
4+
5+
A table of contents can be found at `SUMMARY.md`.

‎docs/SUMMARY.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
- [Version detection](usage/version-detection.md)
88

99
### Customization
10-
- [Plugin API](customization/plugin-api.md)
11-
- [Building an Example Plugin](customization/building-a-plugin.md)
10+
- [Overview](customization/overview.md)
1211
- [Creating a Custom Layout](customization/custom-layout.md)
12+
- [Plugin API](customization/plugin-api.md)
1313

1414
### Development
1515
- [Architecture overview](development/architecture.md)

‎docs/_book/customization/custom-layout.html

+14-14
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@
5757
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
5858

5959

60-
<link rel="next" href="../development/architecture.md" />
60+
<link rel="next" href="plugin-api.html" />
6161

6262

63-
<link rel="prev" href="building-a-plugin.html" />
63+
<link rel="prev" href="overview.html" />
6464

6565

6666
</head>
@@ -174,38 +174,38 @@
174174

175175

176176

177-
<li class="chapter " data-level="3.1" data-path="plugin-api.html">
177+
<li class="chapter " data-level="3.1" data-path="overview.html">
178178

179-
<a href="plugin-api.html">
179+
<a href="overview.html">
180180

181181

182-
Plugin API
182+
Overview
183183

184184
</a>
185185

186186

187187

188188
</li>
189189

190-
<li class="chapter " data-level="3.2" data-path="building-a-plugin.html">
190+
<li class="chapter active" data-level="3.2" data-path="custom-layout.html">
191191

192-
<a href="building-a-plugin.html">
192+
<a href="custom-layout.html">
193193

194194

195-
Building an Example Plugin
195+
Creating a Custom Layout
196196

197197
</a>
198198

199199

200200

201201
</li>
202202

203-
<li class="chapter active" data-level="3.3" data-path="custom-layout.html">
203+
<li class="chapter " data-level="3.3" data-path="plugin-api.html">
204204

205-
<a href="custom-layout.html">
205+
<a href="plugin-api.html">
206206

207207

208-
Creating a Custom Layout
208+
Plugin API
209209

210210
</a>
211211

@@ -331,12 +331,12 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
331331

332332

333333

334-
<a href="building-a-plugin.html" class="navigation navigation-prev " aria-label="Previous page: Building an Example Plugin">
334+
<a href="overview.html" class="navigation navigation-prev " aria-label="Previous page: Overview">
335335
<i class="fa fa-angle-left"></i>
336336
</a>
337337

338338

339-
<a href="../development/architecture.md" class="navigation navigation-next " aria-label="Next page: Architecture overview">
339+
<a href="plugin-api.html" class="navigation navigation-next " aria-label="Next page: Plugin API">
340340
<i class="fa fa-angle-right"></i>
341341
</a>
342342

@@ -347,7 +347,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
347347
<script>
348348
var gitbook = gitbook || [];
349349
gitbook.push(function() {
350-
gitbook.page.hasChanged({"page":{"title":"Creating a Custom Layout","level":"3.3","depth":1,"next":{"title":"Architecture overview","level":"4.1","depth":1,"path":"development/architecture.md","ref":"development/architecture.md","articles":[]},"previous":{"title":"Building an Example Plugin","level":"3.2","depth":1,"path":"customization/building-a-plugin.md","ref":"customization/building-a-plugin.md","articles":[]},"dir":"neutral"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"customization/custom-layout.md","mtime":"2017-10-04T02:18:03.012Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":"..","book":{"language":""}});
350+
gitbook.page.hasChanged({"page":{"title":"Creating a Custom Layout","level":"3.2","depth":1,"next":{"title":"Plugin API","level":"3.3","depth":1,"path":"customization/plugin-api.md","ref":"customization/plugin-api.md","articles":[]},"previous":{"title":"Overview","level":"3.1","depth":1,"path":"customization/overview.md","ref":"customization/overview.md","articles":[]},"dir":"neutral"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"customization/custom-layout.md","mtime":"2017-10-05T23:29:46.881Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":"..","book":{"language":""}});
351351
});
352352
</script>
353353
</div>

‎docs/_book/customization/building-a-plugin.html ‎docs/_book/customization/overview.html

+56-15
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta charset="UTF-8">
66
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
7-
<title>Building an Example Plugin · Swagger-UI</title>
7+
<title>Overview · Swagger-UI</title>
88
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
99
<meta name="description" content="">
1010
<meta name="generator" content="GitBook 3.2.3">
@@ -60,7 +60,7 @@
6060
<link rel="next" href="custom-layout.html" />
6161

6262

63-
<link rel="prev" href="plugin-api.html" />
63+
<link rel="prev" href="../usage/version-detection.html" />
6464

6565

6666
</head>
@@ -174,38 +174,38 @@
174174

175175

176176

177-
<li class="chapter " data-level="3.1" data-path="plugin-api.html">
177+
<li class="chapter active" data-level="3.1" data-path="overview.html">
178178

179-
<a href="plugin-api.html">
179+
<a href="overview.html">
180180

181181

182-
Plugin API
182+
Overview
183183

184184
</a>
185185

186186

187187

188188
</li>
189189

190-
<li class="chapter active" data-level="3.2" data-path="building-a-plugin.html">
190+
<li class="chapter " data-level="3.2" data-path="custom-layout.html">
191191

192-
<a href="building-a-plugin.html">
192+
<a href="custom-layout.html">
193193

194194

195-
Building an Example Plugin
195+
Creating a Custom Layout
196196

197197
</a>
198198

199199

200200

201201
</li>
202202

203-
<li class="chapter " data-level="3.3" data-path="custom-layout.html">
203+
<li class="chapter " data-level="3.3" data-path="plugin-api.html">
204204

205-
<a href="custom-layout.html">
205+
<a href="plugin-api.html">
206206

207207

208-
Creating a Custom Layout
208+
Plugin API
209209

210210
</a>
211211

@@ -289,7 +289,7 @@
289289
<!-- Title -->
290290
<h1>
291291
<i class="fa fa-circle-o-notch fa-spin"></i>
292-
<a href=".." >Building an Example Plugin</a>
292+
<a href=".." >Overview</a>
293293
</h1>
294294
</div>
295295

@@ -304,7 +304,48 @@ <h1>
304304

305305
<section class="normal markdown-section">
306306

307-
307+
<h1 id="plugin-system-overview">Plugin system overview</h1>
308+
<h3 id="prior-art">Prior art</h3>
309+
<p>Swagger-UI leans heavily on concepts and patterns found in React and Redux.</p>
310+
<p>If you aren&apos;t already familiar, here&apos;s some suggested reading:</p>
311+
<ul>
312+
<li><a href="https://reactjs.org/docs/hello-world.html" target="_blank">React: Quick Start</a></li>
313+
<li><a href="http://redux.js.org/" target="_blank">Redux README</a></li>
314+
</ul>
315+
<p>In the following documentation, we won&apos;t take the time to define the fundamentals covered in the resources above.</p>
316+
<h3 id="the-system">The System</h3>
317+
<p>The <em>system</em> is the heart of the Swagger-UI application. At runtime, it&apos;s a JavaScript object that holds many things:</p>
318+
<ul>
319+
<li>React components</li>
320+
<li>Bound Redux actions and reducers</li>
321+
<li>Bound Reselect state selectors</li>
322+
<li>System-wide collection of available components</li>
323+
<li>Built-in helpers like <code>getComponent</code>, <code>makeMappedContainer</code>, and <code>getStore</code></li>
324+
<li>User-defined helper functions</li>
325+
</ul>
326+
<p>The system is built up when Swagger-UI is called by iterating through (&quot;compiling&quot;) each plugin that Swagger-UI has been given, through the <code>presets</code> and <code>plugins</code> configuration options.</p>
327+
<h3 id="presets">Presets</h3>
328+
<p>Presets are arrays of plugins, which are provided to Swagger-UI through the <code>presets</code> configuration option. All plugins within presets are compiled before any plugins provided via the <code>plugins</code> configuration option. Consider the following example:</p>
329+
<pre><code class="lang-javascript">SwaggerUI({
330+
presets: [
331+
[FirstPlugin, SecondPlugin],
332+
[ThirdPlugin, FourthPlugin]
333+
],
334+
plugins: [
335+
FifthPlugin,
336+
SixthPlugin
337+
]
338+
})
339+
</code></pre>
340+
<p>By default, Swagger-UI includes the internal <code>ApisPreset</code>, which contains a set of plugins that provide baseline functionality for Swagger-UI. If you specify your own <code>presets</code> option, you need to add the ApisPreset manually, like so:</p>
341+
<pre><code class="lang-javascript">SwaggerUI({
342+
presets: [
343+
SwaggerUI.presets.apis,
344+
MyAmazingCustomPreset
345+
]
346+
})
347+
</code></pre>
348+
308349

309350
</section>
310351

@@ -331,7 +372,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
331372

332373

333374

334-
<a href="plugin-api.html" class="navigation navigation-prev " aria-label="Previous page: Plugin API">
375+
<a href="../usage/version-detection.html" class="navigation navigation-prev " aria-label="Previous page: Version detection">
335376
<i class="fa fa-angle-left"></i>
336377
</a>
337378

@@ -347,7 +388,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
347388
<script>
348389
var gitbook = gitbook || [];
349390
gitbook.push(function() {
350-
gitbook.page.hasChanged({"page":{"title":"Building an Example Plugin","level":"3.2","depth":1,"next":{"title":"Creating a Custom Layout","level":"3.3","depth":1,"path":"customization/custom-layout.md","ref":"customization/custom-layout.md","articles":[]},"previous":{"title":"Plugin API","level":"3.1","depth":1,"path":"customization/plugin-api.md","ref":"customization/plugin-api.md","articles":[]},"dir":"neutral"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"customization/building-a-plugin.md","mtime":"2017-10-04T02:17:32.392Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":"..","book":{"language":""}});
391+
gitbook.page.hasChanged({"page":{"title":"Overview","level":"3.1","depth":1,"next":{"title":"Creating a Custom Layout","level":"3.2","depth":1,"path":"customization/custom-layout.md","ref":"customization/custom-layout.md","articles":[]},"previous":{"title":"Version detection","level":"2.3","depth":1,"path":"usage/version-detection.md","ref":"usage/version-detection.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"customization/overview.md","mtime":"2017-10-06T07:15:00.038Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":"..","book":{"language":""}});
351392
});
352393
</script>
353394
</div>

‎docs/_book/customization/plugin-api.html

+61-24
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@
5757
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
5858

5959

60-
<link rel="next" href="building-a-plugin.html" />
60+
<link rel="next" href="../development/architecture.md" />
6161

6262

63-
<link rel="prev" href="../usage/version-detection.html" />
63+
<link rel="prev" href="custom-layout.html" />
6464

6565

6666
</head>
@@ -174,38 +174,38 @@
174174

175175

176176

177-
<li class="chapter active" data-level="3.1" data-path="plugin-api.html">
177+
<li class="chapter " data-level="3.1" data-path="overview.html">
178178

179-
<a href="plugin-api.html">
179+
<a href="overview.html">
180180

181181

182-
Plugin API
182+
Overview
183183

184184
</a>
185185

186186

187187

188188
</li>
189189

190-
<li class="chapter " data-level="3.2" data-path="building-a-plugin.html">
190+
<li class="chapter " data-level="3.2" data-path="custom-layout.html">
191191

192-
<a href="building-a-plugin.html">
192+
<a href="custom-layout.html">
193193

194194

195-
Building an Example Plugin
195+
Creating a Custom Layout
196196

197197
</a>
198198

199199

200200

201201
</li>
202202

203-
<li class="chapter " data-level="3.3" data-path="custom-layout.html">
203+
<li class="chapter active" data-level="3.3" data-path="plugin-api.html">
204204

205-
<a href="custom-layout.html">
205+
<a href="plugin-api.html">
206206

207207

208-
Creating a Custom Layout
208+
Plugin API
209209

210210
</a>
211211

@@ -304,36 +304,73 @@ <h1>
304304

305305
<section class="normal markdown-section">
306306

307-
<h1 id="plugin-api">Plugin API</h1>
308-
<p>A plugin is an object that contains functions and components capable of modifying and augmenting Swagger-UI&apos;s functionality.</p>
307+
<h1 id="plugins">Plugins</h1>
308+
<p>A plugin is a function that returns an object - more specifically, the object may contain functions and components that augment and modify Swagger-UI&apos;s functionality.</p>
309309
<h3 id="format">Format</h3>
310-
<p>A plugin may contain any or all of these keys:</p>
311-
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> MyPlugin = {
310+
<p>A plugin return value may contain any of these keys, where <code>myStateKey</code> is a name for a piece of state:</p>
311+
<pre><code class="lang-javascript">{
312312
statePlugins: {
313-
anyStateKey: {
313+
myStateKey: {
314314
actions,
315315
reducers,
316316
selectors,
317317
wrapActions,
318318
wrapSelectors
319319
}
320320
},
321-
components: {
322-
323-
},
324-
wrapComponents: {
325-
321+
components: {},
322+
wrapComponents: {},
323+
fn: {}
324+
}
325+
</code></pre>
326+
<h3 id="inputs">Inputs</h3>
327+
<p>Let&apos;s assume we have a plugin, <code>NormalPlugin</code>, that exposes a <code>doStuff</code> action under the <code>normal</code> state namespace.</p>
328+
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> ExtendingPlugin = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">system</span>) </span>{
329+
<span class="hljs-keyword">return</span> {
330+
statePlugins: {
331+
extending: {
332+
actions: {
333+
doExtendedThings: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">...args</span>) </span>{
334+
<span class="hljs-comment">// you can do other things in here if you want</span>
335+
<span class="hljs-keyword">return</span> system.normalActions.doStuff(...args)
336+
}
337+
}
338+
}
339+
}
326340
}
327341
}
328342
</code></pre>
343+
<p>As you can see, each plugin is passed a reference to the <code>system</code> being built up. As long as <code>NormalPlugin</code> is compiled before <code>ExtendingPlugin</code>, this will work without any issues.</p>
344+
<p>There is no dependency management built into the plugin system, so if you create a plugin that relies on another, it is your responsibility to make sure that the dependent plugin is loaded <em>after</em> the plugin being depended on.</p>
329345
<h3 id="interfaces">Interfaces</h3>
330346
<h5 id="actions">Actions</h5>
347+
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> MyActionPlugin = () =&gt; {
348+
<span class="hljs-keyword">return</span> {
349+
statePlugins: {
350+
example: {
351+
actions: {
352+
updateFavoriteColor: (str) =&gt; {
353+
<span class="hljs-keyword">return</span> {
354+
type: <span class="hljs-string">&quot;EXAMPLE_SET_FAV_COLOR&quot;</span>,
355+
payload: str
356+
}
357+
}
358+
}
359+
}
360+
}
361+
}
362+
}
363+
</code></pre>
364+
<p>The Action interface enables the creation of new Redux action creators within a piece of state in the Swagger-UI system.</p>
365+
<p>This action creator function will be bound to the <code>example</code> reducer dispatcher and exposed to container components as <code>exampleActions.updateFavoriteColor</code>.</p>
366+
<p>For more information about the concept of actions in Redux, see the <a href="http://redux.js.org/docs/basics/Actions.html" target="_blank">Redux Actions documentation</a>.</p>
331367
<h5 id="reducers">Reducers</h5>
332368
<h5 id="selectors">Selectors</h5>
333369
<h5 id="components">Components</h5>
334370
<h5 id="wrap-actions">Wrap-Actions</h5>
335371
<h5 id="wrap-selectors">Wrap-Selectors</h5>
336372
<h5 id="wrap-components">Wrap-Components</h5>
373+
<h5 id="fn">fn</h5>
337374

338375

339376
</section>
@@ -361,12 +398,12 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
361398

362399

363400

364-
<a href="../usage/version-detection.html" class="navigation navigation-prev " aria-label="Previous page: Version detection">
401+
<a href="custom-layout.html" class="navigation navigation-prev " aria-label="Previous page: Creating a Custom Layout">
365402
<i class="fa fa-angle-left"></i>
366403
</a>
367404

368405

369-
<a href="building-a-plugin.html" class="navigation navigation-next " aria-label="Next page: Building an Example Plugin">
406+
<a href="../development/architecture.md" class="navigation navigation-next " aria-label="Next page: Architecture overview">
370407
<i class="fa fa-angle-right"></i>
371408
</a>
372409

@@ -377,7 +414,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
377414
<script>
378415
var gitbook = gitbook || [];
379416
gitbook.push(function() {
380-
gitbook.page.hasChanged({"page":{"title":"Plugin API","level":"3.1","depth":1,"next":{"title":"Building an Example Plugin","level":"3.2","depth":1,"path":"customization/building-a-plugin.md","ref":"customization/building-a-plugin.md","articles":[]},"previous":{"title":"Version detection","level":"2.3","depth":1,"path":"usage/version-detection.md","ref":"usage/version-detection.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"customization/plugin-api.md","mtime":"2017-10-04T02:39:02.825Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":"..","book":{"language":""}});
417+
gitbook.page.hasChanged({"page":{"title":"Plugin API","level":"3.3","depth":1,"next":{"title":"Architecture overview","level":"4.1","depth":1,"path":"development/architecture.md","ref":"development/architecture.md","articles":[]},"previous":{"title":"Creating a Custom Layout","level":"3.2","depth":1,"path":"customization/custom-layout.md","ref":"customization/custom-layout.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"customization/plugin-api.md","mtime":"2017-10-06T07:38:26.729Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":"..","book":{"language":""}});
381418
});
382419
</script>
383420
</div>

‎docs/_book/index.html

+12-10
Original file line numberDiff line numberDiff line change
@@ -172,38 +172,38 @@
172172

173173

174174

175-
<li class="chapter " data-level="3.1" data-path="customization/plugin-api.html">
175+
<li class="chapter " data-level="3.1" data-path="customization/overview.html">
176176

177-
<a href="customization/plugin-api.html">
177+
<a href="customization/overview.html">
178178

179179

180-
Plugin API
180+
Overview
181181

182182
</a>
183183

184184

185185

186186
</li>
187187

188-
<li class="chapter " data-level="3.2" data-path="customization/building-a-plugin.html">
188+
<li class="chapter " data-level="3.2" data-path="customization/custom-layout.html">
189189

190-
<a href="customization/building-a-plugin.html">
190+
<a href="customization/custom-layout.html">
191191

192192

193-
Building an Example Plugin
193+
Creating a Custom Layout
194194

195195
</a>
196196

197197

198198

199199
</li>
200200

201-
<li class="chapter " data-level="3.3" data-path="customization/custom-layout.html">
201+
<li class="chapter " data-level="3.3" data-path="customization/plugin-api.html">
202202

203-
<a href="customization/custom-layout.html">
203+
<a href="customization/plugin-api.html">
204204

205205

206-
Creating a Custom Layout
206+
Plugin API
207207

208208
</a>
209209

@@ -303,6 +303,8 @@ <h1>
303303
<section class="normal markdown-section">
304304

305305
<h1 id="swagger-ui">Swagger-UI</h1>
306+
<p>Welcome to the Swagger-UI documentation!</p>
307+
<p>A table of contents can be found at <code>SUMMARY.md</code>.</p>
306308

307309

308310
</section>
@@ -342,7 +344,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
342344
<script>
343345
var gitbook = gitbook || [];
344346
gitbook.push(function() {
345-
gitbook.page.hasChanged({"page":{"title":"Intro","level":"1.1","depth":1,"next":{"title":"Installation","level":"2.1","depth":1,"path":"usage/installation.md","ref":"usage/installation.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"README.md","mtime":"2017-10-04T01:10:54.324Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":".","book":{"language":""}});
347+
gitbook.page.hasChanged({"page":{"title":"Intro","level":"1.1","depth":1,"next":{"title":"Installation","level":"2.1","depth":1,"path":"usage/installation.md","ref":"usage/installation.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"README.md","mtime":"2017-10-06T04:31:48.558Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":".","book":{"language":""}});
346348
});
347349
</script>
348350
</div>

‎docs/_book/search_index.json

+1-1
Large diffs are not rendered by default.

‎docs/_book/usage/configuration.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -174,38 +174,38 @@
174174

175175

176176

177-
<li class="chapter " data-level="3.1" data-path="../customization/plugin-api.html">
177+
<li class="chapter " data-level="3.1" data-path="../customization/overview.html">
178178

179-
<a href="../customization/plugin-api.html">
179+
<a href="../customization/overview.html">
180180

181181

182-
Plugin API
182+
Overview
183183

184184
</a>
185185

186186

187187

188188
</li>
189189

190-
<li class="chapter " data-level="3.2" data-path="../customization/building-a-plugin.html">
190+
<li class="chapter " data-level="3.2" data-path="../customization/custom-layout.html">
191191

192-
<a href="../customization/building-a-plugin.html">
192+
<a href="../customization/custom-layout.html">
193193

194194

195-
Building an Example Plugin
195+
Creating a Custom Layout
196196

197197
</a>
198198

199199

200200

201201
</li>
202202

203-
<li class="chapter " data-level="3.3" data-path="../customization/custom-layout.html">
203+
<li class="chapter " data-level="3.3" data-path="../customization/plugin-api.html">
204204

205-
<a href="../customization/custom-layout.html">
205+
<a href="../customization/plugin-api.html">
206206

207207

208-
Creating a Custom Layout
208+
Plugin API
209209

210210
</a>
211211

@@ -455,7 +455,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
455455
<script>
456456
var gitbook = gitbook || [];
457457
gitbook.push(function() {
458-
gitbook.page.hasChanged({"page":{"title":"Configuration","level":"2.2","depth":1,"next":{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]},"previous":{"title":"Installation","level":"2.1","depth":1,"path":"usage/installation.md","ref":"usage/installation.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/configuration.md","mtime":"2017-10-04T02:48:05.530Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":"..","book":{"language":""}});
458+
gitbook.page.hasChanged({"page":{"title":"Configuration","level":"2.2","depth":1,"next":{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]},"previous":{"title":"Installation","level":"2.1","depth":1,"path":"usage/installation.md","ref":"usage/installation.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/configuration.md","mtime":"2017-10-05T23:29:46.882Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":"..","book":{"language":""}});
459459
});
460460
</script>
461461
</div>

‎docs/_book/usage/deep-linking.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -174,38 +174,38 @@
174174

175175

176176

177-
<li class="chapter " data-level="3.1" data-path="../customization/plugin-api.html">
177+
<li class="chapter " data-level="3.1" data-path="../customization/overview.html">
178178

179-
<a href="../customization/plugin-api.html">
179+
<a href="../customization/overview.html">
180180

181181

182-
Plugin API
182+
Overview
183183

184184
</a>
185185

186186

187187

188188
</li>
189189

190-
<li class="chapter " data-level="3.2" data-path="../customization/building-a-plugin.html">
190+
<li class="chapter " data-level="3.2" data-path="../customization/custom-layout.html">
191191

192-
<a href="../customization/building-a-plugin.html">
192+
<a href="../customization/custom-layout.html">
193193

194194

195-
Building an Example Plugin
195+
Creating a Custom Layout
196196

197197
</a>
198198

199199

200200

201201
</li>
202202

203-
<li class="chapter " data-level="3.3" data-path="../customization/custom-layout.html">
203+
<li class="chapter " data-level="3.3" data-path="../customization/plugin-api.html">
204204

205-
<a href="../customization/custom-layout.html">
205+
<a href="../customization/plugin-api.html">
206206

207207

208-
Creating a Custom Layout
208+
Plugin API
209209

210210
</a>
211211

@@ -375,7 +375,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
375375
<script>
376376
var gitbook = gitbook || [];
377377
gitbook.push(function() {
378-
gitbook.page.hasChanged({"page":{"title":"deepLinking","level":"2.2.1","depth":2,"next":{"title":"Version detection","level":"2.3","depth":1,"path":"usage/version-detection.md","ref":"usage/version-detection.md","articles":[]},"previous":{"title":"Configuration","level":"2.2","depth":1,"path":"usage/configuration.md","ref":"usage/configuration.md","articles":[{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/deep-linking.md","mtime":"2017-10-04T02:49:05.275Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":"..","book":{"language":""}});
378+
gitbook.page.hasChanged({"page":{"title":"deepLinking","level":"2.2.1","depth":2,"next":{"title":"Version detection","level":"2.3","depth":1,"path":"usage/version-detection.md","ref":"usage/version-detection.md","articles":[]},"previous":{"title":"Configuration","level":"2.2","depth":1,"path":"usage/configuration.md","ref":"usage/configuration.md","articles":[{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/deep-linking.md","mtime":"2017-10-05T23:29:46.882Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":"..","book":{"language":""}});
379379
});
380380
</script>
381381
</div>

‎docs/_book/usage/installation.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -174,38 +174,38 @@
174174

175175

176176

177-
<li class="chapter " data-level="3.1" data-path="../customization/plugin-api.html">
177+
<li class="chapter " data-level="3.1" data-path="../customization/overview.html">
178178

179-
<a href="../customization/plugin-api.html">
179+
<a href="../customization/overview.html">
180180

181181

182-
Plugin API
182+
Overview
183183

184184
</a>
185185

186186

187187

188188
</li>
189189

190-
<li class="chapter " data-level="3.2" data-path="../customization/building-a-plugin.html">
190+
<li class="chapter " data-level="3.2" data-path="../customization/custom-layout.html">
191191

192-
<a href="../customization/building-a-plugin.html">
192+
<a href="../customization/custom-layout.html">
193193

194194

195-
Building an Example Plugin
195+
Creating a Custom Layout
196196

197197
</a>
198198

199199

200200

201201
</li>
202202

203-
<li class="chapter " data-level="3.3" data-path="../customization/custom-layout.html">
203+
<li class="chapter " data-level="3.3" data-path="../customization/plugin-api.html">
204204

205-
<a href="../customization/custom-layout.html">
205+
<a href="../customization/plugin-api.html">
206206

207207

208-
Creating a Custom Layout
208+
Plugin API
209209

210210
</a>
211211

@@ -376,7 +376,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
376376
<script>
377377
var gitbook = gitbook || [];
378378
gitbook.push(function() {
379-
gitbook.page.hasChanged({"page":{"title":"Installation","level":"2.1","depth":1,"next":{"title":"Configuration","level":"2.2","depth":1,"path":"usage/configuration.md","ref":"usage/configuration.md","articles":[{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]}]},"previous":{"title":"Intro","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/installation.md","mtime":"2017-10-04T03:40:57.425Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":"..","book":{"language":""}});
379+
gitbook.page.hasChanged({"page":{"title":"Installation","level":"2.1","depth":1,"next":{"title":"Configuration","level":"2.2","depth":1,"path":"usage/configuration.md","ref":"usage/configuration.md","articles":[{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]}]},"previous":{"title":"Intro","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/installation.md","mtime":"2017-10-05T23:29:46.882Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":"..","book":{"language":""}});
380380
});
381381
</script>
382382
</div>

‎docs/_book/usage/version-detection.html

+12-12
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
5858

5959

60-
<link rel="next" href="../customization/plugin-api.html" />
60+
<link rel="next" href="../customization/overview.html" />
6161

6262

6363
<link rel="prev" href="deep-linking.html" />
@@ -174,38 +174,38 @@
174174

175175

176176

177-
<li class="chapter " data-level="3.1" data-path="../customization/plugin-api.html">
177+
<li class="chapter " data-level="3.1" data-path="../customization/overview.html">
178178

179-
<a href="../customization/plugin-api.html">
179+
<a href="../customization/overview.html">
180180

181181

182-
Plugin API
182+
Overview
183183

184184
</a>
185185

186186

187187

188188
</li>
189189

190-
<li class="chapter " data-level="3.2" data-path="../customization/building-a-plugin.html">
190+
<li class="chapter " data-level="3.2" data-path="../customization/custom-layout.html">
191191

192-
<a href="../customization/building-a-plugin.html">
192+
<a href="../customization/custom-layout.html">
193193

194194

195-
Building an Example Plugin
195+
Creating a Custom Layout
196196

197197
</a>
198198

199199

200200

201201
</li>
202202

203-
<li class="chapter " data-level="3.3" data-path="../customization/custom-layout.html">
203+
<li class="chapter " data-level="3.3" data-path="../customization/plugin-api.html">
204204

205-
<a href="../customization/custom-layout.html">
205+
<a href="../customization/plugin-api.html">
206206

207207

208-
Creating a Custom Layout
208+
Plugin API
209209

210210
</a>
211211

@@ -381,7 +381,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
381381
</a>
382382

383383

384-
<a href="../customization/plugin-api.html" class="navigation navigation-next " aria-label="Next page: Plugin API">
384+
<a href="../customization/overview.html" class="navigation navigation-next " aria-label="Next page: Overview">
385385
<i class="fa fa-angle-right"></i>
386386
</a>
387387

@@ -392,7 +392,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
392392
<script>
393393
var gitbook = gitbook || [];
394394
gitbook.push(function() {
395-
gitbook.page.hasChanged({"page":{"title":"Version detection","level":"2.3","depth":1,"next":{"title":"Plugin API","level":"3.1","depth":1,"path":"customization/plugin-api.md","ref":"customization/plugin-api.md","articles":[]},"previous":{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/version-detection.md","mtime":"2017-10-04T01:13:44.192Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-04T01:43:58.838Z"},"basePath":"..","book":{"language":""}});
395+
gitbook.page.hasChanged({"page":{"title":"Version detection","level":"2.3","depth":1,"next":{"title":"Overview","level":"3.1","depth":1,"path":"customization/overview.md","ref":"customization/overview.md","articles":[]},"previous":{"title":"deepLinking","level":"2.2.1","depth":2,"path":"usage/deep-linking.md","ref":"usage/deep-linking.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Swagger-UI","gitbook":"*"},"file":{"path":"usage/version-detection.md","mtime":"2017-10-05T23:29:46.883Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-10-06T04:20:18.617Z"},"basePath":"..","book":{"language":""}});
396396
});
397397
</script>
398398
</div>

‎docs/customization/building-a-plugin.md

Whitespace-only changes.

‎docs/customization/overview.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Plugin system overview
2+
3+
### Prior art
4+
5+
Swagger-UI leans heavily on concepts and patterns found in React and Redux.
6+
7+
If you aren't already familiar, here's some suggested reading:
8+
9+
- [React: Quick Start](https://reactjs.org/docs/hello-world.html)
10+
- [Redux README](http://redux.js.org/)
11+
12+
In the following documentation, we won't take the time to define the fundamentals covered in the resources above.
13+
14+
### The System
15+
16+
The _system_ is the heart of the Swagger-UI application. At runtime, it's a JavaScript object that holds many things:
17+
18+
- React components
19+
- Bound Redux actions and reducers
20+
- Bound Reselect state selectors
21+
- System-wide collection of available components
22+
- Built-in helpers like `getComponent`, `makeMappedContainer`, and `getStore`
23+
- User-defined helper functions
24+
25+
The system is built up when Swagger-UI is called by iterating through ("compiling") each plugin that Swagger-UI has been given, through the `presets` and `plugins` configuration options.
26+
27+
### Presets
28+
29+
Presets are arrays of plugins, which are provided to Swagger-UI through the `presets` configuration option. All plugins within presets are compiled before any plugins provided via the `plugins` configuration option. Consider the following example:
30+
31+
```javascript
32+
SwaggerUI({
33+
presets: [
34+
[FirstPlugin, SecondPlugin],
35+
[ThirdPlugin, FourthPlugin]
36+
],
37+
plugins: [
38+
FifthPlugin,
39+
SixthPlugin
40+
]
41+
})
42+
```
43+
44+
By default, Swagger-UI includes the internal `ApisPreset`, which contains a set of plugins that provide baseline functionality for Swagger-UI. If you specify your own `presets` option, you need to add the ApisPreset manually, like so:
45+
46+
```javascript
47+
SwaggerUI({
48+
presets: [
49+
SwaggerUI.presets.apis,
50+
MyAmazingCustomPreset
51+
]
52+
})
53+
```

‎docs/customization/plugin-api.md

+58-9
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,82 @@
1-
# Plugin API
1+
# Plugins
22

3-
A plugin is an object that contains functions and components capable of modifying and augmenting Swagger-UI's functionality.
3+
A plugin is a function that returns an object - more specifically, the object may contain functions and components that augment and modify Swagger-UI's functionality.
44

55
### Format
66

7-
A plugin may contain any or all of these keys:
7+
A plugin return value may contain any of these keys, where `myStateKey` is a name for a piece of state:
88

99
```javascript
10-
const MyPlugin = {
10+
{
1111
statePlugins: {
12-
anyStateKey: {
12+
myStateKey: {
1313
actions,
1414
reducers,
1515
selectors,
1616
wrapActions,
1717
wrapSelectors
1818
}
1919
},
20-
components: {
20+
components: {},
21+
wrapComponents: {},
22+
fn: {}
23+
}
24+
```
2125

22-
},
23-
wrapComponents: {
24-
26+
### Inputs
27+
28+
Let's assume we have a plugin, `NormalPlugin`, that exposes a `doStuff` action under the `normal` state namespace.
29+
30+
```javascript
31+
const ExtendingPlugin = function(system) {
32+
return {
33+
statePlugins: {
34+
extending: {
35+
actions: {
36+
doExtendedThings: function(...args) {
37+
// you can do other things in here if you want
38+
return system.normalActions.doStuff(...args)
39+
}
40+
}
41+
}
42+
}
2543
}
2644
}
2745
```
2846

47+
As you can see, each plugin is passed a reference to the `system` being built up. As long as `NormalPlugin` is compiled before `ExtendingPlugin`, this will work without any issues.
48+
49+
There is no dependency management built into the plugin system, so if you create a plugin that relies on another, it is your responsibility to make sure that the dependent plugin is loaded _after_ the plugin being depended on.
50+
2951
### Interfaces
3052

3153
##### Actions
3254

55+
```javascript
56+
const MyActionPlugin = () => {
57+
return {
58+
statePlugins: {
59+
example: {
60+
actions: {
61+
updateFavoriteColor: (str) => {
62+
return {
63+
type: "EXAMPLE_SET_FAV_COLOR",
64+
payload: str
65+
}
66+
}
67+
}
68+
}
69+
}
70+
}
71+
}
72+
```
73+
74+
The Action interface enables the creation of new Redux action creators within a piece of state in the Swagger-UI system.
75+
76+
This action creator function will be bound to the `example` reducer dispatcher and exposed to container components as `exampleActions.updateFavoriteColor`.
77+
78+
For more information about the concept of actions in Redux, see the [Redux Actions documentation](http://redux.js.org/docs/basics/Actions.html).
79+
3380
##### Reducers
3481

3582
##### Selectors
@@ -41,3 +88,5 @@ const MyPlugin = {
4188
##### Wrap-Selectors
4289

4390
##### Wrap-Components
91+
92+
##### fn

0 commit comments

Comments
 (0)
Please sign in to comment.