instruction
stringlengths
0
1k
input
stringlengths
1
1k
output
stringlengths
10
6.51k
import reflex as rx
from reflex_ui.blocks.lemcal import lemcal_dialog VIDEO_URL = "https://youtu.be/Hy3uhBVRdtk?si=Z5szIyInkBfeG2lk&t=92s" def video_demo() -> rx.Component: return rx.el.a( rx.el.div( rx.el.div( ui.icon("PlayIcon", class_name="text-slate-1 fill-slate-1 size-5"), class_name="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 scale-100 z-[2] group-hover:scale-110 transition-transform duration-300 backdrop rounded-full bg-slate-10 size-10 flex items-center justify-center", ), rx.image( "/landing/video/tom_preview.webp", class_name="object-cover size-full scale-110", ), rx.el.span( class_name="inset-0 size-full absolute z-[1] bg-[#00000008] backdrop-blur-[0.1px] rounded-lg", ), class_name="shadow-small aspect-video rounded-xl overflow-hidden cursor-pointer relative isolate group border border-slate-4",
import reflex_ui as ui
import reflex as rx import reflex_ui as ui
VIDEO_URL = "https://youtu.be/Hy3uhBVRdtk?si=Z5szIyInkBfeG2lk&t=92s" def video_demo() -> rx.Component: return rx.el.a( rx.el.div( rx.el.div( ui.icon("PlayIcon", class_name="text-slate-1 fill-slate-1 size-5"), class_name="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 scale-100 z-[2] group-hover:scale-110 transition-transform duration-300 backdrop rounded-full bg-slate-10 size-10 flex items-center justify-center", ), rx.image( "/landing/video/tom_preview.webp", class_name="object-cover size-full scale-110", ), rx.el.span( class_name="inset-0 size-full absolute z-[1] bg-[#00000008] backdrop-blur-[0.1px] rounded-lg", ), class_name="shadow-small aspect-video rounded-xl overflow-hidden cursor-pointer relative isolate group border border-slate-4", ), to=VIDEO_URL, target="_blank
from reflex_ui.blocks.lemcal import lemcal_dialog
import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog
def video_demo() -> rx.Component: return rx.el.a( rx.el.div( rx.el.div( ui.icon("PlayIcon", class_name="text-slate-1 fill-slate-1 size-5"), class_name="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 scale-100 z-[2] group-hover:scale-110 transition-transform duration-300 backdrop rounded-full bg-slate-10 size-10 flex items-center justify-center", ), rx.image( "/landing/video/tom_preview.webp", class_name="object-cover size-full scale-110", ), rx.el.span( class_name="inset-0 size-full absolute z-[1] bg-[#00000008] backdrop-blur-[0.1px] rounded-lg", ), class_name="shadow-small aspect-video rounded-xl overflow-hidden cursor-pointer relative isolate group border border-slate-4", ), to=VIDEO_URL, target="_blank", class_name="lg:p-10 p-8", ) def text() -> rx.Componen
VIDEO_URL = "https://youtu.be/Hy3uhBVRdtk?si=Z5szIyInkBfeG2lk&t=92s"
from pcweb.components.icons.patterns import default_patterns from pcweb.meta.meta import meta_tags from pcweb.pages.demo.header import header from pcweb.templates.mainpage import mainpage @mainpage(path="/demo", title="Reflex · Book Demo", meta=meta_tags) def book_demo() -> rx.Component: """Get the Book Demo landing page.""" return rx.el.main( rx.el.section( *default_patterns(), header(), class_name="overflow-hidden w-full relative mx-auto flex flex-col justify-center items-center max-w-[64.19rem]", ), class_name="flex flex-col w-full max-w-[94.5rem] justify-center items-center mx-auto px-4 lg:px-5 relative overflow-hidden", )
import reflex as rx
import reflex as rx
from pcweb.meta.meta import meta_tags from pcweb.pages.demo.header import header from pcweb.templates.mainpage import mainpage @mainpage(path="/demo", title="Reflex · Book Demo", meta=meta_tags) def book_demo() -> rx.Component: """Get the Book Demo landing page.""" return rx.el.main( rx.el.section( *default_patterns(), header(), class_name="overflow-hidden w-full relative mx-auto flex flex-col justify-center items-center max-w-[64.19rem]", ), class_name="flex flex-col w-full max-w-[94.5rem] justify-center items-center mx-auto px-4 lg:px-5 relative overflow-hidden", )
from pcweb.components.icons.patterns import default_patterns
import reflex as rx from pcweb.components.icons.patterns import default_patterns
from pcweb.pages.demo.header import header from pcweb.templates.mainpage import mainpage @mainpage(path="/demo", title="Reflex · Book Demo", meta=meta_tags) def book_demo() -> rx.Component: """Get the Book Demo landing page.""" return rx.el.main( rx.el.section( *default_patterns(), header(), class_name="overflow-hidden w-full relative mx-auto flex flex-col justify-center items-center max-w-[64.19rem]", ), class_name="flex flex-col w-full max-w-[94.5rem] justify-center items-center mx-auto px-4 lg:px-5 relative overflow-hidden", )
from pcweb.meta.meta import meta_tags
import reflex as rx from pcweb.components.icons.patterns import default_patterns from pcweb.meta.meta import meta_tags
from pcweb.templates.mainpage import mainpage @mainpage(path="/demo", title="Reflex · Book Demo", meta=meta_tags) def book_demo() -> rx.Component: """Get the Book Demo landing page.""" return rx.el.main( rx.el.section( *default_patterns(), header(), class_name="overflow-hidden w-full relative mx-auto flex flex-col justify-center items-center max-w-[64.19rem]", ), class_name="flex flex-col w-full max-w-[94.5rem] justify-center items-center mx-auto px-4 lg:px-5 relative overflow-hidden", )
from pcweb.pages.demo.header import header
import reflex as rx from pcweb.components.icons.patterns import default_patterns from pcweb.meta.meta import meta_tags from pcweb.pages.demo.header import header
@mainpage(path="/demo", title="Reflex · Book Demo", meta=meta_tags) def book_demo() -> rx.Component: """Get the Book Demo landing page.""" return rx.el.main( rx.el.section( *default_patterns(), header(), class_name="overflow-hidden w-full relative mx-auto flex flex-col justify-center items-center max-w-[64.19rem]", ), class_name="flex flex-col w-full max-w-[94.5rem] justify-center items-center mx-auto px-4 lg:px-5 relative overflow-hidden", )
from pcweb.templates.mainpage import mainpage
import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.pages.framework.views.companies import pricing_page_companies def custom_quote_form() -> rx.Component: """Custom quote form component with clean, maintainable structure.""" return rx.box( rx.box( rx.el.h2( "Book a Demo", class_name="text-slate-12 text-4xl font-bold", ), rx.el.p( "Enterprise-ready solutions designed for scale, compliance, and support. Contact us for a tailored quote based on your infrastructure and team size.", class_name="text-slate-11 text-md leading-relaxed font-medium text-center max-w-xl mx-auto", ), lemcal_dialog( rx.el.div( ui.button( "Contact Sales", class_name="font-semibold",
import reflex as rx
import reflex as rx
from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState from pcweb.pages.framework.views.companies import pricing_page_companies def custom_quote_form() -> rx.Component: """Custom quote form component with clean, maintainable structure.""" return rx.box( rx.box( rx.el.h2( "Book a Demo", class_name="text-slate-12 text-4xl font-bold", ), rx.el.p( "Enterprise-ready solutions designed for scale, compliance, and support. Contact us for a tailored quote based on your infrastructure and team size.", class_name="text-slate-11 text-md leading-relaxed font-medium text-center max-w-xl mx-auto", ), lemcal_dialog( rx.el.div( ui.button( "Contact Sales", class_name="font-semibold", size="lg",
import reflex_ui as ui
import reflex as rx import reflex_ui as ui
from pcweb.components.hosting_banner import HostingBannerState from pcweb.pages.framework.views.companies import pricing_page_companies def custom_quote_form() -> rx.Component: """Custom quote form component with clean, maintainable structure.""" return rx.box( rx.box( rx.el.h2( "Book a Demo", class_name="text-slate-12 text-4xl font-bold", ), rx.el.p( "Enterprise-ready solutions designed for scale, compliance, and support. Contact us for a tailored quote based on your infrastructure and team size.", class_name="text-slate-11 text-md leading-relaxed font-medium text-center max-w-xl mx-auto", ), lemcal_dialog( rx.el.div( ui.button( "Contact Sales", class_name="font-semibold", size="lg", ), class_name=
from reflex_ui.blocks.lemcal import lemcal_dialog
import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog
from pcweb.pages.framework.views.companies import pricing_page_companies def custom_quote_form() -> rx.Component: """Custom quote form component with clean, maintainable structure.""" return rx.box( rx.box( rx.el.h2( "Book a Demo", class_name="text-slate-12 text-4xl font-bold", ), rx.el.p( "Enterprise-ready solutions designed for scale, compliance, and support. Contact us for a tailored quote based on your infrastructure and team size.", class_name="text-slate-11 text-md leading-relaxed font-medium text-center max-w-xl mx-auto", ), lemcal_dialog( rx.el.div( ui.button( "Contact Sales", class_name="font-semibold", size="lg", ), class_name="p-3 border border-slate-3 rounded-[1.375rem] border-solid mt-2"
from pcweb.components.hosting_banner import HostingBannerState
import reflex as rx import reflex_ui as ui from reflex_ui.blocks.lemcal import lemcal_dialog from pcweb.components.hosting_banner import HostingBannerState
def custom_quote_form() -> rx.Component: """Custom quote form component with clean, maintainable structure.""" return rx.box( rx.box( rx.el.h2( "Book a Demo", class_name="text-slate-12 text-4xl font-bold", ), rx.el.p( "Enterprise-ready solutions designed for scale, compliance, and support. Contact us for a tailored quote based on your infrastructure and team size.", class_name="text-slate-11 text-md leading-relaxed font-medium text-center max-w-xl mx-auto", ), lemcal_dialog( rx.el.div( ui.button( "Contact Sales", class_name="font-semibold", size="lg", ), class_name="p-3 border border-slate-3 rounded-[1.375rem] border-solid mt-2", ), ), rx.box( r
from pcweb.pages.framework.views.companies import pricing_page_companies
from reflex.utils.imports import ImportVar from pcweb.templates.docpage import docpage from .source import Source, generate_docs modules = [ rx.App, rx.Base, rx.Component, rx.ComponentState, (rx.Config, rx.config.BaseConfig), rx.event.Event, rx.event.EventHandler, rx.event.EventSpec, rx.Model, # rx.testing.AppHarness, rx.state.StateManager, # rx.state.BaseState, rx.State, ImportVar, rx.Var, ] from .env_vars import env_vars_doc pages = [] for module in modules: if isinstance(module, tuple): module, *extra_modules = module extra_fields = [] for extra_module in extra_modules: s_extra = Source(module=extra_module) extra_fields.extend(s_extra.get_fields()) else: extra_fields = None s = Source(module=module) name = module.__name__.lower() docs = generate_docs(name, s, extra_fields=extra_fields) title = name.replace("_", " ").title() page_data =
import reflex as rx
import reflex as rx
from pcweb.templates.docpage import docpage from .source import Source, generate_docs modules = [ rx.App, rx.Base, rx.Component, rx.ComponentState, (rx.Config, rx.config.BaseConfig), rx.event.Event, rx.event.EventHandler, rx.event.EventSpec, rx.Model, # rx.testing.AppHarness, rx.state.StateManager, # rx.state.BaseState, rx.State, ImportVar, rx.Var, ] from .env_vars import env_vars_doc pages = [] for module in modules: if isinstance(module, tuple): module, *extra_modules = module extra_fields = [] for extra_module in extra_modules: s_extra = Source(module=extra_module) extra_fields.extend(s_extra.get_fields()) else: extra_fields = None s = Source(module=module) name = module.__name__.lower() docs = generate_docs(name, s, extra_fields=extra_fields) title = name.replace("_", " ").title() page_data = docpage(f"/docs/api-reference/{name}/", ti
from reflex.utils.imports import ImportVar
import reflex as rx from reflex.utils.imports import ImportVar
from .source import Source, generate_docs modules = [ rx.App, rx.Base, rx.Component, rx.ComponentState, (rx.Config, rx.config.BaseConfig), rx.event.Event, rx.event.EventHandler, rx.event.EventSpec, rx.Model, # rx.testing.AppHarness, rx.state.StateManager, # rx.state.BaseState, rx.State, ImportVar, rx.Var, ] from .env_vars import env_vars_doc pages = [] for module in modules: if isinstance(module, tuple): module, *extra_modules = module extra_fields = [] for extra_module in extra_modules: s_extra = Source(module=extra_module) extra_fields.extend(s_extra.get_fields()) else: extra_fields = None s = Source(module=module) name = module.__name__.lower() docs = generate_docs(name, s, extra_fields=extra_fields) title = name.replace("_", " ").title() page_data = docpage(f"/docs/api-reference/{name}/", title)(docs) page_data.title = page_data.ti
from pcweb.templates.docpage import docpage
import reflex as rx from reflex.utils.imports import ImportVar from pcweb.templates.docpage import docpage
modules = [ rx.App, rx.Base, rx.Component, rx.ComponentState, (rx.Config, rx.config.BaseConfig), rx.event.Event, rx.event.EventHandler, rx.event.EventSpec, rx.Model, # rx.testing.AppHarness, rx.state.StateManager, # rx.state.BaseState, rx.State, ImportVar, rx.Var, ] from .env_vars import env_vars_doc pages = [] for module in modules: if isinstance(module, tuple): module, *extra_modules = module extra_fields = [] for extra_module in extra_modules: s_extra = Source(module=extra_module) extra_fields.extend(s_extra.get_fields()) else: extra_fields = None s = Source(module=module) name = module.__name__.lower() docs = generate_docs(name, s, extra_fields=extra_fields) title = name.replace("_", " ").title() page_data = docpage(f"/docs/api-reference/{name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(
from .source import Source, generate_docs
import reflex as rx from reflex.utils.imports import ImportVar from pcweb.templates.docpage import docpage from .source import Source, generate_docs modules = [ rx.App, rx.Base, rx.Component, rx.ComponentState, (rx.Config, rx.config.BaseConfig), rx.event.Event, rx.event.EventHandler, rx.event.EventSpec, rx.Model, # rx.testing.AppHarness, rx.state.StateManager, # rx.state.BaseState, rx.State, ImportVar, rx.Var, ]
pages = [] for module in modules: if isinstance(module, tuple): module, *extra_modules = module extra_fields = [] for extra_module in extra_modules: s_extra = Source(module=extra_module) extra_fields.extend(s_extra.get_fields()) else: extra_fields = None s = Source(module=module) name = module.__name__.lower() docs = generate_docs(name, s, extra_fields=extra_fields) title = name.replace("_", " ").title() page_data = docpage(f"/docs/api-reference/{name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data) pages.append(env_vars_doc)
from .env_vars import env_vars_doc
import reflex as rx from reflex.utils.imports import ImportVar from pcweb.templates.docpage import docpage from .source import Source, generate_docs modules = [ rx.App, rx.Base, rx.Component, rx.ComponentState, (rx.Config, rx.config.BaseConfig), rx.event.Event, rx.event.EventHandler, rx.event.EventSpec, rx.Model, # rx.testing.AppHarness, rx.state.StateManager, # rx.state.BaseState, rx.State, ImportVar, rx.Var, ] from .env_vars import env_vars_doc
for module in modules: if isinstance(module, tuple): module, *extra_modules = module extra_fields = [] for extra_module in extra_modules: s_extra = Source(module=extra_module) extra_fields.extend(s_extra.get_fields()) else: extra_fields = None s = Source(module=module) name = module.__name__.lower() docs = generate_docs(name, s, extra_fields=extra_fields) title = name.replace("_", " ").title() page_data = docpage(f"/docs/api-reference/{name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data) pages.append(env_vars_doc)
pages = []
import reflex as rx from reflex.utils.imports import ImportVar from pcweb.templates.docpage import docpage from .source import Source, generate_docs modules = [ rx.App, rx.Base, rx.Component, rx.ComponentState, (rx.Config, rx.config.BaseConfig), rx.event.Event, rx.event.EventHandler, rx.event.EventSpec, rx.Model, # rx.testing.AppHarness, rx.state.StateManager, # rx.state.BaseState, rx.State, ImportVar, rx.Var, ] from .env_vars import env_vars_doc pages = [] for module in modules: if isinstance(module, tuple):
extra_fields = [] for extra_module in extra_modules: s_extra = Source(module=extra_module) extra_fields.extend(s_extra.get_fields()) else: extra_fields = None s = Source(module=module) name = module.__name__.lower() docs = generate_docs(name, s, extra_fields=extra_fields) title = name.replace("_", " ").title() page_data = docpage(f"/docs/api-reference/{name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data) pages.append(env_vars_doc)
module, *extra_modules = module
import reflex as rx from reflex.utils.imports import ImportVar from pcweb.templates.docpage import docpage from .source import Source, generate_docs modules = [ rx.App, rx.Base, rx.Component, rx.ComponentState, (rx.Config, rx.config.BaseConfig), rx.event.Event, rx.event.EventHandler, rx.event.EventSpec, rx.Model, # rx.testing.AppHarness, rx.state.StateManager, # rx.state.BaseState, rx.State, ImportVar, rx.Var, ] from .env_vars import env_vars_doc pages = [] for module in modules: if isinstance(module, tuple): module, *extra_modules = module
for extra_module in extra_modules: s_extra = Source(module=extra_module) extra_fields.extend(s_extra.get_fields()) else: extra_fields = None s = Source(module=module) name = module.__name__.lower() docs = generate_docs(name, s, extra_fields=extra_fields) title = name.replace("_", " ").title() page_data = docpage(f"/docs/api-reference/{name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data) pages.append(env_vars_doc)
extra_fields = []
import reflex as rx from reflex.utils.imports import ImportVar from pcweb.templates.docpage import docpage from .source import Source, generate_docs modules = [ rx.App, rx.Base, rx.Component, rx.ComponentState, (rx.Config, rx.config.BaseConfig), rx.event.Event, rx.event.EventHandler, rx.event.EventSpec, rx.Model, # rx.testing.AppHarness, rx.state.StateManager, # rx.state.BaseState, rx.State, ImportVar, rx.Var, ] from .env_vars import env_vars_doc pages = [] for module in modules: if isinstance(module, tuple): module, *extra_modules = module extra_fields = [] for extra_module in extra_modules:
extra_fields.extend(s_extra.get_fields()) else: extra_fields = None s = Source(module=module) name = module.__name__.lower() docs = generate_docs(name, s, extra_fields=extra_fields) title = name.replace("_", " ").title() page_data = docpage(f"/docs/api-reference/{name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data) pages.append(env_vars_doc)
s_extra = Source(module=extra_module)
import reflex as rx from reflex.utils.imports import ImportVar from pcweb.templates.docpage import docpage from .source import Source, generate_docs modules = [ rx.App, rx.Base, rx.Component, rx.ComponentState, (rx.Config, rx.config.BaseConfig), rx.event.Event, rx.event.EventHandler, rx.event.EventSpec, rx.Model, # rx.testing.AppHarness, rx.state.StateManager, # rx.state.BaseState, rx.State, ImportVar, rx.Var, ] from .env_vars import env_vars_doc pages = [] for module in modules: if isinstance(module, tuple): module, *extra_modules = module extra_fields = [] for extra_module in extra_modules: s_extra = Source(module=extra_module) extra_fields.extend(s_extra.get_fields()) else:
s = Source(module=module) name = module.__name__.lower() docs = generate_docs(name, s, extra_fields=extra_fields) title = name.replace("_", " ").title() page_data = docpage(f"/docs/api-reference/{name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data) pages.append(env_vars_doc)
extra_fields = None
import reflex as rx from reflex.utils.imports import ImportVar from pcweb.templates.docpage import docpage from .source import Source, generate_docs modules = [ rx.App, rx.Base, rx.Component, rx.ComponentState, (rx.Config, rx.config.BaseConfig), rx.event.Event, rx.event.EventHandler, rx.event.EventSpec, rx.Model, # rx.testing.AppHarness, rx.state.StateManager, # rx.state.BaseState, rx.State, ImportVar, rx.Var, ] from .env_vars import env_vars_doc pages = [] for module in modules: if isinstance(module, tuple): module, *extra_modules = module extra_fields = [] for extra_module in extra_modules: s_extra = Source(module=extra_module) extra_fields.extend(s_extra.get_fields()) else: extra_fields = None
name = module.__name__.lower() docs = generate_docs(name, s, extra_fields=extra_fields) title = name.replace("_", " ").title() page_data = docpage(f"/docs/api-reference/{name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data) pages.append(env_vars_doc)
s = Source(module=module)
import reflex as rx from reflex.utils.imports import ImportVar from pcweb.templates.docpage import docpage from .source import Source, generate_docs modules = [ rx.App, rx.Base, rx.Component, rx.ComponentState, (rx.Config, rx.config.BaseConfig), rx.event.Event, rx.event.EventHandler, rx.event.EventSpec, rx.Model, # rx.testing.AppHarness, rx.state.StateManager, # rx.state.BaseState, rx.State, ImportVar, rx.Var, ] from .env_vars import env_vars_doc pages = [] for module in modules: if isinstance(module, tuple): module, *extra_modules = module extra_fields = [] for extra_module in extra_modules: s_extra = Source(module=extra_module) extra_fields.extend(s_extra.get_fields()) else: extra_fields = None s = Source(module=module) name = module.__name__.lower() docs = generate_docs(name, s, extra_fields=extra_fields)
page_data = docpage(f"/docs/api-reference/{name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data) pages.append(env_vars_doc)
title = name.replace("_", " ").title()
eflex as rx from reflex.utils.imports import ImportVar from pcweb.templates.docpage import docpage from .source import Source, generate_docs modules = [ rx.App, rx.Base, rx.Component, rx.ComponentState, (rx.Config, rx.config.BaseConfig), rx.event.Event, rx.event.EventHandler, rx.event.EventSpec, rx.Model, # rx.testing.AppHarness, rx.state.StateManager, # rx.state.BaseState, rx.State, ImportVar, rx.Var, ] from .env_vars import env_vars_doc pages = [] for module in modules: if isinstance(module, tuple): module, *extra_modules = module extra_fields = [] for extra_module in extra_modules: s_extra = Source(module=extra_module) extra_fields.extend(s_extra.get_fields()) else: extra_fields = None s = Source(module=module) name = module.__name__.lower() docs = generate_docs(name, s, extra_fields=extra_fields) title = name.replace("_", " ").title()
page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data) pages.append(env_vars_doc)
page_data = docpage(f"/docs/api-reference/{name}/", title)(docs)
mplates.docpage import docpage from .source import Source, generate_docs modules = [ rx.App, rx.Base, rx.Component, rx.ComponentState, (rx.Config, rx.config.BaseConfig), rx.event.Event, rx.event.EventHandler, rx.event.EventSpec, rx.Model, # rx.testing.AppHarness, rx.state.StateManager, # rx.state.BaseState, rx.State, ImportVar, rx.Var, ] from .env_vars import env_vars_doc pages = [] for module in modules: if isinstance(module, tuple): module, *extra_modules = module extra_fields = [] for extra_module in extra_modules: s_extra = Source(module=extra_module) extra_fields.extend(s_extra.get_fields()) else: extra_fields = None s = Source(module=module) name = module.__name__.lower() docs = generate_docs(name, s, extra_fields=extra_fields) title = name.replace("_", " ").title() page_data = docpage(f"/docs/api-reference/{name}/", title)(docs)
pages.append(page_data) pages.append(env_vars_doc)
page_data.title = page_data.title.split("·")[0].strip()
import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.da
from __future__ import annotations
from __future__ import annotations
from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True)
import dataclasses
from __future__ import annotations import dataclasses
from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_tex
from collections.abc import Callable, Sequence
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence
from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{su
from importlib.util import find_spec
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec
import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasse
from typing import Any, TypedDict
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict
import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(fr
import click
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click
from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Par
import reflex as rx
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx
from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: Inl
from reflex.reflex import cli
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli
from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -
from pcweb.flexdown import markdown
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown
@dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text
from pcweb.templates.docpage import docpage
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True)
@dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dat
class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.")
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element:
@dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dat
def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.")
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True)
@dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement,
class InlineElement(Element): ...
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True)
@dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(
class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements)
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...]
@dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(
def into_text(self) -> str: return "".join(element.into_text() for element in self.elements)
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True)
@dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.lan
class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text)
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str
@dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.lan
def into_text(self) -> str: import html return html.escape(self.text)
from __future__ import annotations import dataclasses from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str:
return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.lang
import html
from collections.abc import Callable, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True)
@dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def
class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`"
le, Sequence from importlib.util import find_spec from typing import Any, TypedDict import click import reflex as rx from reflex.reflex import cli from pcweb.flexdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText):
@dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def
def into_text(self) -> str: return f"`{super().into_text()}`"
xdown import markdown from pcweb.templates.docpage import docpage @dataclasses.dataclass(frozen=True) class Element: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement
@dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self)
def into_text(self) -> str: return f"{self.text.into_text()}\n\n"
ement: def into_text(self) -> str: """Convert the element into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True)
@dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDi
class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n"
nt into a text representation.""" raise NotImplementedError("Subclasses must implement this method.") @dataclasses.dataclass(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement
@dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDi
def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n"
class(frozen=True) class InlineElement(Element): ... @dataclasses.dataclass(frozen=True) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True)
@dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int
class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n"
) class InlineTextCollection(InlineElement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False
@dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int
def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n"
lement): elements: tuple[InlineElement, ...] def into_text(self) -> str: return "".join(element.into_text() for element in self.elements) @dataclasses.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str:
return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str]
prefix = "1. " if self.ordered else "* "
es.dataclass(frozen=True) class InlineText(InlineElement): text: str def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True)
@dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count: bool hidden: bool class CommandInfoDi
class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n"
def into_text(self) -> str: import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None
@dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count: bool hidden: bool class CommandInfoDi
def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n"
import html return html.escape(self.text) @dataclasses.dataclass(frozen=True) class InlineCode(InlineText): def into_text(self) -> str: return f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str:
return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count:
if self.language: return f"```{self.language}\n{self.code}\n```\n\n"
urn f"`{super().into_text()}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True)
@dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count: bool hidden: bool class CommandInfoDict(TypedDict): name: str | None params: list[ParamsInfoDict | OptionInfoDict] help: str | None
class Empty(Element): def into_text(self) -> str: return ""
)}`" @dataclasses.dataclass(frozen=True) class Paragraph(Element): text: InlineElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element):
@dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count: bool hidden: bool class CommandInfoDict(TypedDict): name: str | None params: list[ParamsInfoDict | OptionInfoDict] help: str | None
def into_text(self) -> str: return ""
eElement def into_text(self) -> str: return f"{self.text.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True)
class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count: bool hidden: bool class CommandInfoDict(TypedDict): name: str | None params: list[ParamsInfoDict | OptionInfoDict] help: str | None epilog: str | None short_help: str | None hidden: bool deprecated: bool class MultiCommandInfoDict(CommandInfoDict): commands: dict[str, CommandInfoDict | MultiCommandInfoDict] chain: bool class
class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements)
xt.into_text()}\n\n" @dataclasses.dataclass(frozen=True) class Header(Element): level: int text: InlineElement def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...]
class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count: bool hidden: bool class CommandInfoDict(TypedDict): name: str | None params: list[ParamsInfoDict | OptionInfoDict] help: str | None epilog: str | None short_help: str | None hidden: bool deprecated: bool class MultiCommandInfoDict(CommandInfoDict): commands: dict[str, CommandInfoDict | MultiCommandInfoDict] chain: bool class
def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements)
ent def into_text(self) -> str: return f"{'#' * self.level} {self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements)
class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count: bool hidden: bool class CommandInfoDict(TypedDict): name: str | None params: list[ParamsInfoDict | OptionInfoDict] help: str | None epilog: str | None short_help: str | None hidden: bool deprecated: bool class MultiCommandInfoDict(CommandInfoDict): commands: dict[str, CommandInfoDict | MultiCommandInfoDict] chain: bool class InfoDict(TypedDict): command: CommandInfoDict | MultiCommandInfoDict
class ParamTypeInfoDict(TypedDict): param_type: str name: str
{self.text.into_text()}\n" @dataclasses.dataclass(frozen=True) class List(Element): items: tuple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str
class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count: bool hidden: bool class CommandInfoDict(TypedDict): name: str | None params: list[ParamsInfoDict | OptionInfoDict] help: str | None epilog: str | None short_help: str | None hidden: bool deprecated: bool class MultiCommandInfoDict(CommandInfoDict): commands: dict[str, CommandInfoDict | MultiCommandInfoDict] chain: bool class InfoDict(TypedDict): command: CommandInfoDict | MultiCommandInfoDict info_name: str | None allow_extra_args: bool allow_interspersed_args: bool ignore_u
class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool
ple[InlineElement, ...] ordered: bool = False def into_text(self) -> str: prefix = "1. " if self.ordered else "* " return "\n".join(f"{prefix}{item.into_text()}" for item in self.items) + "\n\n" @dataclasses.dataclass(frozen=True) class CodeBlock(Element): code: str language: str | None = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool
class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count: bool hidden: bool class CommandInfoDict(TypedDict): name: str | None params: list[ParamsInfoDict | OptionInfoDict] help: str | None epilog: str | None short_help: str | None hidden: bool deprecated: bool class MultiCommandInfoDict(CommandInfoDict): commands: dict[str, CommandInfoDict | MultiCommandInfoDict] chain: bool class InfoDict(TypedDict): command: CommandInfoDict | MultiCommandInfoDict info_name: str | None allow_extra_args: bool allow_interspersed_args: bool ignore_unknown_options: bool auto_envvar_prefix: str | None def sort_subcommands( commands: dict[str, CommandInfoDict | MultiCommandInfoDict], ) -> dict[str, CommandInfoDict | MultiCommandInfoDict]: """Sort subcommands by name.""" return dict( sorted(commands.items(), key=lambda item: len(item[1].get("
class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None
e = None def into_text(self) -> str: if self.language: return f"```{self.language}\n{self.code}\n```\n\n" return f"```\n{self.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None
class CommandInfoDict(TypedDict): name: str | None params: list[ParamsInfoDict | OptionInfoDict] help: str | None epilog: str | None short_help: str | None hidden: bool deprecated: bool class MultiCommandInfoDict(CommandInfoDict): commands: dict[str, CommandInfoDict | MultiCommandInfoDict] chain: bool class InfoDict(TypedDict): command: CommandInfoDict | MultiCommandInfoDict info_name: str | None allow_extra_args: bool allow_interspersed_args: bool ignore_unknown_options: bool auto_envvar_prefix: str | None def sort_subcommands( commands: dict[str, CommandInfoDict | MultiCommandInfoDict], ) -> dict[str, CommandInfoDict | MultiCommandInfoDict]: """Sort subcommands by name.""" return dict( sorted(commands.items(), key=lambda item: len(item[1].get("commands", {}))) ) # Dictionary to store the parsed documentation cli_to_doc = {} def process( command: CommandInfoDict | MultiCommandInfoDict,
class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count: bool hidden: bool
elf.code}\n```\n\n" @dataclasses.dataclass(frozen=True) class Empty(Element): def into_text(self) -> str: return "" @dataclasses.dataclass(frozen=True) class Section(Element): sub_elements: tuple[Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count: bool hidden: bool
class MultiCommandInfoDict(CommandInfoDict): commands: dict[str, CommandInfoDict | MultiCommandInfoDict] chain: bool class InfoDict(TypedDict): command: CommandInfoDict | MultiCommandInfoDict info_name: str | None allow_extra_args: bool allow_interspersed_args: bool ignore_unknown_options: bool auto_envvar_prefix: str | None def sort_subcommands( commands: dict[str, CommandInfoDict | MultiCommandInfoDict], ) -> dict[str, CommandInfoDict | MultiCommandInfoDict]: """Sort subcommands by name.""" return dict( sorted(commands.items(), key=lambda item: len(item[1].get("commands", {}))) ) # Dictionary to store the parsed documentation cli_to_doc = {} def process( command: CommandInfoDict | MultiCommandInfoDict, prefix: str | None, override_name: str | None, ) -> Element: """Convert a Click command to a Markdown element.""" actual_name = override_name or command["name"] full_name = prefix + " " + actual_
class CommandInfoDict(TypedDict): name: str | None params: list[ParamsInfoDict | OptionInfoDict] help: str | None epilog: str | None short_help: str | None hidden: bool deprecated: bool
Element, ...] def into_text(self) -> str: return "\n".join(sub_element.into_text() for sub_element in self.sub_elements) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count: bool hidden: bool class CommandInfoDict(TypedDict): name: str | None params: list[ParamsInfoDict | OptionInfoDict] help: str | None epilog: str | None short_help: str | None hidden: bool deprecated: bool
class InfoDict(TypedDict): command: CommandInfoDict | MultiCommandInfoDict info_name: str | None allow_extra_args: bool allow_interspersed_args: bool ignore_unknown_options: bool auto_envvar_prefix: str | None def sort_subcommands( commands: dict[str, CommandInfoDict | MultiCommandInfoDict], ) -> dict[str, CommandInfoDict | MultiCommandInfoDict]: """Sort subcommands by name.""" return dict( sorted(commands.items(), key=lambda item: len(item[1].get("commands", {}))) ) # Dictionary to store the parsed documentation cli_to_doc = {} def process( command: CommandInfoDict | MultiCommandInfoDict, prefix: str | None, override_name: str | None, ) -> Element: """Convert a Click command to a Markdown element.""" actual_name = override_name or command["name"] full_name = prefix + " " + actual_name if prefix and actual_name else actual_name cli_to_doc[full_name] = Section( ( Paragraph(InlineText
class MultiCommandInfoDict(CommandInfoDict): commands: dict[str, CommandInfoDict | MultiCommandInfoDict] chain: bool
ments) class ParamTypeInfoDict(TypedDict): param_type: str name: str class ChoiceParamTypeInfoDict(ParamTypeInfoDict): choices: list[str] case_sensitive: bool class ParamsInfoDict(TypedDict): name: str | None param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count: bool hidden: bool class CommandInfoDict(TypedDict): name: str | None params: list[ParamsInfoDict | OptionInfoDict] help: str | None epilog: str | None short_help: str | None hidden: bool deprecated: bool class MultiCommandInfoDict(CommandInfoDict): commands: dict[str, CommandInfoDict | MultiCommandInfoDict] chain: bool
def sort_subcommands( commands: dict[str, CommandInfoDict | MultiCommandInfoDict], ) -> dict[str, CommandInfoDict | MultiCommandInfoDict]: """Sort subcommands by name.""" return dict( sorted(commands.items(), key=lambda item: len(item[1].get("commands", {}))) ) # Dictionary to store the parsed documentation cli_to_doc = {} def process( command: CommandInfoDict | MultiCommandInfoDict, prefix: str | None, override_name: str | None, ) -> Element: """Convert a Click command to a Markdown element.""" actual_name = override_name or command["name"] full_name = prefix + " " + actual_name if prefix and actual_name else actual_name cli_to_doc[full_name] = Section( ( Paragraph(InlineText(command["help"])) if command["help"] else Empty(), Section( ( Header(3, InlineText("Usage")), CodeBlock( "$" + (" " + p
class InfoDict(TypedDict): command: CommandInfoDict | MultiCommandInfoDict info_name: str | None allow_extra_args: bool allow_interspersed_args: bool ignore_unknown_options: bool auto_envvar_prefix: str | None
param_type_name: str opts: list[str] secondary_opts: list[str] type: ParamTypeInfoDict | ChoiceParamTypeInfoDict required: bool nargs: int multiple: bool default: Any | Callable[[], Any] | None envvar: str | Sequence[str] | None class OptionInfoDict(ParamsInfoDict): help: str | None prompt: str | None is_flag: bool flag_value: Any count: bool hidden: bool class CommandInfoDict(TypedDict): name: str | None params: list[ParamsInfoDict | OptionInfoDict] help: str | None epilog: str | None short_help: str | None hidden: bool deprecated: bool class MultiCommandInfoDict(CommandInfoDict): commands: dict[str, CommandInfoDict | MultiCommandInfoDict] chain: bool class InfoDict(TypedDict): command: CommandInfoDict | MultiCommandInfoDict info_name: str | None allow_extra_args: bool allow_interspersed_args: bool ignore_unknown_options: bool auto_envvar_prefix: str | None
# Dictionary to store the parsed documentation cli_to_doc = {} def process( command: CommandInfoDict | MultiCommandInfoDict, prefix: str | None, override_name: str | None, ) -> Element: """Convert a Click command to a Markdown element.""" actual_name = override_name or command["name"] full_name = prefix + " " + actual_name if prefix and actual_name else actual_name cli_to_doc[full_name] = Section( ( Paragraph(InlineText(command["help"])) if command["help"] else Empty(), Section( ( Header(3, InlineText("Usage")), CodeBlock( "$" + (" " + prefix.strip() if prefix else "") + " " + actual_name.strip() + ( " [OPTIONS]" if command["params"] and any(
def sort_subcommands( commands: dict[str, CommandInfoDict | MultiCommandInfoDict], ) -> dict[str, CommandInfoDict | MultiCommandInfoDict]: """Sort subcommands by name.""" return dict( sorted(commands.items(), key=lambda item: len(item[1].get("commands", {}))) )
: str | None is_flag: bool flag_value: Any count: bool hidden: bool class CommandInfoDict(TypedDict): name: str | None params: list[ParamsInfoDict | OptionInfoDict] help: str | None epilog: str | None short_help: str | None hidden: bool deprecated: bool class MultiCommandInfoDict(CommandInfoDict): commands: dict[str, CommandInfoDict | MultiCommandInfoDict] chain: bool class InfoDict(TypedDict): command: CommandInfoDict | MultiCommandInfoDict info_name: str | None allow_extra_args: bool allow_interspersed_args: bool ignore_unknown_options: bool auto_envvar_prefix: str | None def sort_subcommands( commands: dict[str, CommandInfoDict | MultiCommandInfoDict], ) -> dict[str, CommandInfoDict | MultiCommandInfoDict]: """Sort subcommands by name.""" return dict( sorted(commands.items(), key=lambda item: len(item[1].get("commands", {}))) ) # Dictionary to store the parsed documentation
def process( command: CommandInfoDict | MultiCommandInfoDict, prefix: str | None, override_name: str | None, ) -> Element: """Convert a Click command to a Markdown element.""" actual_name = override_name or command["name"] full_name = prefix + " " + actual_name if prefix and actual_name else actual_name cli_to_doc[full_name] = Section( ( Paragraph(InlineText(command["help"])) if command["help"] else Empty(), Section( ( Header(3, InlineText("Usage")), CodeBlock( "$" + (" " + prefix.strip() if prefix else "") + " " + actual_name.strip() + ( " [OPTIONS]" if command["params"] and any( param.get("param_type_name") != "argument"
cli_to_doc = {}
epilog: str | None short_help: str | None hidden: bool deprecated: bool class MultiCommandInfoDict(CommandInfoDict): commands: dict[str, CommandInfoDict | MultiCommandInfoDict] chain: bool class InfoDict(TypedDict): command: CommandInfoDict | MultiCommandInfoDict info_name: str | None allow_extra_args: bool allow_interspersed_args: bool ignore_unknown_options: bool auto_envvar_prefix: str | None def sort_subcommands( commands: dict[str, CommandInfoDict | MultiCommandInfoDict], ) -> dict[str, CommandInfoDict | MultiCommandInfoDict]: """Sort subcommands by name.""" return dict( sorted(commands.items(), key=lambda item: len(item[1].get("commands", {}))) ) # Dictionary to store the parsed documentation cli_to_doc = {} def process( command: CommandInfoDict | MultiCommandInfoDict, prefix: str | None, override_name: str | None, ) -> Element: """Convert a Click command to a Markdown element."""
full_name = prefix + " " + actual_name if prefix and actual_name else actual_name cli_to_doc[full_name] = Section( ( Paragraph(InlineText(command["help"])) if command["help"] else Empty(), Section( ( Header(3, InlineText("Usage")), CodeBlock( "$" + (" " + prefix.strip() if prefix else "") + " " + actual_name.strip() + ( " [OPTIONS]" if command["params"] and any( param.get("param_type_name") != "argument" for param in command["params"] ) else "" ) + ( " " + " ".join(arguments)
actual_name = override_name or command["name"]
hidden: bool deprecated: bool class MultiCommandInfoDict(CommandInfoDict): commands: dict[str, CommandInfoDict | MultiCommandInfoDict] chain: bool class InfoDict(TypedDict): command: CommandInfoDict | MultiCommandInfoDict info_name: str | None allow_extra_args: bool allow_interspersed_args: bool ignore_unknown_options: bool auto_envvar_prefix: str | None def sort_subcommands( commands: dict[str, CommandInfoDict | MultiCommandInfoDict], ) -> dict[str, CommandInfoDict | MultiCommandInfoDict]: """Sort subcommands by name.""" return dict( sorted(commands.items(), key=lambda item: len(item[1].get("commands", {}))) ) # Dictionary to store the parsed documentation cli_to_doc = {} def process( command: CommandInfoDict | MultiCommandInfoDict, prefix: str | None, override_name: str | None, ) -> Element: """Convert a Click command to a Markdown element.""" actual_name = override_name or command["name"]
cli_to_doc[full_name] = Section( ( Paragraph(InlineText(command["help"])) if command["help"] else Empty(), Section( ( Header(3, InlineText("Usage")), CodeBlock( "$" + (" " + prefix.strip() if prefix else "") + " " + actual_name.strip() + ( " [OPTIONS]" if command["params"] and any( param.get("param_type_name") != "argument" for param in command["params"] ) else "" ) + ( " " + " ".join(arguments) if ( arguments := [
full_name = prefix + " " + actual_name if prefix and actual_name else actual_name
aram["type"]["name"].upper() if param["type"]["name"] != "boolean" else "" ) if (choices := param["type"].get("choices")) is None else " [" + "|".join(choices) + "]" ) ), InlineText(": " + option_help), ) ) for param in command["params"] if (option_help := param.get("help")) is not None ), ordered=False, ), ) ) if command["params"] else Empty(), ) ).into_text()
def process_command(command: click.Command, name: str) -> str: """Convert a Click command to a Markdown text representation.""" with click.Context(command) as ctx: process(ctx.to_info_dict()["command"], None, name) if find_spec("typer") is not None and find_spec("typer.main") is not None: import typer # pyright: ignore[reportMissingImports] if isinstance(cli, typer.Typer): cli = typer.main.get_command(cli) # Iterate over each command configuration process_command(cli, "reflex") REFLEX_PREFIX = "reflex" REFLEX_CLOUD_PREFIX = REFLEX_PREFIX + " cloud" def prefix( prefix: str, commands: list[str], ) -> list[str]: return [prefix + " " + command for command in commands] # Dictionary to store the categories and their respective commands categories = { "login": prefix(REFLEX_PREFIX, ["login", "logout"]), "deploy": prefix(REFLEX_PREFIX, ["deploy"]), "apps": prefix( REFLEX_CLOUD_PREFIX + " apps", [
for name, sub_command in sort_subcommands(command.get("commands", {})).items(): process( sub_command, (prefix + " " + actual_name if prefix and actual_name else actual_name), name, )
if (choices := param["type"].get("choices")) is None else " [" + "|".join(choices) + "]" ) ), InlineText(": " + option_help), ) ) for param in command["params"] if (option_help := param.get("help")) is not None ), ordered=False, ), ) ) if command["params"] else Empty(), ) ).into_text() for name, sub_command in sort_subcommands(command.get("commands", {})).items(): process( sub_command, (prefix + " " + actual_name if prefix and actual_name else actual_name), name, )
if find_spec("typer") is not None and find_spec("typer.main") is not None: import typer # pyright: ignore[reportMissingImports] if isinstance(cli, typer.Typer): cli = typer.main.get_command(cli) # Iterate over each command configuration process_command(cli, "reflex") REFLEX_PREFIX = "reflex" REFLEX_CLOUD_PREFIX = REFLEX_PREFIX + " cloud" def prefix( prefix: str, commands: list[str], ) -> list[str]: return [prefix + " " + command for command in commands] # Dictionary to store the categories and their respective commands categories = { "login": prefix(REFLEX_PREFIX, ["login", "logout"]), "deploy": prefix(REFLEX_PREFIX, ["deploy"]), "apps": prefix( REFLEX_CLOUD_PREFIX + " apps", [ "scale", "status", "start", "stop", "delete", "logs", "history", "build-logs", "list", ], ), "projects": prefix(
def process_command(command: click.Command, name: str) -> str: """Convert a Click command to a Markdown text representation.""" with click.Context(command) as ctx: process(ctx.to_info_dict()["command"], None, name)
) ), InlineText(": " + option_help), ) ) for param in command["params"] if (option_help := param.get("help")) is not None ), ordered=False, ), ) ) if command["params"] else Empty(), ) ).into_text() for name, sub_command in sort_subcommands(command.get("commands", {})).items(): process( sub_command, (prefix + " " + actual_name if prefix and actual_name else actual_name), name, ) def process_command(command: click.Command, name: str) -> str: """Convert a Click command to a Markdown text representation.""" with click.Context(command) as ctx: process(ctx.to_info_dict()["command"], None, name)
# Iterate over each command configuration process_command(cli, "reflex") REFLEX_PREFIX = "reflex" REFLEX_CLOUD_PREFIX = REFLEX_PREFIX + " cloud" def prefix( prefix: str, commands: list[str], ) -> list[str]: return [prefix + " " + command for command in commands] # Dictionary to store the categories and their respective commands categories = { "login": prefix(REFLEX_PREFIX, ["login", "logout"]), "deploy": prefix(REFLEX_PREFIX, ["deploy"]), "apps": prefix( REFLEX_CLOUD_PREFIX + " apps", [ "scale", "status", "start", "stop", "delete", "logs", "history", "build-logs", "list", ], ), "projects": prefix( REFLEX_CLOUD_PREFIX + " project", [ "list", "create", "select", "invite", "get-select", "usage", "role-permissions",
if find_spec("typer") is not None and find_spec("typer.main") is not None: import typer # pyright: ignore[reportMissingImports] if isinstance(cli, typer.Typer): cli = typer.main.get_command(cli)
InlineText(": " + option_help), ) ) for param in command["params"] if (option_help := param.get("help")) is not None ), ordered=False, ), ) ) if command["params"] else Empty(), ) ).into_text() for name, sub_command in sort_subcommands(command.get("commands", {})).items(): process( sub_command, (prefix + " " + actual_name if prefix and actual_name else actual_name), name, ) def process_command(command: click.Command, name: str) -> str: """Convert a Click command to a Markdown text representation.""" with click.Context(command) as ctx: process(ctx.to_info_dict()["command"], None, name) if find_spec("typer") is not None and find_spec("typer.main") is not None:
# pyright: ignore[reportMissingImports] if isinstance(cli, typer.Typer): cli = typer.main.get_command(cli) # Iterate over each command configuration process_command(cli, "reflex") REFLEX_PREFIX = "reflex" REFLEX_CLOUD_PREFIX = REFLEX_PREFIX + " cloud" def prefix( prefix: str, commands: list[str], ) -> list[str]: return [prefix + " " + command for command in commands] # Dictionary to store the categories and their respective commands categories = { "login": prefix(REFLEX_PREFIX, ["login", "logout"]), "deploy": prefix(REFLEX_PREFIX, ["deploy"]), "apps": prefix( REFLEX_CLOUD_PREFIX + " apps", [ "scale", "status", "start", "stop", "delete", "logs", "history", "build-logs", "list", ], ), "projects": prefix( REFLEX_CLOUD_PREFIX + " project", [ "list", "create",
import typer
) ) for param in command["params"] if (option_help := param.get("help")) is not None ), ordered=False, ), ) ) if command["params"] else Empty(), ) ).into_text() for name, sub_command in sort_subcommands(command.get("commands", {})).items(): process( sub_command, (prefix + " " + actual_name if prefix and actual_name else actual_name), name, ) def process_command(command: click.Command, name: str) -> str: """Convert a Click command to a Markdown text representation.""" with click.Context(command) as ctx: process(ctx.to_info_dict()["command"], None, name) if find_spec("typer") is not None and find_spec("typer.main") is not None: import typer # pyright: ignore[reportMissingImports]
# Iterate over each command configuration process_command(cli, "reflex") REFLEX_PREFIX = "reflex" REFLEX_CLOUD_PREFIX = REFLEX_PREFIX + " cloud" def prefix( prefix: str, commands: list[str], ) -> list[str]: return [prefix + " " + command for command in commands] # Dictionary to store the categories and their respective commands categories = { "login": prefix(REFLEX_PREFIX, ["login", "logout"]), "deploy": prefix(REFLEX_PREFIX, ["deploy"]), "apps": prefix( REFLEX_CLOUD_PREFIX + " apps", [ "scale", "status", "start", "stop", "delete", "logs", "history", "build-logs", "list", ], ), "projects": prefix( REFLEX_CLOUD_PREFIX + " project", [ "list", "create", "select", "invite", "get-select", "usage", "role-permissions",
if isinstance(cli, typer.Typer): cli = typer.main.get_command(cli)
) for param in command["params"] if (option_help := param.get("help")) is not None ), ordered=False, ), ) ) if command["params"] else Empty(), ) ).into_text() for name, sub_command in sort_subcommands(command.get("commands", {})).items(): process( sub_command, (prefix + " " + actual_name if prefix and actual_name else actual_name), name, ) def process_command(command: click.Command, name: str) -> str: """Convert a Click command to a Markdown text representation.""" with click.Context(command) as ctx: process(ctx.to_info_dict()["command"], None, name) if find_spec("typer") is not None and find_spec("typer.main") is not None: import typer # pyright: ignore[reportMissingImports] if isinstance(cli, typer.Typer):
# Iterate over each command configuration process_command(cli, "reflex") REFLEX_PREFIX = "reflex" REFLEX_CLOUD_PREFIX = REFLEX_PREFIX + " cloud" def prefix( prefix: str, commands: list[str], ) -> list[str]: return [prefix + " " + command for command in commands] # Dictionary to store the categories and their respective commands categories = { "login": prefix(REFLEX_PREFIX, ["login", "logout"]), "deploy": prefix(REFLEX_PREFIX, ["deploy"]), "apps": prefix( REFLEX_CLOUD_PREFIX + " apps", [ "scale", "status", "start", "stop", "delete", "logs", "history", "build-logs", "list", ], ), "projects": prefix( REFLEX_CLOUD_PREFIX + " project", [ "list", "create", "select", "invite", "get-select", "usage", "role-permissions",
cli = typer.main.get_command(cli)
ram.get("help")) is not None ), ordered=False, ), ) ) if command["params"] else Empty(), ) ).into_text() for name, sub_command in sort_subcommands(command.get("commands", {})).items(): process( sub_command, (prefix + " " + actual_name if prefix and actual_name else actual_name), name, ) def process_command(command: click.Command, name: str) -> str: """Convert a Click command to a Markdown text representation.""" with click.Context(command) as ctx: process(ctx.to_info_dict()["command"], None, name) if find_spec("typer") is not None and find_spec("typer.main") is not None: import typer # pyright: ignore[reportMissingImports] if isinstance(cli, typer.Typer): cli = typer.main.get_command(cli) # Iterate over each command configuration process_command(cli, "reflex")
REFLEX_CLOUD_PREFIX = REFLEX_PREFIX + " cloud" def prefix( prefix: str, commands: list[str], ) -> list[str]: return [prefix + " " + command for command in commands] # Dictionary to store the categories and their respective commands categories = { "login": prefix(REFLEX_PREFIX, ["login", "logout"]), "deploy": prefix(REFLEX_PREFIX, ["deploy"]), "apps": prefix( REFLEX_CLOUD_PREFIX + " apps", [ "scale", "status", "start", "stop", "delete", "logs", "history", "build-logs", "list", ], ), "projects": prefix( REFLEX_CLOUD_PREFIX + " project", [ "list", "create", "select", "invite", "get-select", "usage", "role-permissions", "users", ], ), "secrets": prefix( REFLEX_CLOUD_PREFIX + " secrets",
REFLEX_PREFIX = "reflex"
one ), ordered=False, ), ) ) if command["params"] else Empty(), ) ).into_text() for name, sub_command in sort_subcommands(command.get("commands", {})).items(): process( sub_command, (prefix + " " + actual_name if prefix and actual_name else actual_name), name, ) def process_command(command: click.Command, name: str) -> str: """Convert a Click command to a Markdown text representation.""" with click.Context(command) as ctx: process(ctx.to_info_dict()["command"], None, name) if find_spec("typer") is not None and find_spec("typer.main") is not None: import typer # pyright: ignore[reportMissingImports] if isinstance(cli, typer.Typer): cli = typer.main.get_command(cli) # Iterate over each command configuration process_command(cli, "reflex") REFLEX_PREFIX = "reflex"
def prefix( prefix: str, commands: list[str], ) -> list[str]: return [prefix + " " + command for command in commands] # Dictionary to store the categories and their respective commands categories = { "login": prefix(REFLEX_PREFIX, ["login", "logout"]), "deploy": prefix(REFLEX_PREFIX, ["deploy"]), "apps": prefix( REFLEX_CLOUD_PREFIX + " apps", [ "scale", "status", "start", "stop", "delete", "logs", "history", "build-logs", "list", ], ), "projects": prefix( REFLEX_CLOUD_PREFIX + " project", [ "list", "create", "select", "invite", "get-select", "usage", "role-permissions", "users", ], ), "secrets": prefix( REFLEX_CLOUD_PREFIX + " secrets", ["list", "delete", "update"], ), "
REFLEX_CLOUD_PREFIX = REFLEX_PREFIX + " cloud"
ordered=False, ), ) ) if command["params"] else Empty(), ) ).into_text() for name, sub_command in sort_subcommands(command.get("commands", {})).items(): process( sub_command, (prefix + " " + actual_name if prefix and actual_name else actual_name), name, ) def process_command(command: click.Command, name: str) -> str: """Convert a Click command to a Markdown text representation.""" with click.Context(command) as ctx: process(ctx.to_info_dict()["command"], None, name) if find_spec("typer") is not None and find_spec("typer.main") is not None: import typer # pyright: ignore[reportMissingImports] if isinstance(cli, typer.Typer): cli = typer.main.get_command(cli) # Iterate over each command configuration process_command(cli, "reflex") REFLEX_PREFIX = "reflex" REFLEX_CLOUD_PREFIX = REFLEX_PREFIX + " cloud"
# Dictionary to store the categories and their respective commands categories = { "login": prefix(REFLEX_PREFIX, ["login", "logout"]), "deploy": prefix(REFLEX_PREFIX, ["deploy"]), "apps": prefix( REFLEX_CLOUD_PREFIX + " apps", [ "scale", "status", "start", "stop", "delete", "logs", "history", "build-logs", "list", ], ), "projects": prefix( REFLEX_CLOUD_PREFIX + " project", [ "list", "create", "select", "invite", "get-select", "usage", "role-permissions", "users", ], ), "secrets": prefix( REFLEX_CLOUD_PREFIX + " secrets", ["list", "delete", "update"], ), "vmtypes": prefix(REFLEX_CLOUD_PREFIX, ["vmtypes"]), "regions": prefix(REFLEX_CLOUD_PREFIX, ["regions"]), "config": prefix(RE
def prefix( prefix: str, commands: list[str], ) -> list[str]: return [prefix + " " + command for command in commands]
bcommands(command.get("commands", {})).items(): process( sub_command, (prefix + " " + actual_name if prefix and actual_name else actual_name), name, ) def process_command(command: click.Command, name: str) -> str: """Convert a Click command to a Markdown text representation.""" with click.Context(command) as ctx: process(ctx.to_info_dict()["command"], None, name) if find_spec("typer") is not None and find_spec("typer.main") is not None: import typer # pyright: ignore[reportMissingImports] if isinstance(cli, typer.Typer): cli = typer.main.get_command(cli) # Iterate over each command configuration process_command(cli, "reflex") REFLEX_PREFIX = "reflex" REFLEX_CLOUD_PREFIX = REFLEX_PREFIX + " cloud" def prefix( prefix: str, commands: list[str], ) -> list[str]: return [prefix + " " + command for command in commands] # Dictionary to store the categories and their respective commands
# Dictionary to store the combined documentation for each category modules: dict[str, str] = {} # Extract and combine documentation for each category for category, commands in categories.items(): docs_list = [ f"## {command}\n\n{cli_to_doc[command]}" for command in commands if command in cli_to_doc ] modules[category] = "\n\n".join(docs_list) def generate_docs(source: str): return rx.box( markdown(text=source), ) pages = [] for module_name, module_value in modules.items(): docs = generate_docs(module_value) title = module_name.replace("_", " ").title() page_data = docpage(f"/docs/hosting/cli/{module_name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data)
categories = { "login": prefix(REFLEX_PREFIX, ["login", "logout"]), "deploy": prefix(REFLEX_PREFIX, ["deploy"]), "apps": prefix( REFLEX_CLOUD_PREFIX + " apps", [ "scale", "status", "start", "stop", "delete", "logs", "history", "build-logs", "list", ], ), "projects": prefix( REFLEX_CLOUD_PREFIX + " project", [ "list", "create", "select", "invite", "get-select", "usage", "role-permissions", "users", ], ), "secrets": prefix( REFLEX_CLOUD_PREFIX + " secrets", ["list", "delete", "update"], ), "vmtypes": prefix(REFLEX_CLOUD_PREFIX, ["vmtypes"]), "regions": prefix(REFLEX_CLOUD_PREFIX, ["regions"]), "config": prefix(REFLEX_CLOUD_PREFIX, ["config"]), }
"]), "apps": prefix( REFLEX_CLOUD_PREFIX + " apps", [ "scale", "status", "start", "stop", "delete", "logs", "history", "build-logs", "list", ], ), "projects": prefix( REFLEX_CLOUD_PREFIX + " project", [ "list", "create", "select", "invite", "get-select", "usage", "role-permissions", "users", ], ), "secrets": prefix( REFLEX_CLOUD_PREFIX + " secrets", ["list", "delete", "update"], ), "vmtypes": prefix(REFLEX_CLOUD_PREFIX, ["vmtypes"]), "regions": prefix(REFLEX_CLOUD_PREFIX, ["regions"]), "config": prefix(REFLEX_CLOUD_PREFIX, ["config"]), } # Dictionary to store the combined documentation for each category modules: dict[str, str] = {} # Extract and combine documentation for each category
def generate_docs(source: str): return rx.box( markdown(text=source), ) pages = [] for module_name, module_value in modules.items(): docs = generate_docs(module_value) title = module_name.replace("_", " ").title() page_data = docpage(f"/docs/hosting/cli/{module_name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data)
for category, commands in categories.items(): docs_list = [ f"## {command}\n\n{cli_to_doc[command]}" for command in commands if command in cli_to_doc ] modules[category] = "\n\n".join(docs_list)
IX + " apps", [ "scale", "status", "start", "stop", "delete", "logs", "history", "build-logs", "list", ], ), "projects": prefix( REFLEX_CLOUD_PREFIX + " project", [ "list", "create", "select", "invite", "get-select", "usage", "role-permissions", "users", ], ), "secrets": prefix( REFLEX_CLOUD_PREFIX + " secrets", ["list", "delete", "update"], ), "vmtypes": prefix(REFLEX_CLOUD_PREFIX, ["vmtypes"]), "regions": prefix(REFLEX_CLOUD_PREFIX, ["regions"]), "config": prefix(REFLEX_CLOUD_PREFIX, ["config"]), } # Dictionary to store the combined documentation for each category modules: dict[str, str] = {} # Extract and combine documentation for each category for category, commands in categories.items():
modules[category] = "\n\n".join(docs_list) def generate_docs(source: str): return rx.box( markdown(text=source), ) pages = [] for module_name, module_value in modules.items(): docs = generate_docs(module_value) title = module_name.replace("_", " ").title() page_data = docpage(f"/docs/hosting/cli/{module_name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data)
docs_list = [ f"## {command}\n\n{cli_to_doc[command]}" for command in commands if command in cli_to_doc ]
"logs", "history", "build-logs", "list", ], ), "projects": prefix( REFLEX_CLOUD_PREFIX + " project", [ "list", "create", "select", "invite", "get-select", "usage", "role-permissions", "users", ], ), "secrets": prefix( REFLEX_CLOUD_PREFIX + " secrets", ["list", "delete", "update"], ), "vmtypes": prefix(REFLEX_CLOUD_PREFIX, ["vmtypes"]), "regions": prefix(REFLEX_CLOUD_PREFIX, ["regions"]), "config": prefix(REFLEX_CLOUD_PREFIX, ["config"]), } # Dictionary to store the combined documentation for each category modules: dict[str, str] = {} # Extract and combine documentation for each category for category, commands in categories.items(): docs_list = [ f"## {command}\n\n{cli_to_doc[command]}" for command in commands if command in cli_to_doc ]
def generate_docs(source: str): return rx.box( markdown(text=source), ) pages = [] for module_name, module_value in modules.items(): docs = generate_docs(module_value) title = module_name.replace("_", " ").title() page_data = docpage(f"/docs/hosting/cli/{module_name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data)
modules[category] = "\n\n".join(docs_list)
"build-logs", "list", ], ), "projects": prefix( REFLEX_CLOUD_PREFIX + " project", [ "list", "create", "select", "invite", "get-select", "usage", "role-permissions", "users", ], ), "secrets": prefix( REFLEX_CLOUD_PREFIX + " secrets", ["list", "delete", "update"], ), "vmtypes": prefix(REFLEX_CLOUD_PREFIX, ["vmtypes"]), "regions": prefix(REFLEX_CLOUD_PREFIX, ["regions"]), "config": prefix(REFLEX_CLOUD_PREFIX, ["config"]), } # Dictionary to store the combined documentation for each category modules: dict[str, str] = {} # Extract and combine documentation for each category for category, commands in categories.items(): docs_list = [ f"## {command}\n\n{cli_to_doc[command]}" for command in commands if command in cli_to_doc ] modules[category] = "\n\n".join(docs_list)
pages = [] for module_name, module_value in modules.items(): docs = generate_docs(module_value) title = module_name.replace("_", " ").title() page_data = docpage(f"/docs/hosting/cli/{module_name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data)
def generate_docs(source: str): return rx.box( markdown(text=source), )
EX_CLOUD_PREFIX + " project", [ "list", "create", "select", "invite", "get-select", "usage", "role-permissions", "users", ], ), "secrets": prefix( REFLEX_CLOUD_PREFIX + " secrets", ["list", "delete", "update"], ), "vmtypes": prefix(REFLEX_CLOUD_PREFIX, ["vmtypes"]), "regions": prefix(REFLEX_CLOUD_PREFIX, ["regions"]), "config": prefix(REFLEX_CLOUD_PREFIX, ["config"]), } # Dictionary to store the combined documentation for each category modules: dict[str, str] = {} # Extract and combine documentation for each category for category, commands in categories.items(): docs_list = [ f"## {command}\n\n{cli_to_doc[command]}" for command in commands if command in cli_to_doc ] modules[category] = "\n\n".join(docs_list) def generate_docs(source: str): return rx.box( markdown(text=source), )
for module_name, module_value in modules.items(): docs = generate_docs(module_value) title = module_name.replace("_", " ").title() page_data = docpage(f"/docs/hosting/cli/{module_name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data)
pages = []
EFIX + " project", [ "list", "create", "select", "invite", "get-select", "usage", "role-permissions", "users", ], ), "secrets": prefix( REFLEX_CLOUD_PREFIX + " secrets", ["list", "delete", "update"], ), "vmtypes": prefix(REFLEX_CLOUD_PREFIX, ["vmtypes"]), "regions": prefix(REFLEX_CLOUD_PREFIX, ["regions"]), "config": prefix(REFLEX_CLOUD_PREFIX, ["config"]), } # Dictionary to store the combined documentation for each category modules: dict[str, str] = {} # Extract and combine documentation for each category for category, commands in categories.items(): docs_list = [ f"## {command}\n\n{cli_to_doc[command]}" for command in commands if command in cli_to_doc ] modules[category] = "\n\n".join(docs_list) def generate_docs(source: str): return rx.box( markdown(text=source), ) pages = []
for module_name, module_value in modules.items(): docs = generate_docs(module_value) title = module_name.replace("_", " ").title() page_data = docpage(f"/docs/hosting/cli/{module_name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data)
"create", "select", "invite", "get-select", "usage", "role-permissions", "users", ], ), "secrets": prefix( REFLEX_CLOUD_PREFIX + " secrets", ["list", "delete", "update"], ), "vmtypes": prefix(REFLEX_CLOUD_PREFIX, ["vmtypes"]), "regions": prefix(REFLEX_CLOUD_PREFIX, ["regions"]), "config": prefix(REFLEX_CLOUD_PREFIX, ["config"]), } # Dictionary to store the combined documentation for each category modules: dict[str, str] = {} # Extract and combine documentation for each category for category, commands in categories.items(): docs_list = [ f"## {command}\n\n{cli_to_doc[command]}" for command in commands if command in cli_to_doc ] modules[category] = "\n\n".join(docs_list) def generate_docs(source: str): return rx.box( markdown(text=source), ) pages = [] for module_name, module_value in modules.items():
title = module_name.replace("_", " ").title() page_data = docpage(f"/docs/hosting/cli/{module_name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data)
docs = generate_docs(module_value)
"invite", "get-select", "usage", "role-permissions", "users", ], ), "secrets": prefix( REFLEX_CLOUD_PREFIX + " secrets", ["list", "delete", "update"], ), "vmtypes": prefix(REFLEX_CLOUD_PREFIX, ["vmtypes"]), "regions": prefix(REFLEX_CLOUD_PREFIX, ["regions"]), "config": prefix(REFLEX_CLOUD_PREFIX, ["config"]), } # Dictionary to store the combined documentation for each category modules: dict[str, str] = {} # Extract and combine documentation for each category for category, commands in categories.items(): docs_list = [ f"## {command}\n\n{cli_to_doc[command]}" for command in commands if command in cli_to_doc ] modules[category] = "\n\n".join(docs_list) def generate_docs(source: str): return rx.box( markdown(text=source), ) pages = [] for module_name, module_value in modules.items(): docs = generate_docs(module_value)
page_data = docpage(f"/docs/hosting/cli/{module_name}/", title)(docs) page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data)
title = module_name.replace("_", " ").title()
"usage", "role-permissions", "users", ], ), "secrets": prefix( REFLEX_CLOUD_PREFIX + " secrets", ["list", "delete", "update"], ), "vmtypes": prefix(REFLEX_CLOUD_PREFIX, ["vmtypes"]), "regions": prefix(REFLEX_CLOUD_PREFIX, ["regions"]), "config": prefix(REFLEX_CLOUD_PREFIX, ["config"]), } # Dictionary to store the combined documentation for each category modules: dict[str, str] = {} # Extract and combine documentation for each category for category, commands in categories.items(): docs_list = [ f"## {command}\n\n{cli_to_doc[command]}" for command in commands if command in cli_to_doc ] modules[category] = "\n\n".join(docs_list) def generate_docs(source: str): return rx.box( markdown(text=source), ) pages = [] for module_name, module_value in modules.items(): docs = generate_docs(module_value) title = module_name.replace("_", " ").title()
page_data.title = page_data.title.split("·")[0].strip() pages.append(page_data)
page_data = docpage(f"/docs/hosting/cli/{module_name}/", title)(docs)
], ), "secrets": prefix( REFLEX_CLOUD_PREFIX + " secrets", ["list", "delete", "update"], ), "vmtypes": prefix(REFLEX_CLOUD_PREFIX, ["vmtypes"]), "regions": prefix(REFLEX_CLOUD_PREFIX, ["regions"]), "config": prefix(REFLEX_CLOUD_PREFIX, ["config"]), } # Dictionary to store the combined documentation for each category modules: dict[str, str] = {} # Extract and combine documentation for each category for category, commands in categories.items(): docs_list = [ f"## {command}\n\n{cli_to_doc[command]}" for command in commands if command in cli_to_doc ] modules[category] = "\n\n".join(docs_list) def generate_docs(source: str): return rx.box( markdown(text=source), ) pages = [] for module_name, module_value in modules.items(): docs = generate_docs(module_value) title = module_name.replace("_", " ").title() page_data = docpage(f"/docs/hosting/cli/{module_name}/", title)(docs)
pages.append(page_data)
page_data.title = page_data.title.split("·")[0].strip()
"""Utility functions for the component docs page."""
import inspect import os import re import textwrap from types import UnionType from typing import ( Any, Literal, Sequence, Type, Union, _GenericAlias, get_args, get_origin, ) import reflex as rx from flexdown.document import Document from reflex.base import Base from reflex.components.base.fragment import Fragment from reflex.components.component import Component from reflex.components.el.elements.base import BaseHTML from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import RadixThemesComponent from pcweb.flexdown import markdown, xd from pcweb.templates.docpage import docdemobox, docpage, get_toc, h1_comp, h2_comp def get_code_style(color: str): return { "color": rx.color(color, 11), "border_radius": "0.25rem", "border": f"1px solid {rx.color(color, 5)}", "background": rx.color(color, 3), } class Prop(Base): """Hold information about a
import hashlib
"""Utility functions for the component docs page.""" import hashlib
import os import re import textwrap from types import UnionType from typing import ( Any, Literal, Sequence, Type, Union, _GenericAlias, get_args, get_origin, ) import reflex as rx from flexdown.document import Document from reflex.base import Base from reflex.components.base.fragment import Fragment from reflex.components.component import Component from reflex.components.el.elements.base import BaseHTML from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import RadixThemesComponent from pcweb.flexdown import markdown, xd from pcweb.templates.docpage import docdemobox, docpage, get_toc, h1_comp, h2_comp def get_code_style(color: str): return { "color": rx.color(color, 11), "border_radius": "0.25rem", "border": f"1px solid {rx.color(color, 5)}", "background": rx.color(color, 3), } class Prop(Base): """Hold information about a prop.""" #
import inspect
"""Utility functions for the component docs page.""" import hashlib import inspect import os import re
from types import UnionType from typing import ( Any, Literal, Sequence, Type, Union, _GenericAlias, get_args, get_origin, ) import reflex as rx from flexdown.document import Document from reflex.base import Base from reflex.components.base.fragment import Fragment from reflex.components.component import Component from reflex.components.el.elements.base import BaseHTML from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import RadixThemesComponent from pcweb.flexdown import markdown, xd from pcweb.templates.docpage import docdemobox, docpage, get_toc, h1_comp, h2_comp def get_code_style(color: str): return { "color": rx.color(color, 11), "border_radius": "0.25rem", "border": f"1px solid {rx.color(color, 5)}", "background": rx.color(color, 3), } class Prop(Base): """Hold information about a prop.""" # The name of the prop. name: str
import textwrap
"""Utility functions for the component docs page.""" import hashlib import inspect import os import re import textwrap
from typing import ( Any, Literal, Sequence, Type, Union, _GenericAlias, get_args, get_origin, ) import reflex as rx from flexdown.document import Document from reflex.base import Base from reflex.components.base.fragment import Fragment from reflex.components.component import Component from reflex.components.el.elements.base import BaseHTML from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import RadixThemesComponent from pcweb.flexdown import markdown, xd from pcweb.templates.docpage import docdemobox, docpage, get_toc, h1_comp, h2_comp def get_code_style(color: str): return { "color": rx.color(color, 11), "border_radius": "0.25rem", "border": f"1px solid {rx.color(color, 5)}", "background": rx.color(color, 3), } class Prop(Base): """Hold information about a prop.""" # The name of the prop. name: str # The type of the prop
from types import UnionType
"""Utility functions for the component docs page.""" import hashlib import inspect import os import re import textwrap from types import UnionType
import reflex as rx from flexdown.document import Document from reflex.base import Base from reflex.components.base.fragment import Fragment from reflex.components.component import Component from reflex.components.el.elements.base import BaseHTML from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import RadixThemesComponent from pcweb.flexdown import markdown, xd from pcweb.templates.docpage import docdemobox, docpage, get_toc, h1_comp, h2_comp def get_code_style(color: str): return { "color": rx.color(color, 11), "border_radius": "0.25rem", "border": f"1px solid {rx.color(color, 5)}", "background": rx.color(color, 3), } class Prop(Base): """Hold information about a prop.""" # The name of the prop. name: str # The type of the prop. type_: Any # The description of the prop. description: str # The default value of the prop. default_value
from typing import ( Any, Literal, Sequence, Type, Union, _GenericAlias, get_args, get_origin, )
"""Utility functions for the component docs page.""" import hashlib import inspect import os import re import textwrap from types import UnionType from typing import ( Any, Literal, Sequence, Type, Union, _GenericAlias, get_args, get_origin, )
from flexdown.document import Document from reflex.base import Base from reflex.components.base.fragment import Fragment from reflex.components.component import Component from reflex.components.el.elements.base import BaseHTML from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import RadixThemesComponent from pcweb.flexdown import markdown, xd from pcweb.templates.docpage import docdemobox, docpage, get_toc, h1_comp, h2_comp def get_code_style(color: str): return { "color": rx.color(color, 11), "border_radius": "0.25rem", "border": f"1px solid {rx.color(color, 5)}", "background": rx.color(color, 3), } class Prop(Base): """Hold information about a prop.""" # The name of the prop. name: str # The type of the prop. type_: Any # The description of the prop. description: str # The default value of the prop. default_value: str def get_defau
import reflex as rx
"""Utility functions for the component docs page.""" import hashlib import inspect import os import re import textwrap from types import UnionType from typing import ( Any, Literal, Sequence, Type, Union, _GenericAlias, get_args, get_origin, ) import reflex as rx
from reflex.base import Base from reflex.components.base.fragment import Fragment from reflex.components.component import Component from reflex.components.el.elements.base import BaseHTML from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import RadixThemesComponent from pcweb.flexdown import markdown, xd from pcweb.templates.docpage import docdemobox, docpage, get_toc, h1_comp, h2_comp def get_code_style(color: str): return { "color": rx.color(color, 11), "border_radius": "0.25rem", "border": f"1px solid {rx.color(color, 5)}", "background": rx.color(color, 3), } class Prop(Base): """Hold information about a prop.""" # The name of the prop. name: str # The type of the prop. type_: Any # The description of the prop. description: str # The default value of the prop. default_value: str def get_default_value(lines: list[str], start_index:
from flexdown.document import Document
"""Utility functions for the component docs page.""" import hashlib import inspect import os import re import textwrap from types import UnionType from typing import ( Any, Literal, Sequence, Type, Union, _GenericAlias, get_args, get_origin, ) import reflex as rx from flexdown.document import Document
from reflex.components.base.fragment import Fragment from reflex.components.component import Component from reflex.components.el.elements.base import BaseHTML from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import RadixThemesComponent from pcweb.flexdown import markdown, xd from pcweb.templates.docpage import docdemobox, docpage, get_toc, h1_comp, h2_comp def get_code_style(color: str): return { "color": rx.color(color, 11), "border_radius": "0.25rem", "border": f"1px solid {rx.color(color, 5)}", "background": rx.color(color, 3), } class Prop(Base): """Hold information about a prop.""" # The name of the prop. name: str # The type of the prop. type_: Any # The description of the prop. description: str # The default value of the prop. default_value: str def get_default_value(lines: list[str], start_index: int) -> str: """Process
from reflex.base import Base
"""Utility functions for the component docs page.""" import hashlib import inspect import os import re import textwrap from types import UnionType from typing import ( Any, Literal, Sequence, Type, Union, _GenericAlias, get_args, get_origin, ) import reflex as rx from flexdown.document import Document from reflex.base import Base
from reflex.components.component import Component from reflex.components.el.elements.base import BaseHTML from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import RadixThemesComponent from pcweb.flexdown import markdown, xd from pcweb.templates.docpage import docdemobox, docpage, get_toc, h1_comp, h2_comp def get_code_style(color: str): return { "color": rx.color(color, 11), "border_radius": "0.25rem", "border": f"1px solid {rx.color(color, 5)}", "background": rx.color(color, 3), } class Prop(Base): """Hold information about a prop.""" # The name of the prop. name: str # The type of the prop. type_: Any # The description of the prop. description: str # The default value of the prop. default_value: str def get_default_value(lines: list[str], start_index: int) -> str: """Process lines of code to get the value of a prop, handling mu
from reflex.components.base.fragment import Fragment