Skip to main content

Stoplight elements html

Project description

Stopments

Stoplight elements static files

Refered from FastAPI's #5168 PR

It includes the following files:

  • styles.min.css
  • web-components.min.js
  • favicon.ico
  • scalar-api-reference.js (for scalar)

The static files were collected on the same date as this package version.

Installation

pip install stopments

Usage

from fastapi import FastAPI
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles

from stopments import get_stoplight_elements_html

app = FastAPI(docs_url=None, redoc_url=None)

@app.get("/docs/", include_in_schema=False)
async def docs():
    html = get_stoplight_elements_html(
        openapi_url=app.openapi_url or "/openapi.json",
        title="API Documentation",
    )
    return HTMLResponse(content=html)

or you can use embedded static files

from fastapi import FastAPI
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles

from stopments import get_stoplight_elements_html

app = FastAPI(docs_url=None, redoc_url=None)
app.mount("/static", StaticFiles(packages=[("stopments", "static")]))

@app.get("/docs/", include_in_schema=False)
async def docs():
    html = get_stoplight_elements_html(
        openapi_url=app.openapi_url or "/openapi.json",
        title="API Documentation",
        stoplight_elements_css_url="/static/styles.min.css",
        stoplight_elements_js_url="/static/web-components.min.js",
        stoplight_elements_favicon_url="/static/favicon.ico",
    )
    return HTMLResponse(content=html)

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stopments-26.7.2.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stopments-26.7.2-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file stopments-26.7.2.tar.gz.

File metadata

  • Download URL: stopments-26.7.2.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for stopments-26.7.2.tar.gz
Algorithm Hash digest
SHA256 0bafd84f7da55de71cb54395bf01b1825536f962e7bb12479b63b667498c0e0b
MD5 6730c8c7bea4f78fe61b42ee962c9255
BLAKE2b-256 63fd70179ccbfae767aabc00d39945b4a4fe81942e3da940f380935953e62b17

See more details on using hashes here.

Provenance

The following attestation bundles were made for stopments-26.7.2.tar.gz:

Publisher: release.yaml on Bing-su/stopments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stopments-26.7.2-py3-none-any.whl.

File metadata

  • Download URL: stopments-26.7.2-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for stopments-26.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 74373ae145c2036a2dcd599492a9468e5ba74aae91b1e709fc7539425c5cc46f
MD5 4914eb2583323bd44a65c451b29f357f
BLAKE2b-256 337f2a2d1c1f90b5ede310b2d35e3430f19ec6ff6e076860bbbb9fc1fbc4145d

See more details on using hashes here.

Provenance

The following attestation bundles were made for stopments-26.7.2-py3-none-any.whl:

Publisher: release.yaml on Bing-su/stopments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page