mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
openapi: replace implementation with swagger-ui #523
This commit is contained in:
parent
aca602724d
commit
06d35bbbdb
44 changed files with 4071 additions and 4199 deletions
|
@ -56,7 +56,7 @@ The Relearn theme is a fork of the great [Learn theme](https://github.com/matcor
|
||||||
- [Mermaid diagrams for flowcharts, sequences, gantts, pie, etc.](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/mermaid)
|
- [Mermaid diagrams for flowcharts, sequences, gantts, pie, etc.](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/mermaid)
|
||||||
- [Colorful boxes](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/notice)
|
- [Colorful boxes](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/notice)
|
||||||
- [Reveal you site's configuration parameter](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/siteparam)
|
- [Reveal you site's configuration parameter](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/siteparam)
|
||||||
- [Swagger UI for your OpenAPI Specifications](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/swagger)
|
- [Swagger UI for your OpenAPI Specifications](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/openapi)
|
||||||
- [Tabbed panels](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/tabs)
|
- [Tabbed panels](https://mcshelby.github.io/hugo-theme-relearn/shortcodes/tabs)
|
||||||
|
|
||||||
## Installation & Usage
|
## Installation & Usage
|
||||||
|
|
|
@ -59,7 +59,7 @@ The theme is a fork of the great [Learn theme](https://github.com/matcornic/hugo
|
||||||
- [Mermaid diagrams for flowcharts, sequences, gantts, pie, etc.]({{%relref "shortcodes/mermaid" %}})
|
- [Mermaid diagrams for flowcharts, sequences, gantts, pie, etc.]({{%relref "shortcodes/mermaid" %}})
|
||||||
- [Colorful boxes]({{%relref "shortcodes/notice" %}})
|
- [Colorful boxes]({{%relref "shortcodes/notice" %}})
|
||||||
- [Reveal you site's configuration parameter]({{%relref "shortcodes/siteparam" %}})
|
- [Reveal you site's configuration parameter]({{%relref "shortcodes/siteparam" %}})
|
||||||
- [Swagger UI for your OpenAPI Specifications]({{%relref "shortcodes/swagger" %}})
|
- [Swagger UI for your OpenAPI specifications]({{%relref "shortcodes/openapi" %}})
|
||||||
- [Tabbed panels]({{%relref "shortcodes/tabs" %}})
|
- [Tabbed panels]({{%relref "shortcodes/tabs" %}})
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
|
@ -64,12 +64,10 @@ Note that some of these parameters are explained in details in other sections of
|
||||||
customMermaidURL = "https://unpkg.com/mermaid/dist/mermaid.min.js"
|
customMermaidURL = "https://unpkg.com/mermaid/dist/mermaid.min.js"
|
||||||
# Initialization parameter for Mermaid, see Mermaid documentation
|
# Initialization parameter for Mermaid, see Mermaid documentation
|
||||||
mermaidInitialize = "{ \"theme\": \"default\" }"
|
mermaidInitialize = "{ \"theme\": \"default\" }"
|
||||||
# If set to false, load the Swagger module on every page regardless if a Swagger shortcode is present
|
# If set to false, load the OpenAPI module on every page regardless if a OpenAPI shortcode is present
|
||||||
disableSwagger = false
|
disableOpenapi = false
|
||||||
# Specifies the remote location of the RapiDoc js
|
# Specifies the remote location of the swagger-ui js
|
||||||
customSwaggerURL = "https://unpkg.com/rapidoc/dist/rapidoc-min.js"
|
customOpenapiURL = "https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js"
|
||||||
# Initialization parameter for Swagger, see RapiDoc documentation
|
|
||||||
swaggerInitialize = "{ \"theme\": \"light\" }"
|
|
||||||
# Hide Next and Previous page buttons normally displayed full height beside content
|
# Hide Next and Previous page buttons normally displayed full height beside content
|
||||||
disableNextPrev = true
|
disableNextPrev = true
|
||||||
# Order sections in menu by "weight" or "title". Default to "weight";
|
# Order sections in menu by "weight" or "title". Default to "weight";
|
||||||
|
|
|
@ -18,6 +18,14 @@ This document shows you what's new in the latest release. For a detailed list of
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## 5.13.0 (2023-05-14)
|
||||||
|
|
||||||
|
- {{% badge style="note" title=" " %}}Change{{% /badge %}} The `swagger` shortcode was deprecated in favor for the [`openapi` shortcode]({{% relref "shortcodes/openapi" %}}). You don't need to change anything yet as the old name will be used as a fallback. It is planned to remove the `swagger` shortcode in the next major release.
|
||||||
|
|
||||||
|
Additionally, the implemantion of this shortcode was switched from RapiDoc to [SwaggerUI](https://github.com/swagger-api/swagger-ui).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## 5.12.0 (2023-05-04)
|
## 5.12.0 (2023-05-04)
|
||||||
|
|
||||||
- {{% badge style="note" title=" " %}}Change{{% /badge %}} In the effort to comply with WCAG standards, the implementation of the collapsible menu was changed (again). While Internet Explorer 11 has issues in displaying it, the functionality still works.
|
- {{% badge style="note" title=" " %}}Change{{% /badge %}} In the effort to comply with WCAG standards, the implementation of the collapsible menu was changed (again). While Internet Explorer 11 has issues in displaying it, the functionality still works.
|
||||||
|
@ -182,7 +190,7 @@ This document shows you what's new in the latest release. For a detailed list of
|
||||||
|
|
||||||
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} [Image formatting]({{% relref "cont/markdown#add-css-classes" %}}) has two new classes to align images to the `left` or `right`. Additionally, the already existing `inline` option is now documented.
|
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} [Image formatting]({{% relref "cont/markdown#add-css-classes" %}}) has two new classes to align images to the `left` or `right`. Additionally, the already existing `inline` option is now documented.
|
||||||
|
|
||||||
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Printing for the [`swagger` shortcode]({{% relref "shortcodes/swagger" %}}) was optimized to expand sections that are usually closed in interactive mode. This requires [print support]({{%relref "basics/configuration#activate-print-support" %}}) to be configured.
|
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Printing for the [`swagger` shortcode]({{% relref "shortcodes/openapi" %}}) was optimized to expand sections that are usually closed in interactive mode. This requires [print support]({{%relref "basics/configuration#activate-print-support" %}}) to be configured.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -295,7 +303,7 @@ This document shows you what's new in the latest release. For a detailed list of
|
||||||
|
|
||||||
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Introduction of new CSS variables to set the font. The theme distinguishes between `--MAIN-font` for all content text and `--CODE-font` for inline or block code. There are additional overrides for all headings. See the [theme variant generator]({{%relref "basics/generator" %}}) of the exampleSite for all available variables.
|
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Introduction of new CSS variables to set the font. The theme distinguishes between `--MAIN-font` for all content text and `--CODE-font` for inline or block code. There are additional overrides for all headings. See the [theme variant generator]({{%relref "basics/generator" %}}) of the exampleSite for all available variables.
|
||||||
|
|
||||||
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} The new shortcode `swagger` is available to include a UI for REST OpenAPI Specifications. See the [documentation]({{% relref "shortcodes/swagger" %}}) for available features. This feature will not work with Internet Explorer 11.
|
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} The new shortcode `swagger` is available to include a UI for REST OpenAPI specifications. See the [documentation]({{% relref "shortcodes/openapi" %}}) for available features. This feature will not work with Internet Explorer 11.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ Following is an impomplete list of some of the used conventional commit types. B
|
||||||
| | rss | clipboard | math |
|
| | rss | clipboard | math |
|
||||||
| | variant | syntaxhighlight | mermaid |
|
| | variant | syntaxhighlight | mermaid |
|
||||||
| | | boxes | notice |
|
| | | boxes | notice |
|
||||||
|
| | | | openapi |
|
||||||
| | | | piratify |
|
| | | | piratify |
|
||||||
| | | | siteparam |
|
| | | | siteparam |
|
||||||
| | | | swagger |
|
|
||||||
| | | | tabs |
|
| | | | tabs |
|
||||||
|
|
|
@ -30,7 +30,7 @@ Many thanks to [Andy Miller](https://github.com/rhukster) for initially creating
|
||||||
- [MathJax](https://mathjax.org/) - Beautiful math and chemical formulae in all browsers
|
- [MathJax](https://mathjax.org/) - Beautiful math and chemical formulae in all browsers
|
||||||
- [Mermaid](https://mermaid-js.github.io/mermaid) - Generation of diagram and flowchart from text in a similar manner as markdown
|
- [Mermaid](https://mermaid-js.github.io/mermaid) - Generation of diagram and flowchart from text in a similar manner as markdown
|
||||||
- [Perfect Scrollbar](https://perfectscrollbar.com) - A minimalistic but perfect custom scrollbar plugin
|
- [Perfect Scrollbar](https://perfectscrollbar.com) - A minimalistic but perfect custom scrollbar plugin
|
||||||
- [RapiDoc](https://mrin9.github.io/RapiDoc) - Create beautiful, customizable, interactive API documentation from OpenAPI Specifications
|
- [SwaggerUI](https://github.com/swagger-api/swagger-ui) - Generate beautiful documentation from a Swagger-compliant API
|
||||||
- [WorkSans](https://weiweihuanghuang.github.io/Work-Sans/) - Work Sans is a 9 weight typeface family based loosely on early Grotesques
|
- [WorkSans](https://weiweihuanghuang.github.io/Work-Sans/) - Work Sans is a 9 weight typeface family based loosely on early Grotesques
|
||||||
|
|
||||||
## Tooling
|
## Tooling
|
||||||
|
|
56
exampleSite/content/shortcodes/openapi/_index.en.md
Normal file
56
exampleSite/content/shortcodes/openapi/_index.en.md
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
---
|
||||||
|
description: "UI for your OpenAPI / Swagger specifications"
|
||||||
|
title: "OpenAPI"
|
||||||
|
---
|
||||||
|
|
||||||
|
The `openapi` shortcode uses the [Swagger UI](https://github.com/swagger-api/swagger-ui) library to display your OpenAPI / Swagger specifications.
|
||||||
|
|
||||||
|
{{% notice note %}}
|
||||||
|
This only works in modern browsers.
|
||||||
|
{{% /notice %}}
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
While the examples are using shortcodes with named parameter you are free to also call this shortcode from your own partials.
|
||||||
|
|
||||||
|
{{< tabs groupId="shortcode-parameter">}}
|
||||||
|
{{% tab name="shortcode" %}}
|
||||||
|
|
||||||
|
````go
|
||||||
|
{{</* openapi src="https://petstore3.openapi.io/api/v3/openapi.json" */>}}
|
||||||
|
````
|
||||||
|
|
||||||
|
{{% /tab %}}
|
||||||
|
{{% tab name="partial" %}}
|
||||||
|
|
||||||
|
````go
|
||||||
|
{{ partial "shortcodes/openapi.html" (dict
|
||||||
|
"context" .
|
||||||
|
"src" "https://petstore3.openapi.io/api/v3/openapi.json"
|
||||||
|
)}}
|
||||||
|
````
|
||||||
|
|
||||||
|
{{% /tab %}}
|
||||||
|
{{< /tabs >}}
|
||||||
|
|
||||||
|
### Parameter
|
||||||
|
|
||||||
|
| Name | Default | Notes |
|
||||||
|
|:---------------------|:-----------------|:------------|
|
||||||
|
| **src** | _<empty>_ | The URL to the OpenAPI specification file. This can be relative to the URL of your page if it is a leaf or branch bundle. |
|
||||||
|
|
||||||
|
{{% notice note %}}
|
||||||
|
If you want to print out (or generate a PDF) from your OpenAPI documentation, don't initiate printing directly from the page because the elements are optimized for interactive usage in a browser.
|
||||||
|
|
||||||
|
Instead, open the [print preview]({{% relref "basics/configuration/#activate-print-support" %}}) in your browser and initiate printing from that page. This page is optimized for reading and expands most of the available sections.
|
||||||
|
{{% /notice %}}
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
### Using Local File
|
||||||
|
|
||||||
|
````go
|
||||||
|
{{</* openapi src="petstore.json" */>}}
|
||||||
|
````
|
||||||
|
|
||||||
|
{{< openapi src="petstore.json" >}}
|
5
exampleSite/content/shortcodes/openapi/_index.pir.md
Normal file
5
exampleSite/content/shortcodes/openapi/_index.pir.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
description: "Adds UI fer yer OpenAPI / Swaggerrr Specificat'ns"
|
||||||
|
title: "OpenAPI"
|
||||||
|
---
|
||||||
|
{{< piratify true >}}
|
1258
exampleSite/content/shortcodes/openapi/petstore.json
Normal file
1258
exampleSite/content/shortcodes/openapi/petstore.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,71 +0,0 @@
|
||||||
---
|
|
||||||
description: "UI for your Swagger / OpenAPI Specifications"
|
|
||||||
title: "Swagger"
|
|
||||||
---
|
|
||||||
|
|
||||||
The `swagger` shortcode uses the [RapiDoc](https://mrin9.github.io/RapiDoc) library to display your Swagger / OpenAPI Specifications.
|
|
||||||
|
|
||||||
{{% notice note %}}
|
|
||||||
This only works in modern browsers.
|
|
||||||
{{% /notice %}}
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
While the examples are using shortcodes with named parameter you are free to also call this shortcode from your own partials.
|
|
||||||
|
|
||||||
{{< tabs groupId="shortcode-parameter">}}
|
|
||||||
{{% tab name="shortcode" %}}
|
|
||||||
|
|
||||||
````go
|
|
||||||
{{</* swagger src="https://petstore3.swagger.io/api/v3/openapi.json" */>}}
|
|
||||||
````
|
|
||||||
|
|
||||||
{{% /tab %}}
|
|
||||||
{{% tab name="partial" %}}
|
|
||||||
|
|
||||||
````go
|
|
||||||
{{ partial "shortcodes/swagger.html" (dict
|
|
||||||
"context" .
|
|
||||||
"src" "https://petstore3.swagger.io/api/v3/openapi.json"
|
|
||||||
)}}
|
|
||||||
````
|
|
||||||
|
|
||||||
{{% /tab %}}
|
|
||||||
{{< /tabs >}}
|
|
||||||
|
|
||||||
### Parameter
|
|
||||||
|
|
||||||
| Name | Default | Notes |
|
|
||||||
|:---------------------|:-----------------|:------------|
|
|
||||||
| **src** | _<empty>_ | The URL to the OpenAPI Specification file. This can be relative to the URL of your page if it is a leaf or branch bundle. |
|
|
||||||
|
|
||||||
{{% notice note %}}
|
|
||||||
If you want to print out (or generate a PDF) from your Swagger documentation, don't initiate printing directly from the page because the elements are optimized for interactive usage in a browser.
|
|
||||||
|
|
||||||
Instead, open the [print preview]({{% relref "basics/configuration/#activate-print-support" %}}) in your browser and initiate printing from that page. This page is optimized for reading and expands most of the available sections.
|
|
||||||
{{% /notice %}}
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
Swagger is configured with default settings. You can customize Swagger's default settings for all of your files thru a JSON object in your `config.toml` or override these settings per page thru your pages frontmatter.
|
|
||||||
|
|
||||||
The JSON object of your `config.toml` / frontmatter is forwarded into Swagger's initialization. At the moment, only the `theme` setting is supported.
|
|
||||||
|
|
||||||
The `theme` setting can also be set by your used color variant. This will be the sitewide default and can - again - be overridden by your settings in `config.toml` or frontmatter.
|
|
||||||
|
|
||||||
### Global Configuration File
|
|
||||||
|
|
||||||
````toml
|
|
||||||
[params]
|
|
||||||
swaggerInitialize = "{ \"theme\": \"dark\" }"
|
|
||||||
````
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
### Using Local File
|
|
||||||
|
|
||||||
````go
|
|
||||||
{{</* swagger src="petstore.json" */>}}
|
|
||||||
````
|
|
||||||
|
|
||||||
{{< swagger src="petstore.json" >}}
|
|
|
@ -1,5 +0,0 @@
|
||||||
---
|
|
||||||
description: "Adds UI fer yer Swaggerrr / OpenAPI Specificat'ns"
|
|
||||||
title: "Swaggerrr"
|
|
||||||
---
|
|
||||||
{{< piratify true >}}
|
|
File diff suppressed because one or more lines are too long
|
@ -31,7 +31,7 @@ a{{< icon >}}a
|
||||||
|
|
||||||
{{< siteparam >}}
|
{{< siteparam >}}
|
||||||
|
|
||||||
{{< swagger src="" >}}
|
{{< openapi src="" >}}
|
||||||
|
|
||||||
{{< tabs groupid="" >}}
|
{{< tabs groupid="" >}}
|
||||||
{{% tab name="" %}}
|
{{% tab name="" %}}
|
||||||
|
|
|
@ -80,24 +80,26 @@
|
||||||
window.themeUseMermaid = JSON.parse({{ $.Scratch.Get "mermaidInitialize" }});
|
window.themeUseMermaid = JSON.parse({{ $.Scratch.Get "mermaidInitialize" }});
|
||||||
</script>
|
</script>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $wantsSwagger := or (.Page.Store.Get "hasSwagger") (and (.Page.Store.Get (printf "%sIsNested" $outputFormat)) (.Page.Store.Get "nestedHasSwagger")) }}
|
{{- $wantsOpenapi := or (.Page.Store.Get "hasOpenapi") (and (.Page.Store.Get (printf "%sIsNested" $outputFormat)) (.Page.Store.Get "nestedHasOpenapi")) }}
|
||||||
{{- if $wantsSwagger }}
|
{{- if $wantsOpenapi }}
|
||||||
{{- if isset .Params "customswaggerurl" }}
|
{{- $urlOpenapi := "" }}
|
||||||
<script src="{{ .Params.customSwaggerURL }}" defer></script>
|
{{- if isset .Params "customopenapiurl" }}
|
||||||
{{- else if isset .Site.Params "customswaggerurl" }}
|
{{- $urlOpenapi = .Params.customOpenapiURL }}
|
||||||
<script src="{{ .Site.Params.customSwaggerURL }}" defer></script>
|
{{- else if isset .Site.Params "customopenapiurl" }}
|
||||||
|
{{- $urlOpenapi = .Site.Params.customOpenapiURL }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
<script src="{{ "js/rapidoc-min.js" | relURL }}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
{{- $urlOpenapi = "js/swagger-ui/swagger-ui-bundle.js" | relURL }}
|
||||||
|
{{- if not .Site.Params.disableAssetsBusting }}
|
||||||
|
{{- $urlOpenapi = printf "%s?%d" $urlOpenapi now.Unix }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if isset .Params "swaggerinitialize" }}
|
|
||||||
{{- $.Scratch.Set "swaggerInitialize" .Params.swaggerInitialize }}
|
|
||||||
{{- else if isset .Site.Params "swaggerinitialize" }}
|
|
||||||
{{- $.Scratch.Set "swaggerInitialize" .Site.Params.swaggerInitialize }}
|
|
||||||
{{- else }}
|
|
||||||
{{- $.Scratch.Set "swaggerInitialize" "{}" }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
<script src="{{ $urlOpenapi }}" defer></script>
|
||||||
|
{{- $urlOpenapi := replace $urlOpenapi "swagger-ui-bundle" "swagger-ui-standalone-preset" }}
|
||||||
|
<script src="{{ $urlOpenapi }}" defer></script>
|
||||||
|
{{- $urlOpenapi := replace $urlOpenapi "swagger-ui-standalone-preset" "swagger-ui" }}
|
||||||
|
{{- $urlOpenapi := replace $urlOpenapi ".js" ".css" }}
|
||||||
<script>
|
<script>
|
||||||
window.themeUseSwagger = JSON.parse({{ $.Scratch.Get "swaggerInitialize" }});
|
window.themeUseOpenapi = { css: {{ $urlOpenapi }}, assetsBuster: {{ cond (ne .Site.Params.disableAssetsBusting false) now.Unix 0 }} };
|
||||||
</script>
|
</script>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<script src="{{"js/theme.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
<script src="{{"js/theme.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||||
|
|
|
@ -91,6 +91,6 @@
|
||||||
{{- partialCached "nested-content.hugo" (dict "page" $page "outputFormat" $outputFormat) $page.RelPermalink "outputFormat" $outputFormat }}
|
{{- partialCached "nested-content.hugo" (dict "page" $page "outputFormat" $outputFormat) $page.RelPermalink "outputFormat" $outputFormat }}
|
||||||
{{- $currentNode.Page.Store.Set "nestedHasMathJax" (or ($currentNode.Page.Store.Get "nestedHasMathJax") (.Page.Store.Get "hasMathJax")) }}
|
{{- $currentNode.Page.Store.Set "nestedHasMathJax" (or ($currentNode.Page.Store.Get "nestedHasMathJax") (.Page.Store.Get "hasMathJax")) }}
|
||||||
{{- $currentNode.Page.Store.Set "nestedHasMermaid" (or ($currentNode.Page.Store.Get "nestedHasMermaid") (.Page.Store.Get "hasMermaid")) }}
|
{{- $currentNode.Page.Store.Set "nestedHasMermaid" (or ($currentNode.Page.Store.Get "nestedHasMermaid") (.Page.Store.Get "hasMermaid")) }}
|
||||||
{{- $currentNode.Page.Store.Set "nestedHasSwagger" (or ($currentNode.Page.Store.Get "nestedHasSwagger") (.Page.Store.Get "hasSwagger")) }}
|
{{- $currentNode.Page.Store.Set "nestedHasOpenapi" (or ($currentNode.Page.Store.Get "nestedHasOpenapi") (.Page.Store.Get "hasOpenapi")) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
|
@ -13,9 +13,9 @@
|
||||||
{{- if $wantsMermaid }}
|
{{- if $wantsMermaid }}
|
||||||
{{- $currentNode.Store.Set "hasMermaid" true }}
|
{{- $currentNode.Store.Set "hasMermaid" true }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $wantsSwagger := or (and (ne $currentNode.Params.disableSwagger nil) (not $currentNode.Params.disableSwagger)) (and (ne .Site.Params.disableSwagger nil) (not .Site.Params.disableSwagger)) }}
|
{{- $wantsOpenapi := or (and (ne $currentNode.Params.disableOpenapi nil) (not $currentNode.Params.disableOpenapi)) (and (ne .Site.Params.disableOpenapi nil) (not .Site.Params.disableOpenapi)) }}
|
||||||
{{- if $wantsSwagger }}
|
{{- if $wantsOpenapi }}
|
||||||
{{- $currentNode.Store.Set "hasSwagger" true }}
|
{{- $currentNode.Store.Set "hasOpenapi" true }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- template "relearn-structure" dict "node" .Site.Home "currentnode" $currentNode "hiddenstem" false "hiddencurrent" false "defaultOrdersectionsby" (.Site.Params.ordersectionsby | default "weight") }}
|
{{- template "relearn-structure" dict "node" .Site.Home "currentnode" $currentNode "hiddenstem" false "hiddencurrent" false "defaultOrdersectionsby" (.Site.Params.ordersectionsby | default "weight") }}
|
||||||
{{- define "relearn-structure" }}
|
{{- define "relearn-structure" }}
|
||||||
|
|
18
layouts/partials/shortcodes/openapi.html
Normal file
18
layouts/partials/shortcodes/openapi.html
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{{- $context := .context }}
|
||||||
|
{{- $src := .src }}
|
||||||
|
{{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo") .id }}
|
||||||
|
{{- with $context }}
|
||||||
|
{{- with .Page.Resources.Match $src }}
|
||||||
|
{{- range . }}
|
||||||
|
{{- $src = .RelPermalink }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
<div class="sc-openapi-wrapper is-loading helper-loading-container">
|
||||||
|
<div
|
||||||
|
class="sc-openapi-container"
|
||||||
|
id="openapi-{{ $id }}"
|
||||||
|
openapi-url="{{ $src }}"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
{{- .Page.Store.Set "hasOpenapi" true }}
|
||||||
|
{{- end }}
|
|
@ -1,33 +1,6 @@
|
||||||
{{- $context := .context }}
|
{{ warnf "DEPRECATED: Use shortcode openapi instead of swagger in %q" .context.Page.File.Path }}
|
||||||
{{- $src := .src }}
|
{{- partial "shortcodes/openapi.html" (dict
|
||||||
{{- with $context }}
|
"context" .context
|
||||||
{{- with .Page.Resources.Match $src }}
|
"src" .src
|
||||||
{{- range . }}
|
"id" .id
|
||||||
{{- $src = .RelPermalink }}
|
) }}
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
<rapi-doc
|
|
||||||
{{- if eq (partial "output-format.hugo" .Page) "print" }}
|
|
||||||
allow-spec-file-download="false"
|
|
||||||
allow-server-selection="false"
|
|
||||||
allow-try="false"
|
|
||||||
font-size="default"
|
|
||||||
render-style="read"
|
|
||||||
{{- else }}
|
|
||||||
allow-spec-file-download="true"
|
|
||||||
allow-server-selection="true"
|
|
||||||
allow-try="true"
|
|
||||||
font-size="largest"
|
|
||||||
render-style="view"
|
|
||||||
{{- end }}
|
|
||||||
default-schema-tab="example"
|
|
||||||
layout="column"
|
|
||||||
load-fonts="false"
|
|
||||||
schema-description-expanded="true"
|
|
||||||
schema-style="table"
|
|
||||||
show-header="false"
|
|
||||||
spec-url="{{ $src }}"
|
|
||||||
sort-tags="true"
|
|
||||||
></rapi-doc>
|
|
||||||
{{- .Page.Store.Set "hasSwagger" true }}
|
|
||||||
{{- end }}
|
|
|
@ -1,8 +1,15 @@
|
||||||
{{- $_hugo_config := `{ "version": 1 }` }}
|
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||||
|
{{- $version := split hugo.Version "." }}
|
||||||
|
{{- $major := int (index $version 0) }}
|
||||||
|
{{- $minor := int (index $version 1) }}
|
||||||
|
{{- $id := "" }}
|
||||||
|
{{- if and (ge $major 0) (ge $major 108) }}
|
||||||
|
{{- $id = .Ordinal }}
|
||||||
|
{{- end }}
|
||||||
{{- partial "shortcodes/expand.html" (dict
|
{{- partial "shortcodes/expand.html" (dict
|
||||||
"context" .
|
"context" .
|
||||||
"content" .Inner
|
"content" .Inner
|
||||||
"open" (.Get "open" | default (.Get 1))
|
"open" (.Get "open" | default (.Get 1))
|
||||||
"title" (.Get "title" | default (.Get 0))
|
"title" (.Get "title" | default (.Get 0))
|
||||||
"id" .Ordinal
|
"id" $id
|
||||||
) }}
|
) }}
|
12
layouts/shortcodes/openapi.html
Normal file
12
layouts/shortcodes/openapi.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{{- $version := split hugo.Version "." }}
|
||||||
|
{{- $major := int (index $version 0) }}
|
||||||
|
{{- $minor := int (index $version 1) }}
|
||||||
|
{{- $id := "" }}
|
||||||
|
{{- if and (ge $major 0) (ge $major 108) }}
|
||||||
|
{{- $id = .Ordinal }}
|
||||||
|
{{- end }}
|
||||||
|
{{- partial "shortcodes/openapi.html" (dict
|
||||||
|
"context" .
|
||||||
|
"src" (.Get "src")
|
||||||
|
"id" $id
|
||||||
|
) }}
|
|
@ -1,4 +1,12 @@
|
||||||
|
{{- $version := split hugo.Version "." }}
|
||||||
|
{{- $major := int (index $version 0) }}
|
||||||
|
{{- $minor := int (index $version 1) }}
|
||||||
|
{{- $id := "" }}
|
||||||
|
{{- if and (ge $major 0) (ge $major 108) }}
|
||||||
|
{{- $id = .Ordinal }}
|
||||||
|
{{- end }}
|
||||||
{{- partial "shortcodes/swagger.html" (dict
|
{{- partial "shortcodes/swagger.html" (dict
|
||||||
"context" .
|
"context" .
|
||||||
"src" (.Get "src")
|
"src" (.Get "src")
|
||||||
|
"id" $id
|
||||||
) }}
|
) }}
|
|
@ -1,4 +0,0 @@
|
||||||
{{- partial "shortcodes/swagger.html" (dict
|
|
||||||
"context" .
|
|
||||||
"src" (.Get "src")
|
|
||||||
) }}
|
|
|
@ -159,56 +159,6 @@ div.box > .box-content {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
rapi-doc{
|
|
||||||
/* adjust rapi-doc internals to fill out available space with render-style=read */
|
|
||||||
margin-left: calc( -80px );
|
|
||||||
width: calc( 100% + 80px + 80px );
|
|
||||||
}
|
|
||||||
@media (max-width: 1023px) {
|
|
||||||
rapi-doc {
|
|
||||||
margin-left: calc( -8px );
|
|
||||||
width: calc( 100% + 8px + 8px );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rapi-doc::part(section-tag) {
|
|
||||||
/* adjust rapi-doc internals to fill out available space with render-style=read */
|
|
||||||
margin-left: 80px;
|
|
||||||
margin-right: 80px;
|
|
||||||
padding-left: 0;
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
|
||||||
@media (max-width: 1023px) {
|
|
||||||
rapi-doc::part(section-tag) {
|
|
||||||
margin-left: 8px;
|
|
||||||
margin-right: 8px;
|
|
||||||
padding-left: 0;
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rapi-doc::part(section-main-content) {
|
|
||||||
/* override variables for adapting rapidoc design to print theme */
|
|
||||||
--fg: black;
|
|
||||||
--fg2: black;
|
|
||||||
--fg3: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
rapi-doc::part(section-overview-title) {
|
|
||||||
/* set print color for titles */
|
|
||||||
color: black !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
rapi-doc::part(operation-divider) {
|
|
||||||
/* remove whitespace */
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
margin-top: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
rapi-doc::part(section-navbar) {
|
|
||||||
/* removes the nav bar for render-style=read */
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn,
|
.btn,
|
||||||
#body .tab-nav-button {
|
#body .tab-nav-button {
|
||||||
color: black !important;
|
color: black !important;
|
||||||
|
|
|
@ -149,9 +149,6 @@
|
||||||
.anchor {
|
.anchor {
|
||||||
margin-left: .66em;
|
margin-left: .66em;
|
||||||
}
|
}
|
||||||
/* rapi-doc
|
|
||||||
seems not be capable of RTL
|
|
||||||
*/
|
|
||||||
html[dir="rtl"] .select-container i,
|
html[dir="rtl"] .select-container i,
|
||||||
html[dir="rtl"] .select-container span {
|
html[dir="rtl"] .select-container span {
|
||||||
float: left;
|
float: left;
|
||||||
|
|
|
@ -82,6 +82,9 @@ sup {
|
||||||
sub {
|
sub {
|
||||||
bottom: -0.25em; }
|
bottom: -0.25em; }
|
||||||
|
|
||||||
|
iframe {
|
||||||
|
border: 0; }
|
||||||
|
|
||||||
img {
|
img {
|
||||||
border: 0;
|
border: 0;
|
||||||
max-width: 100%; }
|
max-width: 100%; }
|
||||||
|
|
2045
static/css/swagger-dark.css
Normal file
2045
static/css/swagger-dark.css
Normal file
File diff suppressed because it is too large
Load diff
0
static/css/swagger-light.css
Normal file
0
static/css/swagger-light.css
Normal file
311
static/css/swagger.css
Normal file
311
static/css/swagger.css
Normal file
|
@ -0,0 +1,311 @@
|
||||||
|
/* Styles to make Swagger-UI fit into our theme */
|
||||||
|
|
||||||
|
@import "fonts.css";
|
||||||
|
@import "variant-internal.css";
|
||||||
|
|
||||||
|
body{
|
||||||
|
line-height: 1.574;
|
||||||
|
font-weight: 300;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
body,
|
||||||
|
.swagger-ui .info *,
|
||||||
|
#relearn-swagger-ui .renderedMarkdown *,
|
||||||
|
#relearn-swagger-ui p{
|
||||||
|
font-size: 1.015625rem;
|
||||||
|
}
|
||||||
|
.swagger-ui .scheme-container{
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
|
.swagger-ui .wrapper{
|
||||||
|
padding-left: 0;
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
svg{
|
||||||
|
fill: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .info h2.title {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H2-TEXT-color);
|
||||||
|
}
|
||||||
|
.relearn-expander{
|
||||||
|
display: block;
|
||||||
|
float: right;
|
||||||
|
margin: .5rem;
|
||||||
|
}
|
||||||
|
#relearn-swagger-ui{
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Styles extracted from swagger-dark.css generated by Dark Reader */
|
||||||
|
|
||||||
|
html {
|
||||||
|
background-color: var(--INTERNAL-MAIN-BG-color) !important;
|
||||||
|
}
|
||||||
|
html {
|
||||||
|
color-scheme: var(--INTERNAL-BROWSER-theme) !important;
|
||||||
|
}
|
||||||
|
html, body {
|
||||||
|
background-color: var(--INTERNAL-MAIN-BG-color);
|
||||||
|
}
|
||||||
|
html, body {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: var(--INTERNAL-MAIN-LINK-color);
|
||||||
|
}
|
||||||
|
input:-webkit-autofill,
|
||||||
|
textarea:-webkit-autofill,
|
||||||
|
select:-webkit-autofill {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color) !important;
|
||||||
|
}
|
||||||
|
::-webkit-scrollbar-corner {
|
||||||
|
background-color: var(--INTERNAL-MAIN-BG-color);
|
||||||
|
}
|
||||||
|
::selection {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color) !important;
|
||||||
|
}
|
||||||
|
::-moz-selection {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color) !important;
|
||||||
|
}
|
||||||
|
*:not(pre, pre *, code, .far, .fa, .glyphicon, [class*="vjs-"], .fab, .fa-github, .fas, .material-icons, .icofont, .typcn, mu, [class*="mu-"], .glyphicon, .icon) {
|
||||||
|
font-family: var(--INTERNAL-MAIN-font) !important;
|
||||||
|
}
|
||||||
|
:root {
|
||||||
|
--darkreader-neutral-background: var(--INTERNAL-MAIN-BG-color);
|
||||||
|
--darkreader-neutral-text: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
--darkreader-selection-text: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .nested-links a {
|
||||||
|
color: var(--INTERNAL-MAIN-LINK-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .nested-links a:focus,
|
||||||
|
.swagger-ui .nested-links a:hover {
|
||||||
|
color: var(--INTERNAL-MAIN-LINK-HOVER-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock-tag {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock-tag small {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .parameter__type {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock .opblock-section-header > label {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock .opblock-section-header h4 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H4-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock .opblock-summary-operation-id,
|
||||||
|
.swagger-ui .opblock .opblock-summary-path,
|
||||||
|
.swagger-ui .opblock .opblock-summary-path__deprecated {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock .opblock-summary-description {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-post {
|
||||||
|
border-color: var(--INTERNAL-BOX-GREEN-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-post .opblock-summary-method {
|
||||||
|
background-color: var(--INTERNAL-BOX-GREEN-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-post .opblock-summary {
|
||||||
|
border-color: var(--INTERNAL-BOX-GREEN-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-post .tab-header .tab-item.active h4 span::after {
|
||||||
|
background-color: var(--INTERNAL-BOX-GREEN-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-put {
|
||||||
|
border-color: var(--INTERNAL-BOX-ORANGE-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-put .opblock-summary-method {
|
||||||
|
background-color: var(--INTERNAL-BOX-ORANGE-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-put .opblock-summary {
|
||||||
|
border-color: var(--INTERNAL-BOX-ORANGE-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-put .tab-header .tab-item.active h4 span::after {
|
||||||
|
background-color: var(--INTERNAL-BOX-ORANGE-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-delete {
|
||||||
|
border-color: var(--INTERNAL-BOX-RED-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-delete .opblock-summary-method {
|
||||||
|
background-color: var(--INTERNAL-BOX-RED-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-delete .opblock-summary {
|
||||||
|
border-color: var(--INTERNAL-BOX-RED-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-delete .tab-header .tab-item.active h4 span::after {
|
||||||
|
background-color: var(--INTERNAL-BOX-RED-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-get {
|
||||||
|
border-color: var(--INTERNAL-BOX-BLUE-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-get .opblock-summary-method {
|
||||||
|
background-color: var(--INTERNAL-BOX-BLUE-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-get .opblock-summary {
|
||||||
|
border-color: var(--INTERNAL-BOX-BLUE-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock.opblock-get .tab-header .tab-item.active h4 span::after {
|
||||||
|
background-color: var(--INTERNAL-BOX-BLUE-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .tab li {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock-description-wrapper,
|
||||||
|
.swagger-ui .opblock-external-docs-wrapper,
|
||||||
|
.swagger-ui .opblock-title_normal {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock-description-wrapper h4,
|
||||||
|
.swagger-ui .opblock-external-docs-wrapper h4,
|
||||||
|
.swagger-ui .opblock-title_normal h4 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H4-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock-description-wrapper p,
|
||||||
|
.swagger-ui .opblock-external-docs-wrapper p,
|
||||||
|
.swagger-ui .opblock-title_normal p {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .responses-inner h4{
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H4-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .responses-inner h5 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H5-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .response-col_status {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .response-col_links {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .opblock-body pre.microlight {
|
||||||
|
background-color: var(--INTERNAL-MAIN-BG-color);
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .scheme-container .schemes > label {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .loading-container .loading::after {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui section h3 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H3-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .btn {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui select {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui label {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui textarea {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .checkbox p {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .dialog-ux .modal-ux-content p {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .dialog-ux .modal-ux-content h4 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H4-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .dialog-ux .modal-ux-header h3 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H3-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .model {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui section.models h4 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H4-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui section.models h5 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H5-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .model-title {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .prop-format {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .servers > label {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui table.headers td {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui table thead tr td,
|
||||||
|
.swagger-ui table thead tr th {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .parameter__name {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .info li,
|
||||||
|
.swagger-ui .info p,
|
||||||
|
.swagger-ui .info table {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .info h1 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H1-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .info h2 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H2-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .info h3 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H3-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .info h4 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H4-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .info h5 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H5-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .info a {
|
||||||
|
color: var(--INTERNAL-MAIN-LINK-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .info a:hover {
|
||||||
|
color: var(--INTERNAL-MAIN-LINK-HOVER-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .info .base-url {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .info .title {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .auth-container .errors {
|
||||||
|
color: var(--INTERNAL-MAIN-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .scopes h2 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H2-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .scopes h2 a {
|
||||||
|
color: var(--INTERNAL-MAIN-LINK-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .errors-wrapper .errors h4 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H4-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .errors-wrapper .errors small {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-TEXT-color);
|
||||||
|
}
|
||||||
|
.swagger-ui .errors-wrapper hgroup h4 {
|
||||||
|
color: var(--INTERNAL-MAIN-TITLES-H4-TEXT-color);
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
background-color: var(--INTERNAL-MAIN-BG-color);
|
||||||
|
}
|
|
@ -33,7 +33,8 @@
|
||||||
|
|
||||||
--BROWSER-theme: dark; /* name of the theme for browser scrollbars of the main section */
|
--BROWSER-theme: dark; /* name of the theme for browser scrollbars of the main section */
|
||||||
--MERMAID-theme: dark; /* name of the default Mermaid theme for this variant, can be overridden in config.toml */
|
--MERMAID-theme: dark; /* name of the default Mermaid theme for this variant, can be overridden in config.toml */
|
||||||
--SWAGGER-theme: dark; /* name of the default Swagger theme for this variant, can be overridden in config.toml */
|
--OPENAPI-theme: dark; /* name of the default OpenAPI theme for this variant, can be overridden in config.toml */
|
||||||
|
--OPENAPI-CODE-theme: tomorrow-night; /* name of the default OpenAPI code theme for this variant, can be overridden in config.toml */
|
||||||
|
|
||||||
--MENU-HEADER-BG-color: rgba( 0, 0, 0, 0 ); /* background color of menu header */
|
--MENU-HEADER-BG-color: rgba( 0, 0, 0, 0 ); /* background color of menu header */
|
||||||
|
|
||||||
|
@ -80,7 +81,6 @@ body #logo svg * {
|
||||||
}
|
}
|
||||||
|
|
||||||
body a#logo{
|
body a#logo{
|
||||||
color: var(--INTERNAL-MENU-SEARCH-BORDER-color);
|
|
||||||
text-shadow:
|
text-shadow:
|
||||||
0 0 1px var(--INTERNAL-MENU-SEARCH-BORDER-color),
|
0 0 1px var(--INTERNAL-MENU-SEARCH-BORDER-color),
|
||||||
0 0 2px var(--INTERNAL-MENU-SEARCH-BORDER-color),
|
0 0 2px var(--INTERNAL-MENU-SEARCH-BORDER-color),
|
||||||
|
@ -113,19 +113,6 @@ body h2 {
|
||||||
0 0 10px var(--INTERNAL-MAIN-TITLES-H2-color);
|
0 0 10px var(--INTERNAL-MAIN-TITLES-H2-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen {
|
|
||||||
body:not(.print) rapi-doc::part(section-overview-title) {
|
|
||||||
color: #fff;
|
|
||||||
text-shadow:
|
|
||||||
0 0 1px #fff,
|
|
||||||
0 0 2px #fff,
|
|
||||||
0 0 8px #808080,
|
|
||||||
0 0 4px var(--INTERNAL-MAIN-TITLES-H2-color),
|
|
||||||
0 0 8px var(--INTERNAL-MAIN-TITLES-H2-color),
|
|
||||||
0 0 10px var(--INTERNAL-MAIN-TITLES-H2-color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
body h3, body .article-subheading {
|
body h3, body .article-subheading {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-shadow:
|
text-shadow:
|
||||||
|
@ -152,11 +139,10 @@ body h5 {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-shadow:
|
text-shadow:
|
||||||
0 0 1px #fff,
|
0 0 1px #fff,
|
||||||
0 0 2px #fff,
|
0 0 3px #fff,
|
||||||
0 0 8px #808080,
|
0 0 6px #808080,
|
||||||
0 0 4px var(--INTERNAL-MAIN-TITLES-H5-color),
|
0 0 4px var(--INTERNAL-MAIN-TITLES-H5-color),
|
||||||
0 0 8px var(--INTERNAL-MAIN-TITLES-H5-color),
|
0 0 8px var(--INTERNAL-MAIN-TITLES-H5-color);
|
||||||
0 0 10px var(--INTERNAL-MAIN-TITLES-H5-color);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body h6 {
|
body h6 {
|
||||||
|
@ -164,10 +150,15 @@ body h6 {
|
||||||
text-shadow:
|
text-shadow:
|
||||||
0 0 1px #fff,
|
0 0 1px #fff,
|
||||||
0 0 2px #fff,
|
0 0 2px #fff,
|
||||||
0 0 8px #808080,
|
0 0 4px #808080,
|
||||||
0 0 4px var(--INTERNAL-MAIN-TITLES-H6-color),
|
0 0 4px var(--INTERNAL-MAIN-TITLES-H6-color),
|
||||||
0 0 8px var(--INTERNAL-MAIN-TITLES-H6-color),
|
0 0 8px var(--INTERNAL-MAIN-TITLES-H6-color);
|
||||||
0 0 10px var(--INTERNAL-MAIN-TITLES-H5-color);
|
}
|
||||||
|
|
||||||
|
.swagger-ui h4,
|
||||||
|
.swagger-ui h5,
|
||||||
|
.swagger-ui h6{
|
||||||
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
body #sidebar .searchbox button:hover,
|
body #sidebar .searchbox button:hover,
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
|
|
||||||
--BROWSER-theme: light; /* name of the theme for browser scrollbars of the main section */
|
--BROWSER-theme: light; /* name of the theme for browser scrollbars of the main section */
|
||||||
--MERMAID-theme: default; /* name of the default Mermaid theme for this variant, can be overridden in config.toml */
|
--MERMAID-theme: default; /* name of the default Mermaid theme for this variant, can be overridden in config.toml */
|
||||||
--SWAGGER-theme: light; /* name of the default Swagger theme for this variant, can be overridden in config.toml */
|
--OPENAPI-theme: light; /* name of the default OpenAPI theme for this variant, can be overridden in config.toml */
|
||||||
|
--OPENAPI-CODE-theme: obsidian; /* name of the default OpenAPI code theme for this variant, can be overridden in config.toml */
|
||||||
|
|
||||||
--MENU-HOME-LINK-color: #404040; /* home button color if configured */
|
--MENU-HOME-LINK-color: #404040; /* home button color if configured */
|
||||||
--MENU-HOME-LINK-HOVER-color: #000000; /* hovered home button color if configured */
|
--MENU-HOME-LINK-HOVER-color: #000000; /* hovered home button color if configured */
|
||||||
|
|
|
@ -25,7 +25,8 @@
|
||||||
|
|
||||||
--BROWSER-theme: dark; /* name of the theme for browser scrollbars of the main section */
|
--BROWSER-theme: dark; /* name of the theme for browser scrollbars of the main section */
|
||||||
--MERMAID-theme: dark; /* name of the default Mermaid theme for this variant, can be overridden in config.toml */
|
--MERMAID-theme: dark; /* name of the default Mermaid theme for this variant, can be overridden in config.toml */
|
||||||
--SWAGGER-theme: dark; /* name of the default Swagger theme for this variant, can be overridden in config.toml */
|
--OPENAPI-theme: dark; /* name of the default OpenAPI theme for this variant, can be overridden in config.toml */
|
||||||
|
--OPENAPI-CODE-theme: obsidian; /* name of the default OpenAPI code theme for this variant, can be overridden in config.toml */
|
||||||
|
|
||||||
--MENU-HOME-LINK-color: #404040; /* home button color if configured */
|
--MENU-HOME-LINK-color: #404040; /* home button color if configured */
|
||||||
--MENU-HOME-LINK-HOVER-color: #000000; /* hovered home button color if configured */
|
--MENU-HOME-LINK-HOVER-color: #000000; /* hovered home button color if configured */
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
|
|
||||||
--BROWSER-theme: light; /* name of the theme for browser scrollbars of the main section */
|
--BROWSER-theme: light; /* name of the theme for browser scrollbars of the main section */
|
||||||
--MERMAID-theme: default; /* name of the default Mermaid theme for this variant, can be overridden in config.toml */
|
--MERMAID-theme: default; /* name of the default Mermaid theme for this variant, can be overridden in config.toml */
|
||||||
--SWAGGER-theme: light; /* name of the default Swagger theme for this variant, can be overridden in config.toml */
|
--OPENAPI-theme: light; /* name of the default OpenAPI theme for this variant, can be overridden in config.toml */
|
||||||
|
--OPENAPI-CODE-theme: obsidian; /* name of the default OpenAPI code theme for this variant, can be overridden in config.toml */
|
||||||
|
|
||||||
--MENU-HOME-LINK-color: #404040; /* home button color if configured */
|
--MENU-HOME-LINK-color: #404040; /* home button color if configured */
|
||||||
--MENU-HOME-LINK-HOVER-color: #000000; /* hovered home button color if configured */
|
--MENU-HOME-LINK-HOVER-color: #000000; /* hovered home button color if configured */
|
||||||
|
|
|
@ -1296,45 +1296,6 @@ h6 a {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
rapi-doc {
|
|
||||||
/* adjust rapi-doc internals to fill out available space with render-style=view */
|
|
||||||
margin-left: calc( -8px - 24px );
|
|
||||||
width: calc( 100% + 8px + 24px + 8px );
|
|
||||||
}
|
|
||||||
@media (max-width: 48rem) {
|
|
||||||
rapi-doc {
|
|
||||||
margin-left: calc( -12px );
|
|
||||||
width: calc( 100% + 12px + 4px );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rapi-doc::part(section-main-content) {
|
|
||||||
/* override variables for adapting rapidoc design to theme */
|
|
||||||
--font-mono: var(--INTERNAL-CODE-font);
|
|
||||||
--font-size-mono: .9375rem;
|
|
||||||
--font-regular: var(--INTERNAL-MAIN-font);
|
|
||||||
--font-size-regular: 1.015625rem;
|
|
||||||
--font-size-small: .875rem;
|
|
||||||
font-weight: 300 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
rapi-doc::part(section-overview-title) {
|
|
||||||
color: var(--INTERNAL-MAIN-TITLES-H2-color);
|
|
||||||
font-size: 2.55rem;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
rapi-doc::part(btn) {
|
|
||||||
/* makes download button large enough to not overflow default text */
|
|
||||||
width: unset !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
rapi-doc::part(section-endpoint-head-method) {
|
|
||||||
/* makes method marker large enough to not overflow on text DELETE */
|
|
||||||
font-size: .6875rem;
|
|
||||||
width: 5.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.select-container i {
|
.select-container i {
|
||||||
padding-top: .25em;
|
padding-top: .25em;
|
||||||
}
|
}
|
||||||
|
|
106
static/css/variant-internal.css
Normal file
106
static/css/variant-internal.css
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
:root {
|
||||||
|
/* initially use section background to avoid flickering on load when a non default variant is active;
|
||||||
|
this is only possible because every color variant defines this variable, otherwise we would have been lost */
|
||||||
|
--INTERNAL-PRIMARY-color: var(--PRIMARY-color, var(--MENU-HEADER-BG-color, rgba( 0, 0, 0, 0 ))); /* not --INTERNAL-MENU-HEADER-BG-color */
|
||||||
|
--INTERNAL-SECONDARY-color: var(--SECONDARY-color, var(--MAIN-LINK-color, #486ac9)); /* not --INTERNAL-MAIN-LINK-color */
|
||||||
|
--INTERNAL-ACCENT-color: var(--ACCENT-color, #ffff00);
|
||||||
|
|
||||||
|
--INTERNAL-MAIN-LINK-color: var(--MAIN-LINK-color, var(--SECONDARY-color, #486ac9)); /* not --INTERNAL-SECONDARY-color */
|
||||||
|
--INTERNAL-MAIN-LINK-HOVER-color: var(--MAIN-LINK-HOVER-color, var(--INTERNAL-MAIN-LINK-color));
|
||||||
|
--INTERNAL-MAIN-BG-color: var(--MAIN-BG-color, #ffffff);
|
||||||
|
|
||||||
|
--INTERNAL-MAIN-TEXT-color: var(--MAIN-TEXT-color, #101010);
|
||||||
|
--INTERNAL-MAIN-TITLES-TEXT-color: var(--MAIN-TITLES-TEXT-color, var(--INTERNAL-MAIN-TEXT-color));
|
||||||
|
|
||||||
|
--INTERNAL-MAIN-TITLES-H1-color: var(--MAIN-TITLES-H1-color, var(--INTERNAL-MAIN-TEXT-color));
|
||||||
|
--INTERNAL-MAIN-TITLES-H2-color: var(--MAIN-TITLES-H2-color, var(--INTERNAL-MAIN-TITLES-TEXT-color));
|
||||||
|
--INTERNAL-MAIN-TITLES-H3-color: var(--MAIN-TITLES-H3-color, var(--INTERNAL-MAIN-TITLES-H2-color));
|
||||||
|
--INTERNAL-MAIN-TITLES-H4-color: var(--MAIN-TITLES-H4-color, var(--INTERNAL-MAIN-TITLES-H3-color));
|
||||||
|
--INTERNAL-MAIN-TITLES-H5-color: var(--MAIN-TITLES-H5-color, var(--INTERNAL-MAIN-TITLES-H4-color));
|
||||||
|
--INTERNAL-MAIN-TITLES-H6-color: var(--MAIN-TITLES-H6-color, var(--INTERNAL-MAIN-TITLES-H5-color));
|
||||||
|
|
||||||
|
--INTERNAL-MAIN-font: var(--MAIN-font, "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif);
|
||||||
|
--INTERNAL-MAIN-TITLES-TEXT-font: var(--MAIN-TITLES-TEXT-font, var(--INTERNAL-MAIN-font));
|
||||||
|
|
||||||
|
--INTERNAL-MAIN-TITLES-H1-font: var(--MAIN-TITLES-H1-font, var(--INTERNAL-MAIN-font));
|
||||||
|
--INTERNAL-MAIN-TITLES-H2-font: var(--MAIN-TITLES-H2-font, var(--INTERNAL-MAIN-TITLES-TEXT-font));
|
||||||
|
--INTERNAL-MAIN-TITLES-H3-font: var(--MAIN-TITLES-H3-font, var(--INTERNAL-MAIN-TITLES-H2-font));
|
||||||
|
--INTERNAL-MAIN-TITLES-H4-font: var(--MAIN-TITLES-H4-font, var(--INTERNAL-MAIN-TITLES-H3-font));
|
||||||
|
--INTERNAL-MAIN-TITLES-H5-font: var(--MAIN-TITLES-H5-font, var(--INTERNAL-MAIN-TITLES-H4-font));
|
||||||
|
--INTERNAL-MAIN-TITLES-H6-font: var(--MAIN-TITLES-H6-font, var(--INTERNAL-MAIN-TITLES-H5-font));
|
||||||
|
|
||||||
|
--INTERNAL-CODE-BLOCK-color: var(--CODE-BLOCK-color, var(--MAIN-CODE-color, #000000));
|
||||||
|
--INTERNAL-CODE-BLOCK-BG-color: var(--CODE-BLOCK-BG-color, var(--MAIN-CODE-BG-color, #f8f8f8));
|
||||||
|
--INTERNAL-CODE-BLOCK-BORDER-color: var(--CODE-BLOCK-BORDER-color, var(--MAIN-CODE-BG-color, var(--INTERNAL-CODE-BLOCK-BG-color)));
|
||||||
|
|
||||||
|
--INTERNAL-CODE-INLINE-color: var(--CODE-INLINE-color, #5e5e5e);
|
||||||
|
--INTERNAL-CODE-INLINE-BG-color: var(--CODE-INLINE-BG-color, #fffae9);
|
||||||
|
--INTERNAL-CODE-INLINE-BORDER-color: var(--CODE-INLINE-BORDER-color, #fbf0cb);
|
||||||
|
|
||||||
|
--INTERNAL-CODE-font: var(--CODE-font, "Consolas", menlo, monospace);
|
||||||
|
|
||||||
|
--INTERNAL-BROWSER-theme: var(--BROWSER-theme, light);
|
||||||
|
--INTERNAL-MERMAID-theme: var(--CONFIG-MERMAID-theme, var(--MERMAID-theme, var(--INTERNAL-PRINT-MERMAID-theme)));
|
||||||
|
--INTERNAL-OPENAPI-theme: var(--CONFIG-OPENAPI-theme, var(--OPENAPI-theme, var(--SWAGGER-theme, var(--INTERNAL-PRINT-OPENAPI-theme))));
|
||||||
|
--INTERNAL-OPENAPI-CODE-theme: var(--CONFIG-OPENAPI-CODE-theme, var(--OPENAPI-CODE-theme, --INTERNAL-PRINT-OPENAPI-CODE-theme));
|
||||||
|
|
||||||
|
--INTERNAL-TAG-BG-color: var(--TAG-BG-color, var(--INTERNAL-PRIMARY-color));
|
||||||
|
|
||||||
|
--INTERNAL-MENU-HEADER-BG-color: var(--MENU-HEADER-BG-color, var(--PRIMARY-color, rgba( 0, 0, 0, 0 ))); /* not --INTERNAL-PRIMARY-color */
|
||||||
|
--INTERNAL-MENU-HEADER-BORDER-color: var(--MENU-HEADER-BORDER-color, var(--INTERNAL-MENU-HEADER-BG-color));
|
||||||
|
|
||||||
|
--INTERNAL-MENU-HOME-LINK-color: var(--MENU-HOME-LINK-color, #323232);
|
||||||
|
--INTERNAL-MENU-HOME-LINK-HOVER-color: var(--MENU-HOME-LINK-HOVER-color, var(--MENU-HOME-LINK-HOVERED-color, #808080));
|
||||||
|
|
||||||
|
--INTERNAL-MENU-SEARCH-color: var(--MENU-SEARCH-color, var(--MENU-SEARCH-BOX-ICONS-color, #e0e0e0));
|
||||||
|
--INTERNAL-MENU-SEARCH-BG-color: var(--MENU-SEARCH-BG-color, #323232);
|
||||||
|
--INTERNAL-MENU-SEARCH-BORDER-color: var(--MENU-SEARCH-BORDER-color, var(--MENU-SEARCH-BOX-color, var(--INTERNAL-MENU-SEARCH-BG-color)));
|
||||||
|
|
||||||
|
--INTERNAL-MENU-SECTIONS-ACTIVE-BG-color: var(--MENU-SECTIONS-ACTIVE-BG-color, rgba( 0, 0, 0, .166 ));
|
||||||
|
--INTERNAL-MENU-SECTIONS-BG-color: var(--MENU-SECTIONS-BG-color, #282828);
|
||||||
|
--INTERNAL-MENU-SECTIONS-LINK-color: var(--MENU-SECTIONS-LINK-color, #bababa);
|
||||||
|
--INTERNAL-MENU-SECTIONS-LINK-HOVER-color: var(--MENU-SECTIONS-LINK-HOVER-color, var(--INTERNAL-MENU-SECTIONS-LINK-color));
|
||||||
|
--INTERNAL-MENU-SECTION-ACTIVE-CATEGORY-color: var(--MENU-SECTION-ACTIVE-CATEGORY-color, #444444);
|
||||||
|
--INTERNAL-MENU-SECTION-ACTIVE-CATEGORY-BG-color: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color, var(--INTERNAL-MAIN-BG-color));
|
||||||
|
|
||||||
|
--INTERNAL-MENU-VISITED-color: var(--MENU-VISITED-color, var(--INTERNAL-SECONDARY-color));
|
||||||
|
--INTERNAL-MENU-SECTION-HR-color: var(--MENU-SECTION-HR-color, #606060);
|
||||||
|
|
||||||
|
--INTERNAL-BOX-CAPTION-color: var(--BOX-CAPTION-color, rgba( 255, 255, 255, 1 ));
|
||||||
|
--INTERNAL-BOX-BG-color: var(--BOX-BG-color, rgba( 255, 255, 255, .833 ));
|
||||||
|
--INTERNAL-BOX-TEXT-color: var(--BOX-TEXT-color, var(--INTERNAL-MAIN-TEXT-color));
|
||||||
|
|
||||||
|
--INTERNAL-BOX-BLUE-color: var(--BOX-BLUE-color, rgba( 48, 117, 229, 1 ));
|
||||||
|
--INTERNAL-BOX-GREEN-color: var(--BOX-GREEN-color, rgba( 42, 178, 24, 1 ));
|
||||||
|
--INTERNAL-BOX-GREY-color: var(--BOX-GREY-color, rgba( 128, 128, 128, 1 ));
|
||||||
|
--INTERNAL-BOX-ORANGE-color: var(--BOX-ORANGE-color, rgba( 237, 153, 9, 1 ));
|
||||||
|
--INTERNAL-BOX-RED-color: var(--BOX-RED-color, rgba( 224, 62, 62, 1 ));
|
||||||
|
|
||||||
|
--INTERNAL-BOX-INFO-color: var(--BOX-INFO-color, var(--INTERNAL-BOX-BLUE-color));
|
||||||
|
--INTERNAL-BOX-NEUTRAL-color: var(--BOX-NEUTRAL-color, var(--INTERNAL-BOX-GREY-color));
|
||||||
|
--INTERNAL-BOX-NOTE-color: var(--BOX-NOTE-color, var(--INTERNAL-BOX-ORANGE-color));
|
||||||
|
--INTERNAL-BOX-TIP-color: var(--BOX-TIP-color, var(--INTERNAL-BOX-GREEN-color));
|
||||||
|
--INTERNAL-BOX-WARNING-color: var(--BOX-WARNING-color, var(--INTERNAL-BOX-RED-color));
|
||||||
|
|
||||||
|
--INTERNAL-BOX-BLUE-TEXT-color: var(--BOX-BLUE-TEXT-color, var(--INTERNAL-BOX-TEXT-color));
|
||||||
|
--INTERNAL-BOX-GREEN-TEXT-color: var(--BOX-GREEN-TEXT-color, var(--INTERNAL-BOX-TEXT-color));
|
||||||
|
--INTERNAL-BOX-GREY-TEXT-color: var(--BOX-GREY-TEXT-color, var(--INTERNAL-BOX-TEXT-color));
|
||||||
|
--INTERNAL-BOX-ORANGE-TEXT-color: var(--BOX-ORANGE-TEXT-color, var(--INTERNAL-BOX-TEXT-color));
|
||||||
|
--INTERNAL-BOX-RED-TEXT-color: var(--BOX-RED-TEXT-color, var(--INTERNAL-BOX-TEXT-color));
|
||||||
|
|
||||||
|
--INTERNAL-BOX-INFO-TEXT-color: var(--BOX-INFO-TEXT-color, var(--INTERNAL-BOX-BLUE-TEXT-color));
|
||||||
|
--INTERNAL-BOX-NEUTRAL-TEXT-color: var(--BOX-NEUTRAL-TEXT-color, var(--INTERNAL-BOX-GREY-TEXT-color));
|
||||||
|
--INTERNAL-BOX-NOTE-TEXT-color: var(--BOX-NOTE-TEXT-color, var(--INTERNAL-BOX-ORANGE-TEXT-color));
|
||||||
|
--INTERNAL-BOX-TIP-TEXT-color: var(--BOX-TIP-TEXT-color, var(--INTERNAL-BOX-GREEN-TEXT-color));
|
||||||
|
--INTERNAL-BOX-WARNING-TEXT-color: var(--BOX-WARNING-TEXT-color, var(--INTERNAL-BOX-RED-TEXT-color));
|
||||||
|
|
||||||
|
/* print style, values taken from relearn-light as it is used as a default print style */
|
||||||
|
--INTERNAL-PRINT-MAIN-BG-color: var(--PRINT-MAIN-BG-color, #ffffff);
|
||||||
|
--INTERNAL-PRINT-CODE-font: var(--PRINT-CODE-font, "Consolas", menlo, monospace);
|
||||||
|
--INTERNAL-PRINT-TAG-BG-color: var(--PRINT-TAG-BG-color, #7dc903);
|
||||||
|
--INTERNAL-PRINT-MAIN-font: var(--PRINT-MAIN-font, "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif);
|
||||||
|
--INTERNAL-PRINT-MAIN-TEXT-color: var(--PRINT-MAIN-TEXT-color, #101010);
|
||||||
|
--INTERNAL-PRINT-MERMAID-theme: var(--PRINT-MERMAID-theme, default);
|
||||||
|
--INTERNAL-PRINT-OPENAPI-theme: var(--PRINT-OPENAPI-theme, var(--PRINT-SWAGGER-theme, light));
|
||||||
|
--INTERNAL-PRINT-OPENAPI-CODE-theme: var(--PRINT-OPENAPI-CODE-theme, obsidian);
|
||||||
|
}
|
|
@ -1,107 +1,4 @@
|
||||||
:root {
|
@import "variant-internal.css";
|
||||||
/* initially use section background to avoid flickering on load when a non default variant is active;
|
|
||||||
this is only possible because every color variant defines this variable, otherwise we would have been lost */
|
|
||||||
--INTERNAL-PRIMARY-color: var(--PRIMARY-color, var(--MENU-HEADER-BG-color, rgba( 0, 0, 0, 0 ))); /* not --INTERNAL-MENU-HEADER-BG-color */
|
|
||||||
--INTERNAL-SECONDARY-color: var(--SECONDARY-color, var(--MAIN-LINK-color, #486ac9)); /* not --INTERNAL-MAIN-LINK-color */
|
|
||||||
--INTERNAL-ACCENT-color: var(--ACCENT-color, #ffff00);
|
|
||||||
|
|
||||||
--INTERNAL-MAIN-LINK-color: var(--MAIN-LINK-color, var(--SECONDARY-color, #486ac9)); /* not --INTERNAL-SECONDARY-color */
|
|
||||||
--INTERNAL-MAIN-LINK-HOVER-color: var(--MAIN-LINK-HOVER-color, var(--INTERNAL-MAIN-LINK-color));
|
|
||||||
--INTERNAL-MAIN-BG-color: var(--MAIN-BG-color, #ffffff);
|
|
||||||
|
|
||||||
--INTERNAL-MAIN-TEXT-color: var(--MAIN-TEXT-color, #101010);
|
|
||||||
--INTERNAL-MAIN-TITLES-TEXT-color: var(--MAIN-TITLES-TEXT-color, var(--INTERNAL-MAIN-TEXT-color));
|
|
||||||
|
|
||||||
--INTERNAL-MAIN-TITLES-H1-color: var(--MAIN-TITLES-H1-color, var(--INTERNAL-MAIN-TEXT-color));
|
|
||||||
--INTERNAL-MAIN-TITLES-H2-color: var(--MAIN-TITLES-H2-color, var(--INTERNAL-MAIN-TITLES-TEXT-color));
|
|
||||||
--INTERNAL-MAIN-TITLES-H3-color: var(--MAIN-TITLES-H3-color, var(--INTERNAL-MAIN-TITLES-H2-color));
|
|
||||||
--INTERNAL-MAIN-TITLES-H4-color: var(--MAIN-TITLES-H4-color, var(--INTERNAL-MAIN-TITLES-H3-color));
|
|
||||||
--INTERNAL-MAIN-TITLES-H5-color: var(--MAIN-TITLES-H5-color, var(--INTERNAL-MAIN-TITLES-H4-color));
|
|
||||||
--INTERNAL-MAIN-TITLES-H6-color: var(--MAIN-TITLES-H6-color, var(--INTERNAL-MAIN-TITLES-H5-color));
|
|
||||||
|
|
||||||
--INTERNAL-MAIN-font: var(--MAIN-font, "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif);
|
|
||||||
--INTERNAL-MAIN-TITLES-TEXT-font: var(--MAIN-TITLES-TEXT-font, var(--INTERNAL-MAIN-font));
|
|
||||||
|
|
||||||
--INTERNAL-MAIN-TITLES-H1-font: var(--MAIN-TITLES-H1-font, var(--INTERNAL-MAIN-font));
|
|
||||||
--INTERNAL-MAIN-TITLES-H2-font: var(--MAIN-TITLES-H2-font, var(--INTERNAL-MAIN-TITLES-TEXT-font));
|
|
||||||
--INTERNAL-MAIN-TITLES-H3-font: var(--MAIN-TITLES-H3-font, var(--INTERNAL-MAIN-TITLES-H2-font));
|
|
||||||
--INTERNAL-MAIN-TITLES-H4-font: var(--MAIN-TITLES-H4-font, var(--INTERNAL-MAIN-TITLES-H3-font));
|
|
||||||
--INTERNAL-MAIN-TITLES-H5-font: var(--MAIN-TITLES-H5-font, var(--INTERNAL-MAIN-TITLES-H4-font));
|
|
||||||
--INTERNAL-MAIN-TITLES-H6-font: var(--MAIN-TITLES-H6-font, var(--INTERNAL-MAIN-TITLES-H5-font));
|
|
||||||
|
|
||||||
--INTERNAL-CODE-BLOCK-color: var(--CODE-BLOCK-color, var(--MAIN-CODE-color, #000000));
|
|
||||||
--INTERNAL-CODE-BLOCK-BG-color: var(--CODE-BLOCK-BG-color, var(--MAIN-CODE-BG-color, #f8f8f8));
|
|
||||||
--INTERNAL-CODE-BLOCK-BORDER-color: var(--CODE-BLOCK-BORDER-color, var(--MAIN-CODE-BG-color, var(--INTERNAL-CODE-BLOCK-BG-color)));
|
|
||||||
|
|
||||||
--INTERNAL-CODE-INLINE-color: var(--CODE-INLINE-color, #5e5e5e);
|
|
||||||
--INTERNAL-CODE-INLINE-BG-color: var(--CODE-INLINE-BG-color, #fffae9);
|
|
||||||
--INTERNAL-CODE-INLINE-BORDER-color: var(--CODE-INLINE-BORDER-color, #fbf0cb);
|
|
||||||
|
|
||||||
--INTERNAL-CODE-font: var(--CODE-font, "Consolas", menlo, monospace);
|
|
||||||
|
|
||||||
--INTERNAL-BROWSER-theme: var(--BROWSER-theme, light);
|
|
||||||
--INTERNAL-MERMAID-theme: var(--CONFIG-MERMAID-theme, var(--MERMAID-theme, var(--INTERNAL-PRINT-MERMAID-theme)));
|
|
||||||
--INTERNAL-SWAGGER-theme: var(--CONFIG-SWAGGER-theme, var(--SWAGGER-theme, var(--INTERNAL-PRINT-SWAGGER-theme)));
|
|
||||||
|
|
||||||
--INTERNAL-TAG-BG-color: var(--TAG-BG-color, var(--INTERNAL-PRIMARY-color));
|
|
||||||
|
|
||||||
--INTERNAL-MENU-HEADER-BG-color: var(--MENU-HEADER-BG-color, var(--PRIMARY-color, rgba( 0, 0, 0, 0 ))); /* not --INTERNAL-PRIMARY-color */
|
|
||||||
--INTERNAL-MENU-HEADER-BORDER-color: var(--MENU-HEADER-BORDER-color, var(--INTERNAL-MENU-HEADER-BG-color));
|
|
||||||
|
|
||||||
--INTERNAL-MENU-HOME-LINK-color: var(--MENU-HOME-LINK-color, #323232);
|
|
||||||
--INTERNAL-MENU-HOME-LINK-HOVER-color: var(--MENU-HOME-LINK-HOVER-color, var(--MENU-HOME-LINK-HOVERED-color, #808080));
|
|
||||||
|
|
||||||
--INTERNAL-MENU-SEARCH-color: var(--MENU-SEARCH-color, var(--MENU-SEARCH-BOX-ICONS-color, #e0e0e0));
|
|
||||||
--INTERNAL-MENU-SEARCH-BG-color: var(--MENU-SEARCH-BG-color, #323232);
|
|
||||||
--INTERNAL-MENU-SEARCH-BORDER-color: var(--MENU-SEARCH-BORDER-color, var(--MENU-SEARCH-BOX-color, var(--INTERNAL-MENU-SEARCH-BG-color)));
|
|
||||||
|
|
||||||
--INTERNAL-MENU-SECTIONS-ACTIVE-BG-color: var(--MENU-SECTIONS-ACTIVE-BG-color, rgba( 0, 0, 0, .166 ));
|
|
||||||
--INTERNAL-MENU-SECTIONS-BG-color: var(--MENU-SECTIONS-BG-color, #282828);
|
|
||||||
--INTERNAL-MENU-SECTIONS-LINK-color: var(--MENU-SECTIONS-LINK-color, #bababa);
|
|
||||||
--INTERNAL-MENU-SECTIONS-LINK-HOVER-color: var(--MENU-SECTIONS-LINK-HOVER-color, var(--INTERNAL-MENU-SECTIONS-LINK-color));
|
|
||||||
--INTERNAL-MENU-SECTION-ACTIVE-CATEGORY-color: var(--MENU-SECTION-ACTIVE-CATEGORY-color, #444444);
|
|
||||||
--INTERNAL-MENU-SECTION-ACTIVE-CATEGORY-BG-color: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color, var(--INTERNAL-MAIN-BG-color));
|
|
||||||
|
|
||||||
--INTERNAL-MENU-VISITED-color: var(--MENU-VISITED-color, var(--INTERNAL-SECONDARY-color));
|
|
||||||
--INTERNAL-MENU-SECTION-HR-color: var(--MENU-SECTION-HR-color, #606060);
|
|
||||||
|
|
||||||
--INTERNAL-BOX-CAPTION-color: var(--BOX-CAPTION-color, rgba( 255, 255, 255, 1 ));
|
|
||||||
--INTERNAL-BOX-BG-color: var(--BOX-BG-color, rgba( 255, 255, 255, .833 ));
|
|
||||||
--INTERNAL-BOX-TEXT-color: var(--BOX-TEXT-color, var(--INTERNAL-MAIN-TEXT-color));
|
|
||||||
|
|
||||||
--INTERNAL-BOX-BLUE-color: var(--BOX-BLUE-color, rgba( 48, 117, 229, 1 ));
|
|
||||||
--INTERNAL-BOX-GREEN-color: var(--BOX-GREEN-color, rgba( 42, 178, 24, 1 ));
|
|
||||||
--INTERNAL-BOX-GREY-color: var(--BOX-GREY-color, rgba( 128, 128, 128, 1 ));
|
|
||||||
--INTERNAL-BOX-ORANGE-color: var(--BOX-ORANGE-color, rgba( 237, 153, 9, 1 ));
|
|
||||||
--INTERNAL-BOX-RED-color: var(--BOX-RED-color, rgba( 224, 62, 62, 1 ));
|
|
||||||
|
|
||||||
--INTERNAL-BOX-INFO-color: var(--BOX-INFO-color, var(--INTERNAL-BOX-BLUE-color));
|
|
||||||
--INTERNAL-BOX-NEUTRAL-color: var(--BOX-NEUTRAL-color, var(--INTERNAL-BOX-GREY-color));
|
|
||||||
--INTERNAL-BOX-NOTE-color: var(--BOX-NOTE-color, var(--INTERNAL-BOX-ORANGE-color));
|
|
||||||
--INTERNAL-BOX-TIP-color: var(--BOX-TIP-color, var(--INTERNAL-BOX-GREEN-color));
|
|
||||||
--INTERNAL-BOX-WARNING-color: var(--BOX-WARNING-color, var(--INTERNAL-BOX-RED-color));
|
|
||||||
|
|
||||||
--INTERNAL-BOX-BLUE-TEXT-color: var(--BOX-BLUE-TEXT-color, var(--INTERNAL-BOX-TEXT-color));
|
|
||||||
--INTERNAL-BOX-GREEN-TEXT-color: var(--BOX-GREEN-TEXT-color, var(--INTERNAL-BOX-TEXT-color));
|
|
||||||
--INTERNAL-BOX-GREY-TEXT-color: var(--BOX-GREY-TEXT-color, var(--INTERNAL-BOX-TEXT-color));
|
|
||||||
--INTERNAL-BOX-ORANGE-TEXT-color: var(--BOX-ORANGE-TEXT-color, var(--INTERNAL-BOX-TEXT-color));
|
|
||||||
--INTERNAL-BOX-RED-TEXT-color: var(--BOX-RED-TEXT-color, var(--INTERNAL-BOX-TEXT-color));
|
|
||||||
|
|
||||||
--INTERNAL-BOX-INFO-TEXT-color: var(--BOX-INFO-TEXT-color, var(--INTERNAL-BOX-BLUE-TEXT-color));
|
|
||||||
--INTERNAL-BOX-NEUTRAL-TEXT-color: var(--BOX-NEUTRAL-TEXT-color, var(--INTERNAL-BOX-GREY-TEXT-color));
|
|
||||||
--INTERNAL-BOX-NOTE-TEXT-color: var(--BOX-NOTE-TEXT-color, var(--INTERNAL-BOX-ORANGE-TEXT-color));
|
|
||||||
--INTERNAL-BOX-TIP-TEXT-color: var(--BOX-TIP-TEXT-color, var(--INTERNAL-BOX-GREEN-TEXT-color));
|
|
||||||
--INTERNAL-BOX-WARNING-TEXT-color: var(--BOX-WARNING-TEXT-color, var(--INTERNAL-BOX-RED-TEXT-color));
|
|
||||||
|
|
||||||
/* print style, values taken from relearn-light as it is used as a default print style */
|
|
||||||
--INTERNAL-PRINT-MAIN-BG-color: var(--PRINT-MAIN-BG-color, #ffffff);
|
|
||||||
--INTERNAL-PRINT-CODE-font: var(--PRINT-CODE-font, "Consolas", menlo, monospace);
|
|
||||||
--INTERNAL-PRINT-TAG-BG-color: var(--PRINT-TAG-BG-color, #7dc903);
|
|
||||||
--INTERNAL-PRINT-MAIN-font: var(--PRINT-MAIN-font, "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif);
|
|
||||||
--INTERNAL-PRINT-MAIN-TEXT-color: var(--PRINT-MAIN-TEXT-color, #101010);
|
|
||||||
--INTERNAL-PRINT-MERMAID-theme: var(--PRINT-MERMAID-theme, default);
|
|
||||||
--INTERNAL-PRINT-SWAGGER-theme: var(--PRINT-SWAGGER-theme, light);
|
|
||||||
}
|
|
||||||
|
|
||||||
html {
|
html {
|
||||||
color-scheme: only var(--INTERNAL-BROWSER-theme);
|
color-scheme: only var(--INTERNAL-BROWSER-theme);
|
||||||
|
|
3789
static/js/rapidoc-min.js
vendored
3789
static/js/rapidoc-min.js
vendored
File diff suppressed because one or more lines are too long
3
static/js/swagger-ui/swagger-ui-bundle.js
Normal file
3
static/js/swagger-ui/swagger-ui-bundle.js
Normal file
File diff suppressed because one or more lines are too long
3
static/js/swagger-ui/swagger-ui-standalone-preset.js
Normal file
3
static/js/swagger-ui/swagger-ui-standalone-preset.js
Normal file
File diff suppressed because one or more lines are too long
3
static/js/swagger-ui/swagger-ui.css
Normal file
3
static/js/swagger-ui/swagger-ui.css
Normal file
File diff suppressed because one or more lines are too long
|
@ -9,6 +9,7 @@ if( isIE ){
|
||||||
else{
|
else{
|
||||||
document.querySelector( 'body' ).classList.add( 'mobile-support' );
|
document.querySelector( 'body' ).classList.add( 'mobile-support' );
|
||||||
}
|
}
|
||||||
|
|
||||||
var isPrint = document.querySelector( 'body' ).classList.contains( 'print' );
|
var isPrint = document.querySelector( 'body' ).classList.contains( 'print' );
|
||||||
|
|
||||||
var isRtl = document.querySelector( 'html' ).getAttribute( 'dir' ) == 'rtl';
|
var isRtl = document.querySelector( 'html' ).getAttribute( 'dir' ) == 'rtl';
|
||||||
|
@ -29,10 +30,6 @@ var touchsupport = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0)
|
||||||
|
|
||||||
var formelements = 'button, datalist, fieldset, input, label, legend, meter, optgroup, option, output, progress, select, textarea';
|
var formelements = 'button, datalist, fieldset, input, label, legend, meter, optgroup, option, output, progress, select, textarea';
|
||||||
|
|
||||||
// rapidoc: #280 disable broad document syntax highlightning
|
|
||||||
window.Prism = window.Prism || {};
|
|
||||||
Prism.manual = true;
|
|
||||||
|
|
||||||
// PerfectScrollbar
|
// PerfectScrollbar
|
||||||
var psc;
|
var psc;
|
||||||
var psm;
|
var psm;
|
||||||
|
@ -261,7 +258,11 @@ function initMermaid( update, attrs ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initSwagger( update, attrs ){
|
function initOpenapi( update, attrs ){
|
||||||
|
if( isIE ){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var state = this;
|
var state = this;
|
||||||
if( update && !state.is_initialized ){
|
if( update && !state.is_initialized ){
|
||||||
return;
|
return;
|
||||||
|
@ -273,34 +274,157 @@ function initSwagger( update, attrs ){
|
||||||
if( !state.is_initialized ){
|
if( !state.is_initialized ){
|
||||||
state.is_initialized = true;
|
state.is_initialized = true;
|
||||||
window.addEventListener( 'beforeprint', function(){
|
window.addEventListener( 'beforeprint', function(){
|
||||||
initSwagger( true, {
|
initOpenapi( true, { isPrintPreview: true } );
|
||||||
'bg-color': variants.getColorValue( 'PRINT-MAIN-BG-color' ),
|
|
||||||
'mono-font': variants.getColorValue( 'PRINT-CODE-font' ),
|
|
||||||
'primary-color': variants.getColorValue( 'PRINT-TAG-BG-color' ),
|
|
||||||
'regular-font': variants.getColorValue( 'PRINT-MAIN-font' ),
|
|
||||||
'text-color': variants.getColorValue( 'PRINT-MAIN-TEXT-color' ),
|
|
||||||
'theme': variants.getColorValue( 'PRINT-SWAGGER-theme' ),
|
|
||||||
});
|
|
||||||
}.bind( this ) );
|
}.bind( this ) );
|
||||||
window.addEventListener( 'afterprint', function(){
|
window.addEventListener( 'afterprint', function(){
|
||||||
initSwagger( true );
|
initOpenapi( true, { isPrintPreview: false } );
|
||||||
}.bind( this ) );
|
}.bind( this ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
attrs = attrs || {
|
attrs = attrs || {
|
||||||
'bg-color': variants.getColorValue( 'MAIN-BG-color' ),
|
isPrintPreview: false
|
||||||
'mono-font': variants.getColorValue( 'CODE-font' ),
|
|
||||||
'primary-color': variants.getColorValue( 'TAG-BG-color' ),
|
|
||||||
'regular-font': variants.getColorValue( 'MAIN-font' ),
|
|
||||||
'text-color': variants.getColorValue( 'MAIN-TEXT-color' ),
|
|
||||||
'theme': variants.getColorValue( 'SWAGGER-theme' ),
|
|
||||||
};
|
};
|
||||||
document.querySelectorAll( 'rapi-doc' ).forEach( function( e ){
|
|
||||||
Object.keys( attrs ).forEach( function( key ){
|
function addFunctionToResizeEvent(){
|
||||||
/* this doesn't work for FF 102, maybe related to custom elements? */
|
|
||||||
e.setAttribute( key, attrs[key] );
|
}
|
||||||
|
function getFirstAncestorByClass(){
|
||||||
|
|
||||||
|
}
|
||||||
|
function renderOpenAPI(oc) {
|
||||||
|
var buster = window.themeUseOpenapi.assetsBuster ? '?' + window.themeUseOpenapi.assetsBuster : '';
|
||||||
|
var print = isPrint || attrs.isPrintPreview ? "PRINT-" : "";
|
||||||
|
var theme = print ? `${baseUri}/css/theme-relearn-light.css` : document.querySelector( '#variant-style' ).attributes.href.value
|
||||||
|
var swagger_theme = variants.getColorValue( print + 'OPENAPI-theme' );
|
||||||
|
var swagger_code_theme = variants.getColorValue( print + 'OPENAPI-CODE-theme' );
|
||||||
|
|
||||||
|
const openapiId = 'relearn-swagger-ui';
|
||||||
|
const openapiIframeId = openapiId + "-iframe";
|
||||||
|
const openapiIframe = document.getElementById(openapiIframeId);
|
||||||
|
if (openapiIframe) {
|
||||||
|
openapiIframe.remove();
|
||||||
|
}
|
||||||
|
const openapiErrorId = openapiId + '-error';
|
||||||
|
const openapiError = document.getElementById(openapiErrorId);
|
||||||
|
if (openapiError) {
|
||||||
|
openapiError.remove();
|
||||||
|
}
|
||||||
|
const oi = document.createElement('iframe');
|
||||||
|
oi.id = openapiIframeId;
|
||||||
|
oi.classList.toggle('sc-openapi-iframe', true);
|
||||||
|
oi.srcdoc =
|
||||||
|
'<!doctype html>' +
|
||||||
|
'<html lang="en">' +
|
||||||
|
'<head>' +
|
||||||
|
'<link rel="stylesheet" href="' + window.themeUseOpenapi.css + '">' +
|
||||||
|
'<link rel="stylesheet" href="' + theme + '">' +
|
||||||
|
'<link rel="stylesheet" href="' + baseUri + '/css/swagger.css' + buster + '">' +
|
||||||
|
'<link rel="stylesheet" href="' + baseUri + '/css/swagger-' + swagger_theme + '.css' + buster + '">' +
|
||||||
|
'</head>' +
|
||||||
|
'<body>' +
|
||||||
|
'<a class="relearn-expander" href="" onclick="return relearn_collapse_all()">Collapse all</a>' +
|
||||||
|
'<a class="relearn-expander" href="" onclick="return relearn_expand_all()">Exapnd all</a>' +
|
||||||
|
'<div id="relearn-swagger-ui"></div>' +
|
||||||
|
'<script>' +
|
||||||
|
'function relearn_expand_all(){' +
|
||||||
|
'document.querySelectorAll( ".opblock-summary-control[aria-expanded=false]" ).forEach( btn => btn.click() );' +
|
||||||
|
'document.querySelectorAll( ".model-container > .model-box > button[aria-expanded=false]" ).forEach( btn => btn.click() );' +
|
||||||
|
'return false;' +
|
||||||
|
'}' +
|
||||||
|
'function relearn_collapse_all(){' +
|
||||||
|
'document.querySelectorAll( ".opblock-summary-control[aria-expanded=true]" ).forEach( btn => btn.click() );' +
|
||||||
|
'document.querySelectorAll( ".model-container > .model-box > .model-box > .model > span > button[aria-expanded=true]" ).forEach( btn => btn.click() );' +
|
||||||
|
'return false;' +
|
||||||
|
'}' +
|
||||||
|
'</script>' +
|
||||||
|
'</body>' +
|
||||||
|
'</html>';
|
||||||
|
oi.height = '100%';
|
||||||
|
oi.width = '100%';
|
||||||
|
oi.onload = function(){
|
||||||
|
const openapiWrapper = getFirstAncestorByClass(oc, 'sc-openapi-wrapper');
|
||||||
|
const openapiPromise = new Promise( function(resolve){ resolve() });
|
||||||
|
openapiPromise
|
||||||
|
.then( function(){
|
||||||
|
SwaggerUIBundle({
|
||||||
|
defaultModelsExpandDepth: 2,
|
||||||
|
defaultModelExpandDepth: 2,
|
||||||
|
docExpansion: isPrint || attrs.isPrintPreview ? 'full' : 'list',
|
||||||
|
domNode: oi.contentWindow.document.getElementById(openapiId),
|
||||||
|
filter: !( isPrint || attrs.isPrintPreview ),
|
||||||
|
layout: 'BaseLayout',
|
||||||
|
onComplete: function(){
|
||||||
|
if( isPrint || attrs.isPrintPreview ){
|
||||||
|
oi.contentWindow.document.querySelectorAll( '.model-container > .model-box > button[aria-expanded=false]' ).forEach( function(btn){ btn.click() });
|
||||||
|
setOpenAPIHeight(oi);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
SwaggerUIBundle.plugins.DownloadUrl
|
||||||
|
],
|
||||||
|
presets: [
|
||||||
|
SwaggerUIBundle.presets.apis,
|
||||||
|
SwaggerUIStandalonePreset,
|
||||||
|
],
|
||||||
|
syntaxHighlight: {
|
||||||
|
activated: true,
|
||||||
|
theme: swagger_code_theme,
|
||||||
|
},
|
||||||
|
url: oc.getAttribute('openapi-url'),
|
||||||
|
validatorUrl: 'none',
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.then( function(){
|
||||||
|
let observerCallback = function () {
|
||||||
|
setOpenAPIHeight(oi);
|
||||||
|
};
|
||||||
|
let observer = new MutationObserver(observerCallback);
|
||||||
|
observer.observe(oi.contentWindow.document.documentElement, {
|
||||||
|
childList: true,
|
||||||
|
subtree: true,
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.then( function(){
|
||||||
|
if (openapiWrapper) {
|
||||||
|
openapiWrapper.classList.toggle('is-loading', false);
|
||||||
|
}
|
||||||
|
setOpenAPIHeight(oi);
|
||||||
|
})
|
||||||
|
.catch( function(error){
|
||||||
|
const ed = document.createElement('div');
|
||||||
|
ed.classList.add('sc-alert', 'sc-alert-error');
|
||||||
|
ed.innerHTML = error;
|
||||||
|
ed.id = openapiErrorId;
|
||||||
|
while (oc.lastChild) {
|
||||||
|
oc.removeChild(oc.lastChild);
|
||||||
|
}
|
||||||
|
if (openapiWrapper) {
|
||||||
|
openapiWrapper.classList.toggle('is-loading', false);
|
||||||
|
openapiWrapper.insertAdjacentElement('afterbegin', ed);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
oc.appendChild(oi);
|
||||||
|
}
|
||||||
|
function setOpenAPIHeight(oi) {
|
||||||
|
// add empirical offset if in print preview (GC 103)
|
||||||
|
oi.style.height =
|
||||||
|
(oi.contentWindow.document.documentElement.getBoundingClientRect().height + (attrs.isPrintPreview ? 200 : 0) )+
|
||||||
|
'px';
|
||||||
|
}
|
||||||
|
function resizeOpenAPI() {
|
||||||
|
let divi = document.getElementsByClassName('sc-openapi-iframe');
|
||||||
|
for (let i = 0; i < divi.length; i++) {
|
||||||
|
setOpenAPIHeight(divi[i]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
let divo = document.getElementsByClassName('sc-openapi-container');
|
||||||
|
for (let i = 0; i < divo.length; i++) {
|
||||||
|
renderOpenAPI(divo[i]);
|
||||||
|
}
|
||||||
|
if (divo.length) {
|
||||||
|
addFunctionToResizeEvent(resizeOpenAPI);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initAnchorClipboard(){
|
function initAnchorClipboard(){
|
||||||
|
@ -1122,7 +1246,7 @@ function initSearch() {
|
||||||
ready( function(){
|
ready( function(){
|
||||||
initArrowNav();
|
initArrowNav();
|
||||||
initMermaid();
|
initMermaid();
|
||||||
initSwagger();
|
initOpenapi();
|
||||||
initMenuScrollbar();
|
initMenuScrollbar();
|
||||||
initToc();
|
initToc();
|
||||||
initAnchorClipboard();
|
initAnchorClipboard();
|
||||||
|
@ -1153,12 +1277,11 @@ if( window.themeUseMermaid ){
|
||||||
useMermaid( window.themeUseMermaid );
|
useMermaid( window.themeUseMermaid );
|
||||||
}
|
}
|
||||||
|
|
||||||
function useSwagger( config ){
|
function useOpenapi( config ){
|
||||||
if( config.theme && variants ){
|
if( config.css && config.css.startsWith( '/' ) ){
|
||||||
var write_style = variants.findLoadedStylesheet( 'variant-style' );
|
config.css = baseUri + config.css;
|
||||||
write_style.setProperty( '--CONFIG-SWAGGER-theme', config.theme );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( window.themeUseSwagger ){
|
if( window.themeUseOpenapi ){
|
||||||
useSwagger( window.themeUseSwagger );
|
useOpenapi( window.themeUseOpenapi );
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ var variants = {
|
||||||
if( this.isVariantLoaded() ){
|
if( this.isVariantLoaded() ){
|
||||||
clearInterval( interval_id );
|
clearInterval( interval_id );
|
||||||
initMermaid( true );
|
initMermaid( true );
|
||||||
initSwagger( true );
|
initOpenapi( true );
|
||||||
}
|
}
|
||||||
}.bind( this ), 25 );
|
}.bind( this ), 25 );
|
||||||
// remove selection, because if some uses an arrow navigation"
|
// remove selection, because if some uses an arrow navigation"
|
||||||
|
@ -577,7 +577,8 @@ var variants = {
|
||||||
|
|
||||||
{ name: 'BROWSER-theme', group: '3rd party', default: 'light', tooltip: 'name of the theme for browser scrollbars of the main section', },
|
{ name: 'BROWSER-theme', group: '3rd party', default: 'light', tooltip: 'name of the theme for browser scrollbars of the main section', },
|
||||||
{ name: 'MERMAID-theme', group: '3rd party', default: 'default', tooltip: 'name of the default Mermaid theme for this variant, can be overridden in config.toml', },
|
{ name: 'MERMAID-theme', group: '3rd party', default: 'default', tooltip: 'name of the default Mermaid theme for this variant, can be overridden in config.toml', },
|
||||||
{ name: 'SWAGGER-theme', group: '3rd party', default: 'light', tooltip: 'name of the default Swagger theme for this variant, can be overridden in config.toml', },
|
{ name: 'OPENAPI-theme', group: '3rd party', default: 'light', tooltip: 'name of the default OpenAPI theme for this variant, can be overridden in config.toml', },
|
||||||
|
{ name: 'OPENAPI-CODE-theme', group: '3rd party', default: 'obsidian', tooltip: 'name of the default OpenAPI coee theme for this variant, can be overridden in config.toml', },
|
||||||
|
|
||||||
{ name: 'MENU-HEADER-BG-color', group: 'header', fallback: 'PRIMARY-color', tooltip: 'background color of menu header', },
|
{ name: 'MENU-HEADER-BG-color', group: 'header', fallback: 'PRIMARY-color', tooltip: 'background color of menu header', },
|
||||||
{ name: 'MENU-HEADER-BORDER-color', group: 'header', fallback: 'MENU-HEADER-BG-color', tooltip: 'separator color of menu header', },
|
{ name: 'MENU-HEADER-BORDER-color', group: 'header', fallback: 'MENU-HEADER-BG-color', tooltip: 'separator color of menu header', },
|
||||||
|
|
|
@ -16,7 +16,7 @@ features = ["badges", "breadcrumbs", "boxes", "buttons",
|
||||||
"light", "lightbox", "logo",
|
"light", "lightbox", "logo",
|
||||||
"math", "mathjax", "menu", "mermaid", "multilingual", "mobile",
|
"math", "mathjax", "menu", "mermaid", "multilingual", "mobile",
|
||||||
"nested sections", "notice",
|
"nested sections", "notice",
|
||||||
"openapi specification", "oas", "offline usable",
|
"openapi", "oas", "offline usable",
|
||||||
"print", "printable",
|
"print", "printable",
|
||||||
"responsive", "rss", "rtl",
|
"responsive", "rss", "rtl",
|
||||||
"sidebar", "sitemap",
|
"sidebar", "sitemap",
|
||||||
|
|
|
@ -439,15 +439,15 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Swagger": {
|
"OpenAPI": {
|
||||||
"body": [
|
"body": [
|
||||||
"{{< swagger src=\"[[&src]]\" >}}"
|
"{{< openapi src=\"[[&src]]\" >}}"
|
||||||
],
|
],
|
||||||
"description": "Zeigt eine Swagger / Open API Specification an",
|
"description": "Zeigt eine OpenAPI / Swagger Spezifikation an",
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"name": "src",
|
"name": "src",
|
||||||
"title": "URL zur Open API Specification",
|
"title": "URL zur OpenAPI Specifikation",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -443,11 +443,11 @@
|
||||||
"body": [
|
"body": [
|
||||||
"{{< swagger src=\"[[&src]]\" >}}"
|
"{{< swagger src=\"[[&src]]\" >}}"
|
||||||
],
|
],
|
||||||
"description": "Displays a Swagger / Open API Specification",
|
"description": "Displays a OpenAPI / Swagger specification",
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"name": "src",
|
"name": "src",
|
||||||
"title": "URL to the Open API Specification",
|
"title": "URL to the OpenAPI specification",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue