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

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-25.4.7.tar.gz (651.8 kB view details)

Uploaded Source

Built Distribution

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

stopments-25.4.7-py3-none-any.whl (652.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stopments-25.4.7.tar.gz
  • Upload date:
  • Size: 651.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for stopments-25.4.7.tar.gz
Algorithm Hash digest
SHA256 57dcf6681a07883a0ac11117c410b27422d760cd1cf32528f0c4c9feb57eba7a
MD5 322d16753ef05a44b36c7239d58c4911
BLAKE2b-256 6fe0978cad99955eec68634ca511c01a1bb1c4e4ef6871520a6e12de1ed12d81

See more details on using hashes here.

Provenance

The following attestation bundles were made for stopments-25.4.7.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-25.4.7-py3-none-any.whl.

File metadata

  • Download URL: stopments-25.4.7-py3-none-any.whl
  • Upload date:
  • Size: 652.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for stopments-25.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e1f0a33e8287b3a39f10fe805759bf2a6ec7ee8cb6cd8415eb92fcd3b59d5110
MD5 73f97ec27192dcfd377537eead484d7b
BLAKE2b-256 c05d772598aea32c199c4f48c901a1883c6ef3bed335f46688049bedcba8b736

See more details on using hashes here.

Provenance

The following attestation bundles were made for stopments-25.4.7-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