Package: mkdocs-swagger-ui-tag
MkDocs Swagger UI TagA MkDocs plugin supports addingSwagger UIto the page.Live demowithMaterial for MkDocs.FeaturesOpenAPI Specification file from online over URL or static file in docsAll dependencies are using static files handled by the plugin not from CDN, especially suitable for those documents been deployed in the intranetMultiple Swagger UI on the same pageSynchronized dark mode withMaterial for MkDocsConfigureSwagger UI configurationthrough plugin options and tag attributesSupport multiple OAS in a single Swagger UI with a top bar selectorSupport Swagger UIinitOAuthmethodDependencyPython Packagebeautifulsoup4>=4.11.1Swagger UI distjavascript file and CSS fileswagger-ui-dist==5.11.0UsageInstall the plugin from PyPIpipinstallmkdocs-swagger-ui-tagAddswagger-ui-tagplugin to your mkdocs.yml plugins sections:plugins:-swagger-ui-tagAddswagger-uitag in markdown to include Swagger UI<swagger-ui src="https://petstore.swagger.io/v2/swagger.json"/>You may customize the plugin by passing options in mkdocs.yml, check more details onoptions:plugins:-swagger-ui-tag:background:WhitedocExpansion:nonefilter:""syntaxHighlightTheme:monokaitryItOutEnabled:['get','post']OptionsTypeDescriptionbackgroundStringDefault: "". Swagger UI iframe body background attribute value. You can use any css value for background for example "#74b9ff" or "Gainsboro" or "" for nothing.docExpansionStringDefault: "list". Controls the default expansion setting for the operations and tags. It can be "list" (expands only the tags), "full" (expands the tags and operations) or "none" (expands nothing).filterString or BooleanDefault: False. If set, enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown. Can be Boolean to enable or disable, or a string, in which case filtering will be enabled using that string as the filter expression. Filtering is case sensitive matching the filter expression anywhere inside the tag.syntaxHighlightThemeStringDefault: "agate".Highlight.jssyntax coloring theme to use. It can be "agate", "arta", "monokai", "nord", "obsidian" or "tomorrow-night"tryItOutEnabledBooleanDefault: False. This setting determines the default editability of the "Try it out" section, including parameters or body.oauth2RedirectUrlStringDefault: Absolute URL of "/assets/swagger-ui/oauth2-redirect.html" relative with site_url in mkdocs.yml or document root path on site without site_url, e.g. "https://blueswen.github.io/mkdocs-swagger-ui-tag/assets/swagger-ui/oauth2-redirect.html". OAuth redirect URL.supportedSubmitMethodsArrayDefault: All Http Methods. Array=["get", "put", "post", "delete", "options", "head", "patch", "trace"]. List of HTTP methods that have the "Try it out" feature enabled. An empty array disables "Try it out" for all operations. This does not filter the operations from the display.validatorUrlStringDefault: "https://validator.swagger.io/validator". By default, Swagger UI attempts to validate specs against swagger.io's online validator in multiple OAS Swagger UI. You can use this parameter to set a different validator URL, for example for locally deployed validators (Validator Badge). Setting it "none" to disable validation.How it worksCopy the Swagger UI script file intosite/assets/javascripts/directory, the CSS file intosite/assets/stylesheets/directory, and thedefault Oauth2 redirect htmlintosite/assets/swagger-ui/directorySearch all swagger-ui tags, then convert them to an iframe tag and generate the iframe target HTML with the given OpenAPI Specification src path and optionsLicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for details.ReferenceAmoenus Swagger Dark Theme: source of dark mode css