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.43.tar.gz (165.9 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.43-py3-none-any.whl (203.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: reflex_site_shared-0.0.43.tar.gz
  • Upload date:
  • Size: 165.9 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.43.tar.gz
Algorithm Hash digest
SHA256 b7b0a850e5c6931ca0113d933faab60169bd278ffa465b591e1e71577ee1e780
MD5 1d2fd83c2aa2e36544f8ff24a8696504
BLAKE2b-256 59b48d0071c4b44c3d8ff6fe3b872a6d325742ac2aa9da4012161bf288a5dd7f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: reflex_site_shared-0.0.43-py3-none-any.whl
  • Upload date:
  • Size: 203.1 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.43-py3-none-any.whl
Algorithm Hash digest
SHA256 2d16399e40f6a2607b7ceb7d3bca85e400d13c29dee49d46a5ce8b798628430f
MD5 8715850ffd2fb0c7f783592b4b277ae5
BLAKE2b-256 54561b0edc722c1a953cd1565d1f691dee61db3235da1eddedc1c6494b14e271

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