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.39.tar.gz (157.4 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.39-py3-none-any.whl (193.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: reflex_site_shared-0.0.39.tar.gz
  • Upload date:
  • Size: 157.4 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.39.tar.gz
Algorithm Hash digest
SHA256 ccdecc6eba66e32f0d7c4748e8dd16b402e68b239cce54f126d785a7236c57fe
MD5 b07f3898fd58f08a9de040f4c39fbd72
BLAKE2b-256 10c4204359212b2d7c1341c54678cfdfc5d1d823ff0c6d45017443692509ba9f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: reflex_site_shared-0.0.39-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.39-py3-none-any.whl
Algorithm Hash digest
SHA256 79231c4b2c1052260fc868062ffb25f303d4419bc28bbcf3dbab5c6ec75f0862
MD5 3bd13ede1eb7190cb5b6667563f41ee0
BLAKE2b-256 2d8d30b38939892aa63c17ea73137995277088c6b3b78d572a42aa826991539b

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