instruction stringlengths 0 1k | input stringlengths 1 1k | output stringlengths 10 6.51k |
|---|---|---|
rx.box(
*breadcrumbs,
class_name="flex flex-row items-center gap-[5px] lg:gap-4 overflow-hidden",
),
rx.box(
rx.icon(tag="chevron-down", size=14, class_name="!text-slate-9"),
class_name="p-[0.563rem] lg:hidden flex",
),
class_name="rel... |
headings = []
for child in comp.children:
headings.extend(get_headings(child))
return headings
def get_toc(source, href, component_list=None):
from pcweb.flexdown import xd
component_list = component_list or []
component_list = component_list[1:]
# Generate the TOC
# The en... | if not hasattr(comp, "children") or comp.children is None:
return [] |
-center gap-[5px] lg:gap-4 overflow-hidden",
),
rx.box(
rx.icon(tag="chevron-down", size=14, class_name="!text-slate-9"),
class_name="p-[0.563rem] lg:hidden flex",
),
class_name="relative z-10 flex flex-row justify-between items-center gap-4 lg:gap-0 border-slate-... |
for child in comp.children:
headings.extend(get_headings(child))
return headings
def get_toc(source, href, component_list=None):
from pcweb.flexdown import xd
component_list = component_list or []
component_list = component_list[1:]
# Generate the TOC
# The environment used for ... | headings = [] |
lg:gap-4 overflow-hidden",
),
rx.box(
rx.icon(tag="chevron-down", size=14, class_name="!text-slate-9"),
class_name="p-[0.563rem] lg:hidden flex",
),
class_name="relative z-10 flex flex-row justify-between items-center gap-4 lg:gap-0 border-slate-4 bg-slate-1 mt-12... |
return headings
def get_toc(source, href, component_list=None):
from pcweb.flexdown import xd
component_list = component_list or []
component_list = component_list[1:]
# Generate the TOC
# The environment used for execing and evaling code.
env = source.metadata
env["__xd"] = xd
... | for child in comp.children:
headings.extend(get_headings(child)) |
ize=14, class_name="!text-slate-9"),
class_name="p-[0.563rem] lg:hidden flex",
),
class_name="relative z-10 flex flex-row justify-between items-center gap-4 lg:gap-0 border-slate-4 bg-slate-1 mt-12 mb-6 lg:mb-8 p-[0.5rem_1rem_0.5rem_1rem] lg:p-0 border-b lg:border-none w-full"
+ rx.c... |
def docpage(
set_path: str | None = None,
t: str | None = None,
right_sidebar: bool = True,
page_title: str | None = None,
pseudo_right_bar: bool = False,
):
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
... | def get_toc(source, href, component_list=None):
from pcweb.flexdown import xd
component_list = component_list or []
component_list = component_list[1:]
# Generate the TOC
# The environment used for execing and evaling code.
env = source.metadata
env["__xd"] = xd
# Get the content of t... |
ss_name="p-[0.563rem] lg:hidden flex",
),
class_name="relative z-10 flex flex-row justify-between items-center gap-4 lg:gap-0 border-slate-4 bg-slate-1 mt-12 mb-6 lg:mb-8 p-[0.5rem_1rem_0.5rem_1rem] lg:p-0 border-b lg:border-none w-full"
+ rx.cond(
HostingBannerState.show_banner,
... |
component_list = component_list or []
component_list = component_list[1:]
# Generate the TOC
# The environment used for execing and evaling code.
env = source.metadata
env["__xd"] = xd
# Get the content of the document.
source = source.content
# Get the blocks in the source code... | from pcweb.flexdown import xd |
x",
),
class_name="relative z-10 flex flex-row justify-between items-center gap-4 lg:gap-0 border-slate-4 bg-slate-1 mt-12 mb-6 lg:mb-8 p-[0.5rem_1rem_0.5rem_1rem] lg:p-0 border-b lg:border-none w-full"
+ rx.cond(
HostingBannerState.show_banner,
" lg:mt-[175px]",
... |
component_list = component_list[1:]
# Generate the TOC
# The environment used for execing and evaling code.
env = source.metadata
env["__xd"] = xd
# Get the content of the document.
source = source.content
# Get the blocks in the source code.
# Note: we must use reflex-web's spec... | component_list = component_list or [] |
e z-10 flex flex-row justify-between items-center gap-4 lg:gap-0 border-slate-4 bg-slate-1 mt-12 mb-6 lg:mb-8 p-[0.5rem_1rem_0.5rem_1rem] lg:p-0 border-b lg:border-none w-full"
+ rx.cond(
HostingBannerState.show_banner,
" lg:mt-[175px]",
" lg:mt-[119px]",
),
)
d... |
# Generate the TOC
# The environment used for execing and evaling code.
env = source.metadata
env["__xd"] = xd
# Get the content of the document.
source = source.content
# Get the blocks in the source code.
# Note: we must use reflex-web's special flexdown instance xd here - it knows... | component_list = component_list[1:] |
rem_0.5rem_1rem] lg:p-0 border-b lg:border-none w-full"
+ rx.cond(
HostingBannerState.show_banner,
" lg:mt-[175px]",
" lg:mt-[119px]",
),
)
def get_headings(comp):
"""Get the strings from markdown component."""
if isinstance(comp, mistletoe.block_token.H... |
env["__xd"] = xd
# Get the content of the document.
source = source.content
# Get the blocks in the source code.
# Note: we must use reflex-web's special flexdown instance xd here - it knows about all custom block types (like DemoBlock)
blocks = xd.get_blocks(source, href)
content_pieces... | env = source.metadata |
rder-b lg:border-none w-full"
+ rx.cond(
HostingBannerState.show_banner,
" lg:mt-[175px]",
" lg:mt-[119px]",
),
)
def get_headings(comp):
"""Get the strings from markdown component."""
if isinstance(comp, mistletoe.block_token.Heading):
heading_t... |
# Get the content of the document.
source = source.content
# Get the blocks in the source code.
# Note: we must use reflex-web's special flexdown instance xd here - it knows about all custom block types (like DemoBlock)
blocks = xd.get_blocks(source, href)
content_pieces = []
for block i... | env["__xd"] = xd |
HostingBannerState.show_banner,
" lg:mt-[175px]",
" lg:mt-[119px]",
),
)
def get_headings(comp):
"""Get the strings from markdown component."""
if isinstance(comp, mistletoe.block_token.Heading):
heading_text = "".join(
token.content for token in comp.ch... |
# Get the blocks in the source code.
# Note: we must use reflex-web's special flexdown instance xd here - it knows about all custom block types (like DemoBlock)
blocks = xd.get_blocks(source, href)
content_pieces = []
for block in blocks:
if (
not isinstance(block, flexdown.bl... | source = source.content |
tance(comp, mistletoe.block_token.Heading):
heading_text = "".join(
token.content for token in comp.children if hasattr(token, "content")
)
return [(comp.level, heading_text)]
# Recursively get the strings from the children.
if not hasattr(comp, "children") or comp.children ... |
content_pieces = []
for block in blocks:
if (
not isinstance(block, flexdown.blocks.MarkdownBlock)
or len(block.lines) == 0
or not block.lines[0].startswith("#")
):
continue
# Now we should have all the env entries we need
content... | blocks = xd.get_blocks(source, href) |
:
heading_text = "".join(
token.content for token in comp.children if hasattr(token, "content")
)
return [(comp.level, heading_text)]
# Recursively get the strings from the children.
if not hasattr(comp, "children") or comp.children is None:
return []
headings =... |
for block in blocks:
if (
not isinstance(block, flexdown.blocks.MarkdownBlock)
or len(block.lines) == 0
or not block.lines[0].startswith("#")
):
continue
# Now we should have all the env entries we need
content = block.get_content(env)... | content_pieces = [] |
"".join(
token.content for token in comp.children if hasattr(token, "content")
)
return [(comp.level, heading_text)]
# Recursively get the strings from the children.
if not hasattr(comp, "children") or comp.children is None:
return []
headings = []
for child in com... |
content = "\n".join(content_pieces)
doc = mistletoe.Document(content)
# Parse the markdown headers.
headings = get_headings(doc)
if len(component_list):
headings.append((1, "API Reference"))
for component_tuple in component_list:
headings.append((2, component_tuple[1]))
r... | for block in blocks:
if (
not isinstance(block, flexdown.blocks.MarkdownBlock)
or len(block.lines) == 0
or not block.lines[0].startswith("#")
):
continue
# Now we should have all the env entries we need
content = block.get_content(env)
... |
ontent for token in comp.children if hasattr(token, "content")
)
return [(comp.level, heading_text)]
# Recursively get the strings from the children.
if not hasattr(comp, "children") or comp.children is None:
return []
headings = []
for child in comp.children:
headings.... |
# Now we should have all the env entries we need
content = block.get_content(env)
content_pieces.append(content)
content = "\n".join(content_pieces)
doc = mistletoe.Document(content)
# Parse the markdown headers.
headings = get_headings(doc)
if len(component_list):
... | if (
not isinstance(block, flexdown.blocks.MarkdownBlock)
or len(block.lines) == 0
or not block.lines[0].startswith("#")
):
continue |
headings = []
for child in comp.children:
headings.extend(get_headings(child))
return headings
def get_toc(source, href, component_list=None):
from pcweb.flexdown import xd
component_list = component_list or []
component_list = component_list[1:]
# Generate the TOC
# The envir... |
content_pieces.append(content)
content = "\n".join(content_pieces)
doc = mistletoe.Document(content)
# Parse the markdown headers.
headings = get_headings(doc)
if len(component_list):
headings.append((1, "API Reference"))
for component_tuple in component_list:
heading... | content = block.get_content(env) |
headings(child))
return headings
def get_toc(source, href, component_list=None):
from pcweb.flexdown import xd
component_list = component_list or []
component_list = component_list[1:]
# Generate the TOC
# The environment used for execing and evaling code.
env = source.metadata
env["... |
doc = mistletoe.Document(content)
# Parse the markdown headers.
headings = get_headings(doc)
if len(component_list):
headings.append((1, "API Reference"))
for component_tuple in component_list:
headings.append((2, component_tuple[1]))
return headings
def docpage(
set_pat... | content = "\n".join(content_pieces) |
ef get_toc(source, href, component_list=None):
from pcweb.flexdown import xd
component_list = component_list or []
component_list = component_list[1:]
# Generate the TOC
# The environment used for execing and evaling code.
env = source.metadata
env["__xd"] = xd
# Get the content of th... |
# Parse the markdown headers.
headings = get_headings(doc)
if len(component_list):
headings.append((1, "API Reference"))
for component_tuple in component_list:
headings.append((2, component_tuple[1]))
return headings
def docpage(
set_path: str | None = None,
t: str | Non... | doc = mistletoe.Document(content) |
port xd
component_list = component_list or []
component_list = component_list[1:]
# Generate the TOC
# The environment used for execing and evaling code.
env = source.metadata
env["__xd"] = xd
# Get the content of the document.
source = source.content
# Get the blocks in the sour... |
if len(component_list):
headings.append((1, "API Reference"))
for component_tuple in component_list:
headings.append((2, component_tuple[1]))
return headings
def docpage(
set_path: str | None = None,
t: str | None = None,
right_sidebar: bool = True,
page_title: str | None... | headings = get_headings(doc) |
onent_list or []
component_list = component_list[1:]
# Generate the TOC
# The environment used for execing and evaling code.
env = source.metadata
env["__xd"] = xd
# Get the content of the document.
source = source.content
# Get the blocks in the source code.
# Note: we must use r... |
for component_tuple in component_list:
headings.append((2, component_tuple[1]))
return headings
def docpage(
set_path: str | None = None,
t: str | None = None,
right_sidebar: bool = True,
page_title: str | None = None,
pseudo_right_bar: bool = False,
):
"""A template that most... | if len(component_list):
headings.append((1, "API Reference")) |
he TOC
# The environment used for execing and evaling code.
env = source.metadata
env["__xd"] = xd
# Get the content of the document.
source = source.content
# Get the blocks in the source code.
# Note: we must use reflex-web's special flexdown instance xd here - it knows about all custom ... |
return headings
def docpage(
set_path: str | None = None,
t: str | None = None,
right_sidebar: bool = True,
page_title: str | None = None,
pseudo_right_bar: bool = False,
):
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navb... | for component_tuple in component_list:
headings.append((2, component_tuple[1])) |
set_path: str | None = None,
t: str | None = None,
right_sidebar: bool = True,
page_title: str | None = None,
pseudo_right_bar: bool = False,
):
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
se... |
title = contents.__name__.replace("_", " ").title() if t is None else t
@functools.wraps(contents)
def wrapper(*args, **kwargs) -> rx.Component:
"""The actual function wrapper.
Args:
*args: Args to pass to the contents function.
**kwarg... | path = get_path(contents) if set_path is None else set_path |
sidebar: bool = True,
page_title: str | None = None,
pseudo_right_bar: bool = False,
):
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
set_path: The path to set for the sidebar.
t: The title to set ... |
@functools.wraps(contents)
def wrapper(*args, **kwargs) -> rx.Component:
"""The actual function wrapper.
Args:
*args: Args to pass to the contents function.
**kwargs: Kwargs to pass to the contents function.
Returns:
... | title = contents.__name__.replace("_", " ").title() if t is None else t |
defaults to `{title} · Reflex Docs`.
pseudo_right_bar: Whether to show a pseudo right sidebar (empty space).
Returns:
A wrapper function that returns the full webpage.
"""
def docpage(contents: Callable[[], Route]) -> Route:
"""Wrap a component in a docpage template.
Args... |
from pcweb.components.docpage.sidebar import get_prev_next
from pcweb.components.docpage.sidebar import sidebar as sb
from pcweb.components.hosting_banner import HostingBannerState
sidebar = sb(url=path, width="300px")
nav_sidebar = sb(url=path, width="100%... | from pcweb.components.docpage.navbar import navbar |
Whether to show a pseudo right sidebar (empty space).
Returns:
A wrapper function that returns the full webpage.
"""
def docpage(contents: Callable[[], Route]) -> Route:
"""Wrap a component in a docpage template.
Args:
contents: A function that returns a page route.
... |
from pcweb.components.docpage.sidebar import sidebar as sb
from pcweb.components.hosting_banner import HostingBannerState
sidebar = sb(url=path, width="300px")
nav_sidebar = sb(url=path, width="100%")
prev, next = get_prev_next(path)
links = []... | from pcweb.components.docpage.sidebar import get_prev_next |
A wrapper function that returns the full webpage.
"""
def docpage(contents: Callable[[], Route]) -> Route:
"""Wrap a component in a docpage template.
Args:
contents: A function that returns a page route.
Returns:
The final route with the template applied.... |
from pcweb.components.hosting_banner import HostingBannerState
sidebar = sb(url=path, width="300px")
nav_sidebar = sb(url=path, width="100%")
prev, next = get_prev_next(path)
links = []
if prev:
next_prev_name = (
... | from pcweb.components.docpage.sidebar import sidebar as sb |
f docpage(contents: Callable[[], Route]) -> Route:
"""Wrap a component in a docpage template.
Args:
contents: A function that returns a page route.
Returns:
The final route with the template applied.
"""
path = get_path(contents) if set_path is None else... |
sidebar = sb(url=path, width="300px")
nav_sidebar = sb(url=path, width="100%")
prev, next = get_prev_next(path)
links = []
if prev:
next_prev_name = (
prev.alt_name_for_next_prev
if prev.alt_name_for... | from pcweb.components.hosting_banner import HostingBannerState |
nt in a docpage template.
Args:
contents: A function that returns a page route.
Returns:
The final route with the template applied.
"""
path = get_path(contents) if set_path is None else set_path
title = contents.__name__.replace("_", " ").title() if t ... |
nav_sidebar = sb(url=path, width="100%")
prev, next = get_prev_next(path)
links = []
if prev:
next_prev_name = (
prev.alt_name_for_next_prev
if prev.alt_name_for_next_prev
else prev.names
... | sidebar = sb(url=path, width="300px") |
contents: A function that returns a page route.
Returns:
The final route with the template applied.
"""
path = get_path(contents) if set_path is None else set_path
title = contents.__name__.replace("_", " ").title() if t is None else t
@functools.wraps(contents)
... |
prev, next = get_prev_next(path)
links = []
if prev:
next_prev_name = (
prev.alt_name_for_next_prev
if prev.alt_name_for_next_prev
else prev.names
)
links.append(
... | nav_sidebar = sb(url=path, width="100%") |
Returns:
The final route with the template applied.
"""
path = get_path(contents) if set_path is None else set_path
title = contents.__name__.replace("_", " ").title() if t is None else t
@functools.wraps(contents)
def wrapper(*args, **kwargs) -> rx.Component:
... |
links = []
if prev:
next_prev_name = (
prev.alt_name_for_next_prev
if prev.alt_name_for_next_prev
else prev.names
)
links.append(
rx.box(
rx.l... | prev, next = get_prev_next(path) |
h the template applied.
"""
path = get_path(contents) if set_path is None else set_path
title = contents.__name__.replace("_", " ").title() if t is None else t
@functools.wraps(contents)
def wrapper(*args, **kwargs) -> rx.Component:
"""The actual function wrapper.
... |
if prev:
next_prev_name = (
prev.alt_name_for_next_prev
if prev.alt_name_for_next_prev
else prev.names
)
links.append(
rx.box(
rx.link(
... | links = [] |
"""
path = get_path(contents) if set_path is None else set_path
title = contents.__name__.replace("_", " ").title() if t is None else t
@functools.wraps(contents)
def wrapper(*args, **kwargs) -> rx.Component:
"""The actual function wrapper.
Args:
... |
links.append(rx.spacer())
if next:
next_prev_name = (
next.alt_name_for_next_prev
if next.alt_name_for_next_prev
else next.names
)
links.append(
rx.box(
... | if prev:
next_prev_name = (
prev.alt_name_for_next_prev
if prev.alt_name_for_next_prev
else prev.names
)
links.append(
rx.box(
rx.link(
rx.b... |
= get_path(contents) if set_path is None else set_path
title = contents.__name__.replace("_", " ").title() if t is None else t
@functools.wraps(contents)
def wrapper(*args, **kwargs) -> rx.Component:
"""The actual function wrapper.
Args:
*args: Args to ... |
links.append(
rx.box(
rx.link(
rx.box(
get_icon(
icon="arrow_right", transform="rotate(180deg)"
),
... | next_prev_name = (
prev.alt_name_for_next_prev
if prev.alt_name_for_next_prev
else prev.names
) |
rx.link(
rx.box(
get_icon(
icon="arrow_right", transform="rotate(180deg)"
),
"Back",
class_name="flex fl... |
toc = []
if not isinstance(contents, rx.Component):
comp = contents(*args, **kwargs)
else:
comp = contents
if isinstance(comp, tuple):
toc, comp = comp
show_right_sidebar = right_sidebar and len(toc) >= 2
... | if next:
next_prev_name = (
next.alt_name_for_next_prev
if next.alt_name_for_next_prev
else next.names
)
links.append(
rx.box(
rx.link(
rx.b... |
x.link(
rx.box(
get_icon(
icon="arrow_right", transform="rotate(180deg)"
),
"Back",
class_name="flex flex-row justify-center lg:... |
links.append(
rx.box(
rx.link(
rx.box(
"Next",
get_icon(icon="arrow_right"),
class_name="flex flex-row lg:justify-start items-center ga... | next_prev_name = (
next.alt_name_for_next_prev
if next.alt_name_for_next_prev
else next.names
) |
else next.names
)
links.append(
rx.box(
rx.link(
rx.box(
"Next",
get_icon(icon="arrow_right"),
class_... |
if isinstance(comp, tuple):
toc, comp = comp
show_right_sidebar = right_sidebar and len(toc) >= 2
return rx.box(
navbar(),
rx.el.main(
rx.box(
sidebar,
class_name=(... | if not isinstance(contents, rx.Component):
comp = contents(*args, **kwargs)
else:
comp = contents |
links.append(
rx.box(
rx.link(
rx.box(
"Next",
get_icon(icon="arrow_right"),
class_name="flex flex-row lg:justify-start items-center gap-2 rou... |
else:
comp = contents
if isinstance(comp, tuple):
toc, comp = comp
show_right_sidebar = right_sidebar and len(toc) >= 2
return rx.box(
navbar(),
rx.el.main(
rx.box(
... | comp = contents(*args, **kwargs) |
rx.link(
rx.box(
"Next",
get_icon(icon="arrow_right"),
class_name="flex flex-row lg:justify-start items-center gap-2 rounded-lg w-full self-end",
),
... |
if isinstance(comp, tuple):
toc, comp = comp
show_right_sidebar = right_sidebar and len(toc) >= 2
return rx.box(
navbar(),
rx.el.main(
rx.box(
sidebar,
class_name=(... | comp = contents |
rx.box(
"Next",
get_icon(icon="arrow_right"),
class_name="flex flex-row lg:justify-start items-center gap-2 rounded-lg w-full self-end",
),
underline="... |
show_right_sidebar = right_sidebar and len(toc) >= 2
return rx.box(
navbar(),
rx.el.main(
rx.box(
sidebar,
class_name=(
"w-full max-w-[300px] h-screen shrink-0 hidde... | if isinstance(comp, tuple):
toc, comp = comp |
"Next",
get_icon(icon="arrow_right"),
class_name="flex flex-row lg:justify-start items-center gap-2 rounded-lg w-full self-end",
),
underline="none",
href=next... |
show_right_sidebar = right_sidebar and len(toc) >= 2
return rx.box(
navbar(),
rx.el.main(
rx.box(
sidebar,
class_name=(
"w-full max-w-[300px] h-screen shrink-0 hidde... | toc, comp = comp |
get_icon(icon="arrow_right"),
class_name="flex flex-row lg:justify-start items-center gap-2 rounded-lg w-full self-end",
),
underline="none",
href=next.link,
... |
return rx.box(
navbar(),
rx.el.main(
rx.box(
sidebar,
class_name=(
"w-full max-w-[300px] h-screen shrink-0 hidden lg:block z-10 "
+ rx.cond(
... | show_right_sidebar = right_sidebar and len(toc) >= 2 |
HostingBannerState.show_banner,
" mt-[146px]",
" mt-[90px]",
)
),
id="toc-navigation",
),
class... |
category = (
" ".join(
word.capitalize() for word in components[2].replace("-", " ").split()
)
if len(components) > 2
else None
)
if page_title:
return Route(
path=path,
title=page_title,... | components = path.split("/") |
how_banner,
" mt-[146px]",
" mt-[90px]",
)
),
id="toc-navigation",
),
class_name=(
"... |
if page_title:
return Route(
path=path,
title=page_title,
component=wrapper,
)
return Route(
path=path,
title=f"{title} · Reflex Docs" if category is None else title,
component=wrapper,
)... | category = (
" ".join(
word.capitalize() for word in components[2].replace("-", " ").split()
)
if len(components) > 2
else None
) |
toc-navigation",
),
class_name=(
"w-[240px] h-screen sticky top-0 shrink-0 hidden xl:block"
),
)
if show_right_sidebar and not pseudo_right_bar
else rx.box(
... |
return Route(
path=path,
title=f"{title} · Reflex Docs" if category is None else title,
component=wrapper,
)
return docpage
class RadixDocState(rx.State):
"""The app state."""
color: str = "tomato"
@rx.event
def set_color(self, color: str):
... | if page_title:
return Route(
path=path,
title=page_title,
component=wrapper,
) |
class_name="w-[180px] h-screen sticky top-0 shrink-0 hidden xl:block"
),
class_name="flex justify-center mx-auto mt-0 max-w-[94.5em] h-full min-h-screen w-full lg:px-10",
),
class_name="flex flex-col justify-center bg-slate-1 w-full relative... |
def hover_item(component: rx.Component, component_str: str) -> rx.Component:
return rx.hover_card.root(
rx.hover_card.trigger(rx.flex(component)),
rx.hover_card.content(
rx.el.button(
get_icon(icon="copy", class_name="p-[5px]"),
rx.text(
... | class RadixDocState(rx.State):
"""The app state."""
color: str = "tomato"
@rx.event
def set_color(self, color: str):
self.color = color |
class_name="flex justify-center mx-auto mt-0 max-w-[94.5em] h-full min-h-screen w-full lg:px-10",
),
class_name="flex flex-col justify-center bg-slate-1 w-full relative",
on_mount=rx.call_script(right_sidebar_item_highlight()),
)
com... |
def hover_item(component: rx.Component, component_str: str) -> rx.Component:
return rx.hover_card.root(
rx.hover_card.trigger(rx.flex(component)),
rx.hover_card.content(
rx.el.button(
get_icon(icon="copy", class_name="p-[5px]"),
rx.text(
... | def set_color(self, color: str):
self.color = color |
y-center mx-auto mt-0 max-w-[94.5em] h-full min-h-screen w-full lg:px-10",
),
class_name="flex flex-col justify-center bg-slate-1 w-full relative",
on_mount=rx.call_script(right_sidebar_item_highlight()),
)
components = path.split("/")
categor... |
def hover_item(component: rx.Component, component_str: str) -> rx.Component:
return rx.hover_card.root(
rx.hover_card.trigger(rx.flex(component)),
rx.hover_card.content(
rx.el.button(
get_icon(icon="copy", class_name="p-[5px]"),
rx.text(
... | self.color = color |
max-w-[94.5em] h-full min-h-screen w-full lg:px-10",
),
class_name="flex flex-col justify-center bg-slate-1 w-full relative",
on_mount=rx.call_script(right_sidebar_item_highlight()),
)
components = path.split("/")
category = (
" "... |
def dict_to_formatted_string(input_dict):
# List to hold formatted string parts
formatted_parts = []
# Iterate over dictionary items
for key, value in input_dict.items():
# Format each key-value pair
if isinstance(value, str):
formatted_part = f'{key}="{value}"' # Enclos... | def hover_item(component: rx.Component, component_str: str) -> rx.Component:
return rx.hover_card.root(
rx.hover_card.trigger(rx.flex(component)),
rx.hover_card.content(
rx.el.button(
get_icon(icon="copy", class_name="p-[5px]"),
rx.text(
... |
title} · Reflex Docs" if category is None else title,
component=wrapper,
)
return docpage
class RadixDocState(rx.State):
"""The app state."""
color: str = "tomato"
@rx.event
def set_color(self, color: str):
self.color = color
def hover_item(component: rx.Component,... |
def used_component(
component_used: rx.Component,
components_passed: rx.Component | str | None,
color_scheme: str,
variant: str,
high_contrast: bool,
disabled: bool = False,
**kwargs,
) -> rx.Component:
if components_passed is None and disabled is False:
return component_used(... | def dict_to_formatted_string(input_dict):
# List to hold formatted string parts
formatted_parts = []
# Iterate over dictionary items
for key, value in input_dict.items():
# Format each key-value pair
if isinstance(value, str):
formatted_part = f'{key}="{value}"' # Enclose s... |
)
return docpage
class RadixDocState(rx.State):
"""The app state."""
color: str = "tomato"
@rx.event
def set_color(self, color: str):
self.color = color
def hover_item(component: rx.Component, component_str: str) -> rx.Component:
return rx.hover_card.root(
rx.hover_ca... |
# Iterate over dictionary items
for key, value in input_dict.items():
# Format each key-value pair
if isinstance(value, str):
formatted_part = f'{key}="{value}"' # Enclose string values in quotes
else:
formatted_part = f"{key}={value}" # Non-string values as i... | formatted_parts = [] |
"""The app state."""
color: str = "tomato"
@rx.event
def set_color(self, color: str):
self.color = color
def hover_item(component: rx.Component, component_str: str) -> rx.Component:
return rx.hover_card.root(
rx.hover_card.trigger(rx.flex(component)),
rx.hover_card.content(... |
# Join all parts with a comma and a space
return ", ".join(formatted_parts)
def used_component(
component_used: rx.Component,
components_passed: rx.Component | str | None,
color_scheme: str,
variant: str,
high_contrast: bool,
disabled: bool = False,
**kwargs,
) -> rx.Component:
... | for key, value in input_dict.items():
# Format each key-value pair
if isinstance(value, str):
formatted_part = f'{key}="{value}"' # Enclose string values in quotes
else:
formatted_part = f"{key}={value}" # Non-string values as is
# Append the formatted part to ... |
self, color: str):
self.color = color
def hover_item(component: rx.Component, component_str: str) -> rx.Component:
return rx.hover_card.root(
rx.hover_card.trigger(rx.flex(component)),
rx.hover_card.content(
rx.el.button(
get_icon(icon="copy", class_name="p-[5px... | # Non-string values as is
# Append the formatted part to the list
formatted_parts.append(formatted_part)
# Join all parts with a comma and a space
return ", ".join(formatted_parts)
def used_component(
component_used: rx.Component,
components_passed: rx.Component | str | None,
c... | if isinstance(value, str):
formatted_part = f'{key}="{value}"' # Enclose string values in quotes
else:
formatted_part = f"{key}={value}" |
color
def hover_item(component: rx.Component, component_str: str) -> rx.Component:
return rx.hover_card.root(
rx.hover_card.trigger(rx.flex(component)),
rx.hover_card.content(
rx.el.button(
get_icon(icon="copy", class_name="p-[5px]"),
rx.text(
... | # Enclose string values in quotes
else:
formatted_part = f"{key}={value}" # Non-string values as is
# Append the formatted part to the list
formatted_parts.append(formatted_part)
# Join all parts with a comma and a space
return ", ".join(formatted_parts)
def used_compo... | formatted_part = f'{key}="{value}"' |
rx.hover_card.root(
rx.hover_card.trigger(rx.flex(component)),
rx.hover_card.content(
rx.el.button(
get_icon(icon="copy", class_name="p-[5px]"),
rx.text(
component_str,
class_name="flex-1 font-small truncate",
... | # Non-string values as is
# Append the formatted part to the list
formatted_parts.append(formatted_part)
# Join all parts with a comma and a space
return ", ".join(formatted_parts)
def used_component(
component_used: rx.Component,
components_passed: rx.Component | str | None,
c... | formatted_part = f"{key}={value}" |
str,
class_name="flex-1 font-small truncate",
),
on_click=rx.set_clipboard(component_str),
class_name="flex flex-row items-center gap-1.5 border-slate-5 bg-slate-1 hover:bg-slate-3 shadow-small pr-1.5 border rounded-md w-full max-w-[300px] text-slate-1... |
def style_grid(
component_used: rx.Component,
component_used_str: str,
variants: list,
components_passed: rx.Component | str | None = None,
disabled: bool = False,
**kwargs,
) -> rx.Component:
text_cn = "text-nowrap font-md flex items-center"
return rx.box(
rx.grid(
... | def used_component(
component_used: rx.Component,
components_passed: rx.Component | str | None,
color_scheme: str,
variant: str,
high_contrast: bool,
disabled: bool = False,
**kwargs,
) -> rx.Component:
if components_passed is None and disabled is False:
return component_used(
... |
er:bg-slate-3 shadow-small pr-1.5 border rounded-md w-full max-w-[300px] text-slate-11 transition-bg cursor-pointer",
),
),
)
def dict_to_formatted_string(input_dict):
# List to hold formatted string parts
formatted_parts = []
# Iterate over dictionary items
for key, value in ... |
def style_grid(
component_used: rx.Component,
component_used_str: str,
variants: list,
components_passed: rx.Component | str | None = None,
disabled: bool = False,
**kwargs,
) -> rx.Component:
text_cn = "text-nowrap font-md flex items-center"
return rx.box(
rx.grid(
... | if components_passed is None and disabled is False:
return component_used(
color_scheme=color_scheme,
variant=variant,
high_contrast=high_contrast,
**kwargs,
)
elif components_passed is not None and disabled is False:
return component_used(
... |
else:
formatted_part = f"{key}={value}" # Non-string values as is
# Append the formatted part to the list
formatted_parts.append(formatted_part)
# Join all parts with a comma and a space
return ", ".join(formatted_parts)
def used_component(
component_used: rx.Compone... |
def style_grid(
component_used: rx.Component,
component_used_str: str,
variants: list,
components_passed: rx.Component | str | None = None,
disabled: bool = False,
**kwargs,
) -> rx.Component:
text_cn = "text-nowrap font-md flex items-center"
return rx.box(
rx.grid(
... | elif components_passed is None and disabled is True:
return component_used(
color_scheme=color_scheme,
variant=variant,
high_contrast=high_contrast,
disabled=True,
**kwargs,
)
else:
return component_used(
components_pas... |
s,
)
elif components_passed is not None and disabled is False:
return component_used(
components_passed,
color_scheme=color_scheme,
variant=variant,
high_contrast=high_contrast,
**kwargs,
)
elif components_passed is None and d... |
return rx.box(
rx.grid(
rx.text("", size="5"),
*[
rx.text(variant, class_name=text_cn + " text-slate-11")
for variant in variants
],
rx.text(
"Accent",
color=f"var(--{RadixDocState.color}-10)",
... | text_cn = "text-nowrap font-md flex items-center" |
"""The state for the navbar component."""
|
from datetime import datetime
from typing import Optional
import httpx
import reflex as rx
from httpx import Response
from sqlmodel import Field
from pcweb.constants import REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
class Feedback(rx.Model, table=True):
email: Optional[str]
feedback: str
score: O... | import contextlib |
"""The state for the navbar component."""
import contextlib
|
from typing import Optional
import httpx
import reflex as rx
from httpx import Response
from sqlmodel import Field
from pcweb.constants import REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
class Feedback(rx.Model, table=True):
email: Optional[str]
feedback: str
score: Optional[int]
date_created:... | from datetime import datetime |
"""The state for the navbar component."""
import contextlib
from datetime import datetime
|
import httpx
import reflex as rx
from httpx import Response
from sqlmodel import Field
from pcweb.constants import REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
class Feedback(rx.Model, table=True):
email: Optional[str]
feedback: str
score: Optional[int]
date_created: datetime = Field(default_fa... | from typing import Optional |
"""The state for the navbar component."""
import contextlib
from datetime import datetime
from typing import Optional
|
import reflex as rx
from httpx import Response
from sqlmodel import Field
from pcweb.constants import REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
class Feedback(rx.Model, table=True):
email: Optional[str]
feedback: str
score: Optional[int]
date_created: datetime = Field(default_factory=datetime... | import httpx |
"""The state for the navbar component."""
import contextlib
from datetime import datetime
from typing import Optional
import httpx
|
from httpx import Response
from sqlmodel import Field
from pcweb.constants import REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
class Feedback(rx.Model, table=True):
email: Optional[str]
feedback: str
score: Optional[int]
date_created: datetime = Field(default_factory=datetime.utcnow, nullable=Fa... | import reflex as rx |
"""The state for the navbar component."""
import contextlib
from datetime import datetime
from typing import Optional
import httpx
import reflex as rx
|
from sqlmodel import Field
from pcweb.constants import REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
class Feedback(rx.Model, table=True):
email: Optional[str]
feedback: str
score: Optional[int]
date_created: datetime = Field(default_factory=datetime.utcnow, nullable=False)
page: str
class ... | from httpx import Response |
"""The state for the navbar component."""
import contextlib
from datetime import datetime
from typing import Optional
import httpx
import reflex as rx
from httpx import Response
|
from pcweb.constants import REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
class Feedback(rx.Model, table=True):
email: Optional[str]
feedback: str
score: Optional[int]
date_created: datetime = Field(default_factory=datetime.utcnow, nullable=False)
page: str
class FeedbackState(rx.State):
... | from sqlmodel import Field |
"""The state for the navbar component."""
import contextlib
from datetime import datetime
from typing import Optional
import httpx
import reflex as rx
from httpx import Response
from sqlmodel import Field
|
class Feedback(rx.Model, table=True):
email: Optional[str]
feedback: str
score: Optional[int]
date_created: datetime = Field(default_factory=datetime.utcnow, nullable=False)
page: str
class FeedbackState(rx.State):
"""The state for feedback components."""
score: Optional[int] = None
... | from pcweb.constants import REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL |
"""The state for the navbar component."""
import contextlib
from datetime import datetime
from typing import Optional
import httpx
import reflex as rx
from httpx import Response
from sqlmodel import Field
from pcweb.constants import REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
|
class FeedbackState(rx.State):
"""The state for feedback components."""
score: Optional[int] = None
@rx.event
def set_score(self, value: int):
self.score = value
def _send_to_webhook(self, payload: dict, webhook_url: str) -> bool:
"""Send payload to webhook URL.
Return... | class Feedback(rx.Model, table=True):
email: Optional[str]
feedback: str
score: Optional[int]
date_created: datetime = Field(default_factory=datetime.utcnow, nullable=False)
page: str |
"""The state for the navbar component."""
import contextlib
from datetime import datetime
from typing import Optional
import httpx
import reflex as rx
from httpx import Response
from sqlmodel import Field
from pcweb.constants import REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
class Feedback(rx.Model, table=Tr... |
def _send_to_webhook(self, payload: dict, webhook_url: str) -> bool:
"""Send payload to webhook URL.
Returns:
True if successful, False otherwise
"""
try:
with httpx.Client() as client:
response: Response = client.post(
w... | def set_score(self, value: int):
self.score = value |
"""The state for the navbar component."""
import contextlib
from datetime import datetime
from typing import Optional
import httpx
import reflex as rx
from httpx import Response
from sqlmodel import Field
from pcweb.constants import REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
class Feedback(rx.Model, table=Tr... |
def _send_to_webhook(self, payload: dict, webhook_url: str) -> bool:
"""Send payload to webhook URL.
Returns:
True if successful, False otherwise
"""
try:
with httpx.Client() as client:
response: Response = client.post(
w... | self.score = value |
import Field
from pcweb.constants import REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
class Feedback(rx.Model, table=True):
email: Optional[str]
feedback: str
score: Optional[int]
date_created: datetime = Field(default_factory=datetime.utcnow, nullable=False)
page: str
class FeedbackState(r... |
def _build_integration_request_message(self, form_data: dict) -> str:
"""Build Discord message for integration request form."""
request: str = form_data["request"]
return f"""
Integration Request: {request}
"""
@rx.event
def handle_submit(self, form_data: dict):
"""Handle... | def _build_feedback_message(self, form_data: dict) -> str:
"""Build Discord message for feedback form."""
current_page_route: str = self.router.page.raw_path
email: str = form_data.get("email", "")
feedback: str = form_data["feedback"]
return f"""
Contact: {email}
Page: {current... |
one
@rx.event
def set_score(self, value: int):
self.score = value
def _send_to_webhook(self, payload: dict, webhook_url: str) -> bool:
"""Send payload to webhook URL.
Returns:
True if successful, False otherwise
"""
try:
with httpx.Client() ... |
@rx.event
def handle_submit(self, form_data: dict):
"""Handle feedback form submission."""
feedback = form_data.get("feedback", "")
# Validation
if len(feedback) < 10 or len(feedback) > 500:
return rx.toast.warning(
"Please enter your feedback. Betw... | def _build_integration_request_message(self, form_data: dict) -> str:
"""Build Discord message for integration request form."""
request: str = form_data["request"]
return f"""
Integration Request: {request}
""" |
nse: Response = client.post(
webhook_url,
json=payload,
)
response.raise_for_status()
return True
except httpx.HTTPError:
return False
def _build_feedback_message(self, form_data: dict) -> str:
"""Build ... |
# Validation
if len(feedback) < 10 or len(feedback) > 500:
return rx.toast.warning(
"Please enter your feedback. Between 10 and 500 characters.",
close_button=True,
)
# Send to general webhook (suppressed errors)
with contextlib.... | feedback = form_data.get("feedback", "") |
json=payload,
)
response.raise_for_status()
return True
except httpx.HTTPError:
return False
def _build_feedback_message(self, form_data: dict) -> str:
"""Build Discord message for feedback form."""
current_page_route: str =... |
# Send to general webhook (suppressed errors)
with contextlib.suppress(httpx.HTTPError) and httpx.Client() as client:
client.post(
REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL,
json=form_data,
)
# Build and send Discord message
... | if len(feedback) < 10 or len(feedback) > 500:
return rx.toast.warning(
"Please enter your feedback. Between 10 and 500 characters.",
close_button=True,
) |
== 1 else "👎"}
Feedback: {feedback}
"""
def _build_integration_request_message(self, form_data: dict) -> str:
"""Build Discord message for integration request form."""
request: str = form_data["request"]
return f"""
Integration Request: {request}
"""
@rx.event
def handle_submit(s... |
payload = {"text": discord_message}
success = self._send_to_webhook(
payload, REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
)
if not success:
return rx.toast.error(
"""An error occurred while submitting your feedback. If the issue persists,
p... | discord_message = self._build_feedback_message(form_data) |
n_request_message(self, form_data: dict) -> str:
"""Build Discord message for integration request form."""
request: str = form_data["request"]
return f"""
Integration Request: {request}
"""
@rx.event
def handle_submit(self, form_data: dict):
"""Handle feedback form submission."... |
success = self._send_to_webhook(
payload, REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
)
if not success:
return rx.toast.error(
"""An error occurred while submitting your feedback. If the issue persists,
please file a Github issue or stop by our Dis... | payload = {"text": discord_message} |
tr:
"""Build Discord message for integration request form."""
request: str = form_data["request"]
return f"""
Integration Request: {request}
"""
@rx.event
def handle_submit(self, form_data: dict):
"""Handle feedback form submission."""
feedback = form_data.get("feedback... |
if not success:
return rx.toast.error(
"""An error occurred while submitting your feedback. If the issue persists,
please file a Github issue or stop by our Discord.""",
close_button=True,
)
yield rx.toast.success(
"Thank you for you... | success = self._send_to_webhook(
payload, REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
) |
return f"""
Integration Request: {request}
"""
@rx.event
def handle_submit(self, form_data: dict):
"""Handle feedback form submission."""
feedback = form_data.get("feedback", "")
# Validation
if len(feedback) < 10 or len(feedback) > 500:
return rx.toast.warning(
... |
yield rx.toast.success(
"Thank you for your feedback!",
close_button=True,
)
@rx.event
def handle_integration_request(self, form_data: dict):
"""Handle integration request form submission."""
request = form_data.get("request", "")
# Validation
... | if not success:
return rx.toast.error(
"""An error occurred while submitting your feedback. If the issue persists,
please file a Github issue or stop by our Discord.""",
close_button=True,
) |
with contextlib.suppress(httpx.HTTPError) and httpx.Client() as client:
client.post(
REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL,
json=form_data,
)
# Build and send Discord message
discord_message = self._build_feedback_message(form_data)
... |
# Validation
if len(request) < 10 or len(request) > 2000:
return rx.toast.warning(
"Please describe your integration request. Between 10 and 2000 characters.",
close_button=True,
)
# Build and send Discord message
discord_message... | request = form_data.get("request", "") |
ient:
client.post(
REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL,
json=form_data,
)
# Build and send Discord message
discord_message = self._build_feedback_message(form_data)
payload = {"text": discord_message}
success = self._... |
# Build and send Discord message
discord_message = self._build_integration_request_message(form_data)
payload = {"text": discord_message}
success = self._send_to_webhook(
payload, REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
)
if not success:
... | if len(request) < 10 or len(request) > 2000:
return rx.toast.warning(
"Please describe your integration request. Between 10 and 2000 characters.",
close_button=True,
) |
t": discord_message}
success = self._send_to_webhook(
payload, REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
)
if not success:
return rx.toast.error(
"""An error occurred while submitting your feedback. If the issue persists,
please file a Github issu... |
payload = {"text": discord_message}
success = self._send_to_webhook(
payload, REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
)
if not success:
return rx.toast.error(
"""An error occurred while submitting your request. If the issue persists,
pl... | discord_message = self._build_integration_request_message(form_data) |
yload, REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
)
if not success:
return rx.toast.error(
"""An error occurred while submitting your feedback. If the issue persists,
please file a Github issue or stop by our Discord.""",
close_button=True,
... |
success = self._send_to_webhook(
payload, REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
)
if not success:
return rx.toast.error(
"""An error occurred while submitting your request. If the issue persists,
please file a Github issue or stop by our Disc... | payload = {"text": discord_message} |
EBHOOK_URL
)
if not success:
return rx.toast.error(
"""An error occurred while submitting your feedback. If the issue persists,
please file a Github issue or stop by our Discord.""",
close_button=True,
)
yield rx.toast.success(
... |
if not success:
return rx.toast.error(
"""An error occurred while submitting your request. If the issue persists,
please file a Github issue or stop by our Discord.""",
close_button=True,
)
yield rx.toast.success(
"Thank you for your... | success = self._send_to_webhook(
payload, REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
) |
e submitting your feedback. If the issue persists,
please file a Github issue or stop by our Discord.""",
close_button=True,
)
yield rx.toast.success(
"Thank you for your feedback!",
close_button=True,
)
@rx.event
def handle_integration_reque... |
yield rx.toast.success(
"Thank you for your integration request!",
close_button=True,
)
| if not success:
return rx.toast.error(
"""An error occurred while submitting your request. If the issue persists,
please file a Github issue or stop by our Discord.""",
close_button=True,
) |
"""Code block components for documentation pages."""
|
import pcweb.styles.fonts as fonts
from pcweb import styles
@rx.memo
def code_block(code: str, language: str):
return rx.box(
rx._x.code_block(
code,
language=language,
class_name="code-block",
can_copy=True,
),
class_name="relative mb-4",
... | import reflex as rx |
"""Code block components for documentation pages."""
import reflex as rx
|
from pcweb import styles
@rx.memo
def code_block(code: str, language: str):
return rx.box(
rx._x.code_block(
code,
language=language,
class_name="code-block",
can_copy=True,
),
class_name="relative mb-4",
)
@rx.memo
def code_block_dark... | import pcweb.styles.fonts as fonts |
"""Code block components for documentation pages."""
import reflex as rx
import pcweb.styles.fonts as fonts
|
@rx.memo
def code_block(code: str, language: str):
return rx.box(
rx._x.code_block(
code,
language=language,
class_name="code-block",
can_copy=True,
),
class_name="relative mb-4",
)
@rx.memo
def code_block_dark(code: str, language: str... | from pcweb import styles |
"""Code block components for documentation pages."""
import reflex as rx
import pcweb.styles.fonts as fonts
from pcweb import styles
@rx.memo
def code_block(code: str, language: str):
return rx.box(
rx._x.code_block(
code,
language=language,
class_name="code-block",
... |
def code_block_markdown_dark(*children, **props):
language = props.get("language", "plain")
return code_block_dark(code=children[0], language=language)
def doccmdoutput(
command: str,
output: str,
) -> rx.Component:
"""Create a documentation code snippet.
Args:
command: The command... | def code_block_markdown(*children, **props):
language = props.get("language", "plain")
return code_block(code=children[0], language=language) |
"""Code block components for documentation pages."""
import reflex as rx
import pcweb.styles.fonts as fonts
from pcweb import styles
@rx.memo
def code_block(code: str, language: str):
return rx.box(
rx._x.code_block(
code,
language=language,
class_name="code-block",
... |
return code_block(code=children[0], language=language)
def code_block_markdown_dark(*children, **props):
language = props.get("language", "plain")
return code_block_dark(code=children[0], language=language)
def doccmdoutput(
command: str,
output: str,
) -> rx.Component:
"""Create a document... | language = props.get("language", "plain") |
"""Code block components for documentation pages."""
import reflex as rx
import pcweb.styles.fonts as fonts
from pcweb import styles
@rx.memo
def code_block(code: str, language: str):
return rx.box(
rx._x.code_block(
code,
language=language,
class_name="code-block",
... |
def doccmdoutput(
command: str,
output: str,
) -> rx.Component:
"""Create a documentation code snippet.
Args:
command: The command to display.
output: The output of the command.
theme: The theme of the component.
Returns:
The styled command and its example output... | def code_block_markdown_dark(*children, **props):
language = props.get("language", "plain")
return code_block_dark(code=children[0], language=language) |
"""Code block components for documentation pages."""
import reflex as rx
import pcweb.styles.fonts as fonts
from pcweb import styles
@rx.memo
def code_block(code: str, language: str):
return rx.box(
rx._x.code_block(
code,
language=language,
class_name="code-block",
... |
return code_block_dark(code=children[0], language=language)
def doccmdoutput(
command: str,
output: str,
) -> rx.Component:
"""Create a documentation code snippet.
Args:
command: The command to display.
output: The output of the command.
theme: The theme of the component.... | language = props.get("language", "plain") |
"""Components for rendering code demos in the documentation."""
|
from typing import Any
import reflex as rx
import ruff_format
from .code import code_block, code_block_dark
def docdemobox(*children, **props) -> rx.Component:
"""Create a documentation demo box with the output of the code.
Args:
children: The children to display.
props: Additional props t... | import textwrap |
"""Components for rendering code demos in the documentation."""
import textwrap
|
import reflex as rx
import ruff_format
from .code import code_block, code_block_dark
def docdemobox(*children, **props) -> rx.Component:
"""Create a documentation demo box with the output of the code.
Args:
children: The children to display.
props: Additional props to apply to the box.
... | from typing import Any |
"""Components for rendering code demos in the documentation."""
import textwrap
from typing import Any
|
import ruff_format
from .code import code_block, code_block_dark
def docdemobox(*children, **props) -> rx.Component:
"""Create a documentation demo box with the output of the code.
Args:
children: The children to display.
props: Additional props to apply to the box.
Returns:
Th... | import reflex as rx |
"""Components for rendering code demos in the documentation."""
import textwrap
from typing import Any
import reflex as rx
|
from .code import code_block, code_block_dark
def docdemobox(*children, **props) -> rx.Component:
"""Create a documentation demo box with the output of the code.
Args:
children: The children to display.
props: Additional props to apply to the box.
Returns:
The styled demo box.
... | import ruff_format |
"""Components for rendering code demos in the documentation."""
import textwrap
from typing import Any
import reflex as rx
import ruff_format
|
def docdemobox(*children, **props) -> rx.Component:
"""Create a documentation demo box with the output of the code.
Args:
children: The children to display.
props: Additional props to apply to the box.
Returns:
The styled demo box.
"""
return rx.box(
*children,
... | from .code import code_block, code_block_dark |
"""Components for rendering code demos in the documentation."""
import textwrap
from typing import Any
import reflex as rx
import ruff_format
from .code import code_block, code_block_dark
|
def doccode(
code: str,
language: str = "python",
lines: tuple[int, int] | None = None,
theme: str = "light",
) -> rx.Component:
"""Create a documentation code snippet.
Args:
code: The code to display.
language: The language of the code.
lines: The start/end lines to ... | def docdemobox(*children, **props) -> rx.Component:
"""Create a documentation demo box with the output of the code.
Args:
children: The children to display.
props: Additional props to apply to the box.
Returns:
The styled demo box.
"""
return rx.box(
*children,
... |
e import code_block, code_block_dark
def docdemobox(*children, **props) -> rx.Component:
"""Create a documentation demo box with the output of the code.
Args:
children: The children to display.
props: Additional props to apply to the box.
Returns:
The styled demo box.
"""
... |
# If needed, only display a subset of the lines.
if lines is not None:
code = textwrap.dedent(
"\n".join(code.strip().splitlines()[lines[0] : lines[1]])
).strip()
# Create the code snippet.
cb = code_block_dark if theme == "dark" else code_block
return cb(
code... | if language == "python":
code = ruff_format.format_string(textwrap.dedent(code)).strip() |
ark
def docdemobox(*children, **props) -> rx.Component:
"""Create a documentation demo box with the output of the code.
Args:
children: The children to display.
props: Additional props to apply to the box.
Returns:
The styled demo box.
"""
return rx.box(
*children... |
# If needed, only display a subset of the lines.
if lines is not None:
code = textwrap.dedent(
"\n".join(code.strip().splitlines()[lines[0] : lines[1]])
).strip()
# Create the code snippet.
cb = code_block_dark if theme == "dark" else code_block
return cb(
code... | code = ruff_format.format_string(textwrap.dedent(code)).strip() |
de.
Args:
children: The children to display.
props: Additional props to apply to the box.
Returns:
The styled demo box.
"""
return rx.box(
*children,
**props,
class_name="flex flex-col p-6 rounded-xl overflow-x-auto border border-slate-4 bg-slate-2 items... |
# Create the code snippet.
cb = code_block_dark if theme == "dark" else code_block
return cb(
code=code,
language=language,
)
def docdemo(
code: str,
state: str | None = None,
comp: rx.Component | None = None,
context: bool = False,
demobox_props: dict[str, Any] |... | if lines is not None:
code = textwrap.dedent(
"\n".join(code.strip().splitlines()[lines[0] : lines[1]])
).strip() |
n: The children to display.
props: Additional props to apply to the box.
Returns:
The styled demo box.
"""
return rx.box(
*children,
**props,
class_name="flex flex-col p-6 rounded-xl overflow-x-auto border border-slate-4 bg-slate-2 items-center justify-center w-full"... |
# Create the code snippet.
cb = code_block_dark if theme == "dark" else code_block
return cb(
code=code,
language=language,
)
def docdemo(
code: str,
state: str | None = None,
comp: rx.Component | None = None,
context: bool = False,
demobox_props: dict[str, Any] |... | code = textwrap.dedent(
"\n".join(code.strip().splitlines()[lines[0] : lines[1]])
).strip() |
x(
*children,
**props,
class_name="flex flex-col p-6 rounded-xl overflow-x-auto border border-slate-4 bg-slate-2 items-center justify-center w-full",
)
def doccode(
code: str,
language: str = "python",
lines: tuple[int, int] | None = None,
theme: str = "light",
) -> rx.Comp... |
return cb(
code=code,
language=language,
)
def docdemo(
code: str,
state: str | None = None,
comp: rx.Component | None = None,
context: bool = False,
demobox_props: dict[str, Any] | None = None,
theme: str | None = None,
**props,
) -> rx.Component:
"""Create a ... | cb = code_block_dark if theme == "dark" else code_block |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.