diff --git a/docs/index.md b/docs/index.md index 7faf021..a13a572 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,6 +5,8 @@ hide: - toc --- +{% if enable_swagger_openapi %} + ![Omnissa Intelligence](assets/logos/favicon-dark.svg){ align=right } The Omnissa Intelligence (formerly Workspace ONE Intelligence) V2 API documentation describes how to query and extract data for use in other business intelligence tools. It also helps with building General Data Protection Regulation (GDPR) compliant tools and applications with REST APIs. @@ -155,3 +157,17 @@ Refer to **Table 1. API Call Limits Per Organization** in the PDF for Standard, 1. Follow **[Authentication](Authentication.md)** to configure a service account and retrieve tokens. 2. Explore endpoints in **[REST APIs](REST-APIs.md)**. 3. Compare payloads using **[Sample responses](API-sample-responses.md)**. + +{% else %} + +![Omnissa Intelligence](assets/logos/favicon-dark.svg){ align=right } + +The Omnissa Intelligence API documentation describes how to query and extract data for use in other business intelligence tools. It also helps with building General Data Protection Regulation (GDPR) compliant tools and applications with REST APIs. + +## Documentation and Reference + +| Name | Link | +| --- | --- | +| API Documentation for Omnissa Intelligence V2 | [Download PDF](https://developer.omnissa.com/omnissa-intelligence-apis/guides/DHUB-APIDocumentationforOmnissaIntelligence-V2-130326-183145.pdf){ .md-button } | + +{% endif %} diff --git a/hooks/site_config.py b/hooks/site_config.py new file mode 100644 index 0000000..7e49212 --- /dev/null +++ b/hooks/site_config.py @@ -0,0 +1,44 @@ +"""Site hooks for toggling Swagger/OpenAPI documentation.""" + +SWAGGER_OPENAPI_PAGES = ( + "Authentication.md", + "REST-APIs.md", + "API-sample-responses.md", +) + +SWAGGER_OPENAPI_NAV = ( + {"Overview": "index.md"}, + {"Authentication": "Authentication.md"}, + {"REST APIs": "REST-APIs.md"}, + {"Sample responses": "API-sample-responses.md"}, +) + + +def _is_swagger_openapi_enabled(config): + return bool(config.get("extra", {}).get("enable_swagger_openapi", False)) + + +def on_config(config): + if _is_swagger_openapi_enabled(config): + config["nav"] = list(SWAGGER_OPENAPI_NAV) + return config + + config["nav"] = ["index.md"] + config["extra_javascript"] = [ + script + for script in config.get("extra_javascript", []) + if "swagger-token-bridge" not in script + ] + return config + + +def on_files(files, config): + if _is_swagger_openapi_enabled(config): + return files + + for page in SWAGGER_OPENAPI_PAGES: + file = files.get_file_from_path(page) + if file is not None: + files.remove(file) + + return files diff --git a/mkdocs.yml b/mkdocs.yml index 3ba284f..181f3a3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -97,6 +97,11 @@ plugins: # Customization extra: homepage: https://omnissa.com + # When true, show Authentication, REST APIs (Swagger/OpenAPI), and sample responses. + enable_swagger_openapi: false + +hooks: + - hooks/site_config.py extra_css: - assets/stylesheets/extra.css @@ -145,9 +150,6 @@ markdown_extensions: - toc: permalink: true -# Navigation +# Navigation (expanded by hooks/site_config.py when enable_swagger_openapi is true) nav: - Overview: index.md - - Authentication: Authentication.md - - REST APIs: REST-APIs.md - - Sample responses: API-sample-responses.md