Skip to main content

cross-docs

Python backend utilities for Cross-Docs documentation framework.

Installation

uv add cross-docs
# or
pip install cross-docs

Usage

from pathlib import Path
from fastapi import FastAPI, Request
from cross_docs import (
    generate_nav,
    create_docs_handler,
    strip_trailing_slash_middleware,
)
from cross_inertia.fastapi import InertiaDep

app = FastAPI()
app.middleware("http")(strip_trailing_slash_middleware)

CONTENT_DIR = Path("content")
NAV = generate_nav(CONTENT_DIR / "docs")

docs_handler = create_docs_handler(CONTENT_DIR, NAV)

@app.get("/docs")
async def docs_index(request: Request, inertia: InertiaDep):
    return await docs_handler(request, inertia)

@app.get("/docs/{path:path}")
async def docs_page(path: str, request: Request, inertia: InertiaDep):
    return await docs_handler(request, inertia, path=path)

API

Markdown Utilities

  • parse_frontmatter(content: str) - Parse YAML frontmatter
  • load_markdown(content_dir: Path, path: str) - Load and parse markdown
  • load_raw_markdown(content_dir: Path, path: str) - Load raw markdown

Navigation

  • generate_nav(docs_dir, base_path, section_order, index_page) - Generate nav from files

Middleware

  • strip_trailing_slash_middleware - Redirect trailing slashes
  • wants_markdown(request) - Check Accept header for markdown

Routes

  • create_docs_handler(...) - Create a docs route handler

License

MIT

Metadata

Release files for cross-docs 0.16.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cross-docs 0.16.1
File Size Uploaded Provenance Actions
cross_docs-0.16.1.tar.gz 19.7 kB Without provenance Details for cross_docs-0.16.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cross-docs 0.16.1
File Interpreter ABI Platform Actions
cross_docs-0.16.1-py3-none-any.whl Python 3 none any Details for cross_docs-0.16.1-py3-none-any.whl

Total release size: 45.4 kB

Release files / cross_docs-0.16.1.tar.gz

Download URL cross_docs-0.16.1.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b0140bcbe8a6efcc63e483bb7055754b193af7af260cbabc29e0c917c3054f7d
BLAKE2b-256 checksum
How to use checksums
53e0908f1c3c56ae39637c509aa880123aabb1b426e1a0dbbde0cbca04a0252a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cross_docs-0.16.1-py3-none-any.whl

Download URL cross_docs-0.16.1-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
018db46c172d430807604d37b776bb1ef1068fdd4341bf692463e883a6851844
BLAKE2b-256 checksum
How to use checksums
ba247cc6ca3d3543e767e9d48c14040342587bf9a9147ad97b5b5994dcb0cb05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cross-docs 0.16.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.16.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page