Skip to main content

reflex-site-shared

Shared site scaffolding used across Reflex's web properties (pages, templates, views, gallery, styles).

Markdown documentation sites

The package can discover a directory of Markdown files, derive routes and navigation, render them with the Reflex documentation component map, and register the pages on an app.

from pathlib import Path

import reflex as rx
from reflex_site_shared import styles
from reflex_site_shared.docs import DocsLayoutConfig, DocsSiteConfig, register_docs

app = rx.App(style=styles.BASE_STYLE)

register_docs(
    app,
    DocsSiteConfig(
        content_dir=Path(__file__).parent.parent / "content",
        route_prefix="/",
        exclude=("drafts/**",),
        navigation_order=("/", "/getting-started/", "/guide/installation/"),
        sitemap_base_url="https://example.com/docs/product",
    ),
    layout_config=DocsLayoutConfig(site_title="Product Documentation"),
)

Enable the shared global CSS in rxconfig.py and install the Fontsource variable fonts referenced by its fonts.css:

from pathlib import Path

import reflex as rx
from reflex_site_shared.docs import DocsSiteConfig
from reflex_site_shared.plugins import DocsMarkdownPlugin, SharedSiteStylesPlugin

docs = DocsSiteConfig(
    content_dir=Path(__file__).parent.parent / "content",
    exclude=("drafts/**",),
)

config = rx.Config(
    app_name="docs_site",
    frontend_packages=[
        "@fontsource-variable/instrument-sans@5.2.8",
        "@fontsource-variable/jetbrains-mono@5.2.8",
    ],
    plugins=[
        rx.plugins.TailwindV4Plugin(),
        SharedSiteStylesPlugin(),
        DocsMarkdownPlugin(docs=docs),
        rx.plugins.RadixThemesPlugin(),
    ],
)

Existing sites that provide their own font CSS can use SharedSiteStylesPlugin(include_fonts=False).

DocsMarkdownPlugin serves each discovered page as Markdown using the same URL convention as the official Reflex docs. For example, /guide/installation/ is also available at /guide/installation.md and /guide/installation/.md. The site's frontend_path is prepended automatically.

The content tree defines the URL tree:

content/
├── index.md                 -> /
├── getting-started.md       -> /getting-started/
└── guide/
    └── installation.md      -> /guide/installation/

Use YAML frontmatter to override the page title and description:

---
title: Installation
description: Install and configure the product.
---

# Installation

Like the official Reflex docs, ordering lives in a centralized Python list. Use DocsSiteConfig.navigation_order to control sidebar and previous/next ordering without adding presentation metadata to each Markdown file.

build_docs_routes returns routes without registering them when the consuming app needs custom SEO or registration behavior. Both build_docs_routes and register_docs accept custom renderer and layout callables. The defaults use the shared responsive docs shell and styled Markdown components.

The default renderer uses the same reflex-docgen pipeline as Reflex's main documentation, including executable example fences, directives, tables, and the shared documentation component map. Generated component API pages can call the exported render_docgen_document helper directly.

Download files

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

Source Distribution

reflex_site_shared-0.0.40.tar.gz (157.5 kB view details)

Uploaded Source

Built Distribution

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

reflex_site_shared-0.0.40-py3-none-any.whl (193.9 kB view details)

Uploaded Python 3

File details

Details for the file reflex_site_shared-0.0.40.tar.gz.

File metadata

  • Download URL: reflex_site_shared-0.0.40.tar.gz
  • Upload date:
  • Size: 157.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","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}

File hashes

Hashes for reflex_site_shared-0.0.40.tar.gz
Algorithm Hash digest
SHA256 37d2325cddabee55a7e73d31bc37b19b71725e23a88c8984d61a371b72908f01
MD5 65956193f72499a56d3d83cf9d3be71c
BLAKE2b-256 d760be565b24d156d3100853392d077bfc6eed3304cb3784acc2eda601fe3563

See more details on using hashes here.

File details

Details for the file reflex_site_shared-0.0.40-py3-none-any.whl.

File metadata

  • Download URL: reflex_site_shared-0.0.40-py3-none-any.whl
  • Upload date:
  • Size: 193.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","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}

File hashes

Hashes for reflex_site_shared-0.0.40-py3-none-any.whl
Algorithm Hash digest
SHA256 376c4416eace482b3a2f0533cf2f34b10908a6126bdef91d63011a4f0a52487d
MD5 ee1ba9ffc606302339974213a5263cf8
BLAKE2b-256 322041967680cff6e2896ebf4409ea494379441fb29f8869e10cdd3a8722d8a9

See more details on using hashes here.

Supported by

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