instruction stringlengths 0 1k | input stringlengths 1 1k | output stringlengths 10 6.51k |
|---|---|---|
image: The image of the page.
demo: The demo link of the app.
meta: The meta tags of the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
|
from pcweb.pages.framework.views.footer_index import footer_index
from pcweb.views.bottom_section.bottom_section import bottom_section
# Wrap the component in the template.
return rx.box(
rx.box(
index_colors(),
navbar(),
rx.el.main(
contents(*children, **props),
class_name="w-full z-[1] relative flex flex-col mx-auto lg:border-x border-slate-3 pt-24 lg:pt-48",
),
rx.box(
bottom_section(),
class_name="border-t border-slate-3 border-x flex flex-col items-center w-full border-b",
),
footer_index(),
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans mx-auto max-w-[64.19rem]",
),
clas | from pcweb.components.docpage.navbar import navbar |
k of the app.
meta: The meta tags of the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
|
from pcweb.views.bottom_section.bottom_section import bottom_section
# Wrap the component in the template.
return rx.box(
rx.box(
index_colors(),
navbar(),
rx.el.main(
contents(*children, **props),
class_name="w-full z-[1] relative flex flex-col mx-auto lg:border-x border-slate-3 pt-24 lg:pt-48",
),
rx.box(
bottom_section(),
class_name="border-t border-slate-3 border-x flex flex-col items-center w-full border-b",
),
footer_index(),
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans mx-auto max-w-[64.19rem]",
),
class_name="relative overflow-hidden",
**props,
)
| from pcweb.pages.framework.views.footer_index import footer_index |
apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
from pcweb.pages.framework.views.footer_index import footer_index
|
# Wrap the component in the template.
return rx.box(
rx.box(
index_colors(),
navbar(),
rx.el.main(
contents(*children, **props),
class_name="w-full z-[1] relative flex flex-col mx-auto lg:border-x border-slate-3 pt-24 lg:pt-48",
),
rx.box(
bottom_section(),
class_name="border-t border-slate-3 border-x flex flex-col items-center w-full border-b",
),
footer_index(),
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans mx-auto max-w-[64.19rem]",
),
class_name="relative overflow-hidden",
**props,
)
return Route(
path=path,
title=title + " · Reflex Ap | from pcweb.views.bottom_section.bottom_section import bottom_section |
from typing import Callable
import reflex as rx
from pcweb.route import Route
def highlight_page(
path: str,
title: str = "",
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] | None = None,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image to use for social media.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
| import functools | |
import functools
|
import reflex as rx
from pcweb.route import Route
def highlight_page(
path: str,
title: str = "",
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] | None = None,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image to use for social media.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
co | from typing import Callable |
import functools
from typing import Callable
|
from pcweb.route import Route
def highlight_page(
path: str,
title: str = "",
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] | None = None,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image to use for social media.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function | import reflex as rx |
import functools
from typing import Callable
import reflex as rx
|
def highlight_page(
path: str,
title: str = "",
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] | None = None,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image to use for social media.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
| from pcweb.route import Route |
import functools
from typing import Callable
import reflex as rx
from pcweb.route import Route
def highlight_page(
path: str,
title: str = "",
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] | None = None,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image to use for social media.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
|
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
from pcweb.pages.customers.views.footer import footer_customer
from pcweb.pages.framework.index_colors import index_colors
from pcweb.views.bottom_section.bottom_section import bottom_section
# Wrap the component in the template.
| props = props or {} |
of the page.
image: The image to use for social media.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
|
from pcweb.pages.customers.views.footer import footer_customer
from pcweb.pages.framework.index_colors import index_colors
from pcweb.views.bottom_section.bottom_section import bottom_section
# Wrap the component in the template.
return rx.box(
rx.box(
index_colors(),
navbar(),
rx.el.main(
contents(*children, **props),
rx.box(class_name="flex-grow"),
class_name="w-full z-[1] relative flex flex-col justify-center mx-auto max-w-[640px] lg:px-0 px-4 pb-20",
),
rx.box(class_name="h-[1px] bg-slate-3 w-full"),
bottom_section(),
footer_customer(),
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans gap-4 mx-auto max-w-[64.19rem] lg | from pcweb.components.docpage.navbar import navbar |
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
|
from pcweb.pages.framework.index_colors import index_colors
from pcweb.views.bottom_section.bottom_section import bottom_section
# Wrap the component in the template.
return rx.box(
rx.box(
index_colors(),
navbar(),
rx.el.main(
contents(*children, **props),
rx.box(class_name="flex-grow"),
class_name="w-full z-[1] relative flex flex-col justify-center mx-auto max-w-[640px] lg:px-0 px-4 pb-20",
),
rx.box(class_name="h-[1px] bg-slate-3 w-full"),
bottom_section(),
footer_customer(),
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans gap-4 mx-auto max-w-[64.19rem] lg:border-x border-slate-3 pt-24 lg:pt-48",
),
| from pcweb.pages.customers.views.footer import footer_customer |
to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
from pcweb.pages.customers.views.footer import footer_customer
|
from pcweb.views.bottom_section.bottom_section import bottom_section
# Wrap the component in the template.
return rx.box(
rx.box(
index_colors(),
navbar(),
rx.el.main(
contents(*children, **props),
rx.box(class_name="flex-grow"),
class_name="w-full z-[1] relative flex flex-col justify-center mx-auto max-w-[640px] lg:px-0 px-4 pb-20",
),
rx.box(class_name="h-[1px] bg-slate-3 w-full"),
bottom_section(),
footer_customer(),
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans gap-4 mx-auto max-w-[64.19rem] lg:border-x border-slate-3 pt-24 lg:pt-48",
),
class_name="relative overflow-hidden",
)
return R | from pcweb.pages.framework.index_colors import index_colors |
to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
from pcweb.pages.customers.views.footer import footer_customer
from pcweb.pages.framework.index_colors import index_colors
|
# Wrap the component in the template.
return rx.box(
rx.box(
index_colors(),
navbar(),
rx.el.main(
contents(*children, **props),
rx.box(class_name="flex-grow"),
class_name="w-full z-[1] relative flex flex-col justify-center mx-auto max-w-[640px] lg:px-0 px-4 pb-20",
),
rx.box(class_name="h-[1px] bg-slate-3 w-full"),
bottom_section(),
footer_customer(),
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans gap-4 mx-auto max-w-[64.19rem] lg:border-x border-slate-3 pt-24 lg:pt-48",
),
class_name="relative overflow-hidden",
)
return Route(
path=path,
title=title,
description=des | from pcweb.views.bottom_section.bottom_section import bottom_section |
import reflex as rx
from pcweb.meta.meta import meta_tags
from pcweb.route import Route
DEFAULT_TITLE = "Web Apps in Pure Python"
def mainpage(
path: str,
title: str = DEFAULT_TITLE,
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] = meta_tags,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image of the page.
meta: The meta tags of the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def mainpage(contents: Callable[[], Route]) -> Route:
"""Wrapper | from typing import Callable | |
from typing import Callable
|
from pcweb.meta.meta import meta_tags
from pcweb.route import Route
DEFAULT_TITLE = "Web Apps in Pure Python"
def mainpage(
path: str,
title: str = DEFAULT_TITLE,
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] = meta_tags,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image of the page.
meta: The meta tags of the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def mainpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a template | import reflex as rx |
from typing import Callable
import reflex as rx
from pcweb.meta.meta import meta_tags
|
DEFAULT_TITLE = "Web Apps in Pure Python"
def mainpage(
path: str,
title: str = DEFAULT_TITLE,
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] = meta_tags,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image of the page.
meta: The meta tags of the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def mainpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create | from pcweb.route import Route |
from typing import Callable
import reflex as rx
from pcweb.meta.meta import meta_tags
from pcweb.route import Route
|
def mainpage(
path: str,
title: str = DEFAULT_TITLE,
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] = meta_tags,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image of the page.
meta: The meta tags of the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def mainpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
| DEFAULT_TITLE = "Web Apps in Pure Python" |
from typing import Callable
import reflex as rx
from pcweb.meta.meta import meta_tags
from pcweb.route import Route
DEFAULT_TITLE = "Web Apps in Pure Python"
def mainpage(
path: str,
title: str = DEFAULT_TITLE,
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] = meta_tags,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image of the page.
meta: The meta tags of the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
|
def mainpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
from pcweb.components.hosting_banner import HostingBannerState
from pcweb.pages.framework.index_colors import index_colors
from pcweb.pages.framework.views.footer_index import footer_index
from pcweb.pages.framework.views.get_started import get_started
# | props = props or {} |
The title of the page.
description: The description of the page.
image: The image of the page.
meta: The meta tags of the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def mainpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
|
from pcweb.components.hosting_banner import HostingBannerState
from pcweb.pages.framework.index_colors import index_colors
from pcweb.pages.framework.views.footer_index import footer_index
from pcweb.pages.framework.views.get_started import get_started
# Wrap the component in the template.
return rx.box(
index_colors(),
navbar(),
rx.el.main(
contents(*children, **props),
get_started(),
),
footer_index(),
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",
padding_top=rx.cond(
HostingBannerState.is_banner_visible,
"56px",
"0",
),
**props,
)
return Route(
path=path,
| from pcweb.components.docpage.navbar import navbar |
the page.
image: The image of the page.
meta: The meta tags of the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def mainpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
|
from pcweb.pages.framework.index_colors import index_colors
from pcweb.pages.framework.views.footer_index import footer_index
from pcweb.pages.framework.views.get_started import get_started
# Wrap the component in the template.
return rx.box(
index_colors(),
navbar(),
rx.el.main(
contents(*children, **props),
get_started(),
),
footer_index(),
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",
padding_top=rx.cond(
HostingBannerState.is_banner_visible,
"56px",
"0",
),
**props,
)
return Route(
path=path,
title=title,
description=description,
image= | from pcweb.components.hosting_banner import HostingBannerState |
of the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def mainpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
from pcweb.components.hosting_banner import HostingBannerState
|
from pcweb.pages.framework.views.footer_index import footer_index
from pcweb.pages.framework.views.get_started import get_started
# Wrap the component in the template.
return rx.box(
index_colors(),
navbar(),
rx.el.main(
contents(*children, **props),
get_started(),
),
footer_index(),
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",
padding_top=rx.cond(
HostingBannerState.is_banner_visible,
"56px",
"0",
),
**props,
)
return Route(
path=path,
title=title,
description=description,
image=image,
meta=meta,
component=wrapper,
| from pcweb.pages.framework.index_colors import index_colors |
_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def mainpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
from pcweb.components.hosting_banner import HostingBannerState
from pcweb.pages.framework.index_colors import index_colors
|
from pcweb.pages.framework.views.get_started import get_started
# Wrap the component in the template.
return rx.box(
index_colors(),
navbar(),
rx.el.main(
contents(*children, **props),
get_started(),
),
footer_index(),
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",
padding_top=rx.cond(
HostingBannerState.is_banner_visible,
"56px",
"0",
),
**props,
)
return Route(
path=path,
title=title,
description=description,
image=image,
meta=meta,
component=wrapper,
add_as_page=add_as_page,
)
return mainpage
| from pcweb.pages.framework.views.footer_index import footer_index |
rapper function that returns the full webpage.
"""
props = props or {}
def mainpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
from pcweb.components.hosting_banner import HostingBannerState
from pcweb.pages.framework.index_colors import index_colors
from pcweb.pages.framework.views.footer_index import footer_index
|
# Wrap the component in the template.
return rx.box(
index_colors(),
navbar(),
rx.el.main(
contents(*children, **props),
get_started(),
),
footer_index(),
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",
padding_top=rx.cond(
HostingBannerState.is_banner_visible,
"56px",
"0",
),
**props,
)
return Route(
path=path,
title=title,
description=description,
image=image,
meta=meta,
component=wrapper,
add_as_page=add_as_page,
)
return mainpage
| from pcweb.pages.framework.views.get_started import get_started |
from typing import Callable
import reflex as rx
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.index_colors import index_colors
from pcweb.route import Route
def hero(company: str, description: str, stats: list[dict[str, str]]) -> rx.Component:
return rx.box(
rx.link(
rx.icon(
tag="chevron-left",
stroke_width="2.25",
class_name="size-3.5",
),
rx.text("Customer stories", class_name="font-small"),
href="/customers",
underline="none",
class_name="flex items-center gap-2 text-slate-9 hover:!text-slate-11 transition-color w-fit",
),
rx.el.h1(
company,
class_name="gradient-heading font-x-large lg:font-xx-large text-start text-transparent",
),
rx.el.h2(description, class_name="text-slate-9 font-md-smbold"),
rx.box(
*[
rx.box(
| import functools | |
import functools
|
import reflex as rx
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.index_colors import index_colors
from pcweb.route import Route
def hero(company: str, description: str, stats: list[dict[str, str]]) -> rx.Component:
return rx.box(
rx.link(
rx.icon(
tag="chevron-left",
stroke_width="2.25",
class_name="size-3.5",
),
rx.text("Customer stories", class_name="font-small"),
href="/customers",
underline="none",
class_name="flex items-center gap-2 text-slate-9 hover:!text-slate-11 transition-color w-fit",
),
rx.el.h1(
company,
class_name="gradient-heading font-x-large lg:font-xx-large text-start text-transparent",
),
rx.el.h2(description, class_name="text-slate-9 font-md-smbold"),
rx.box(
*[
rx.box(
rx.text(stat["value" | from typing import Callable |
import functools
from typing import Callable
|
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.index_colors import index_colors
from pcweb.route import Route
def hero(company: str, description: str, stats: list[dict[str, str]]) -> rx.Component:
return rx.box(
rx.link(
rx.icon(
tag="chevron-left",
stroke_width="2.25",
class_name="size-3.5",
),
rx.text("Customer stories", class_name="font-small"),
href="/customers",
underline="none",
class_name="flex items-center gap-2 text-slate-9 hover:!text-slate-11 transition-color w-fit",
),
rx.el.h1(
company,
class_name="gradient-heading font-x-large lg:font-xx-large text-start text-transparent",
),
rx.el.h2(description, class_name="text-slate-9 font-md-smbold"),
rx.box(
*[
rx.box(
rx.text(stat["value"], class_name="text-s | import reflex as rx |
import functools
from typing import Callable
import reflex as rx
|
from pcweb.pages.framework.index_colors import index_colors
from pcweb.route import Route
def hero(company: str, description: str, stats: list[dict[str, str]]) -> rx.Component:
return rx.box(
rx.link(
rx.icon(
tag="chevron-left",
stroke_width="2.25",
class_name="size-3.5",
),
rx.text("Customer stories", class_name="font-small"),
href="/customers",
underline="none",
class_name="flex items-center gap-2 text-slate-9 hover:!text-slate-11 transition-color w-fit",
),
rx.el.h1(
company,
class_name="gradient-heading font-x-large lg:font-xx-large text-start text-transparent",
),
rx.el.h2(description, class_name="text-slate-9 font-md-smbold"),
rx.box(
*[
rx.box(
rx.text(stat["value"], class_name="text-slate-12 font-x-large"),
rx.text | from pcweb.components.icons.icons import get_icon |
import functools
from typing import Callable
import reflex as rx
from pcweb.components.icons.icons import get_icon
|
from pcweb.route import Route
def hero(company: str, description: str, stats: list[dict[str, str]]) -> rx.Component:
return rx.box(
rx.link(
rx.icon(
tag="chevron-left",
stroke_width="2.25",
class_name="size-3.5",
),
rx.text("Customer stories", class_name="font-small"),
href="/customers",
underline="none",
class_name="flex items-center gap-2 text-slate-9 hover:!text-slate-11 transition-color w-fit",
),
rx.el.h1(
company,
class_name="gradient-heading font-x-large lg:font-xx-large text-start text-transparent",
),
rx.el.h2(description, class_name="text-slate-9 font-md-smbold"),
rx.box(
*[
rx.box(
rx.text(stat["value"], class_name="text-slate-12 font-x-large"),
rx.text(stat["metric"], class_name="text-slate-9 font-small"),
| from pcweb.pages.framework.index_colors import index_colors |
import functools
from typing import Callable
import reflex as rx
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.index_colors import index_colors
|
def hero(company: str, description: str, stats: list[dict[str, str]]) -> rx.Component:
return rx.box(
rx.link(
rx.icon(
tag="chevron-left",
stroke_width="2.25",
class_name="size-3.5",
),
rx.text("Customer stories", class_name="font-small"),
href="/customers",
underline="none",
class_name="flex items-center gap-2 text-slate-9 hover:!text-slate-11 transition-color w-fit",
),
rx.el.h1(
company,
class_name="gradient-heading font-x-large lg:font-xx-large text-start text-transparent",
),
rx.el.h2(description, class_name="text-slate-9 font-md-smbold"),
rx.box(
*[
rx.box(
rx.text(stat["value"], class_name="text-slate-12 font-x-large"),
rx.text(stat["metric"], class_name="text-slate-9 font-small"),
class_name="fl | from pcweb.route import Route |
underline="none",
is_external=True,
class_name="flex flex-row items-center gap-1.5 text-slate-12 hover:!text-slate-10 transition-color",
),
# Founded
rx.box(
rx.text("Founded", class_name="text-slate-9 font-small-smbold"),
rx.text(founded, class_name="text-slate-12 font-base truncate"),
class_name="flex flex-col",
),
# Investors
rx.cond(
investors,
rx.box(
rx.text("Investors", class_name="text-slate-9 font-small-smbold"),
rx.text(investors, class_name="text-slate-12 font-base truncate"),
class_name="flex flex-col",
),
),
class_name="flex-col gap-4 w-[13rem] p-8 rounded-[1.125rem] border border-slate-3 bg-slate-2 z-[1] justify-start absolute right-[-6.5rem] top-[12rem] hidden xl:flex",
is_external=True,
)
def more_customers(current_customer: str) -> rx.Component:
|
customer_items = list(customer_data.items())
# Filter out the current company
other_customers = [
c for c in customer_items if c[1].metadata.get("company") != current_customer
]
if not other_customers:
return rx.box() # Return an empty box if there are no other customers
# Find the index of the current company in the original list
current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
)
# Get the previous and next customers
prev_index = (current_index - 1) % len(customer_items)
next_index = (current_index + 1) % len(customer_items)
prev_customer = customer_items[prev_index]
next_customer = customer_items[next_index]
# Ensure we're not using the current company
while prev_customer[1].metadata.get("company") == current_customer:
prev_index = (prev_index - 1) % len(cu | from pcweb.pages.customers.data.customers import customer_data |
ame="flex flex-row items-center gap-1.5 text-slate-12 hover:!text-slate-10 transition-color",
),
# Founded
rx.box(
rx.text("Founded", class_name="text-slate-9 font-small-smbold"),
rx.text(founded, class_name="text-slate-12 font-base truncate"),
class_name="flex flex-col",
),
# Investors
rx.cond(
investors,
rx.box(
rx.text("Investors", class_name="text-slate-9 font-small-smbold"),
rx.text(investors, class_name="text-slate-12 font-base truncate"),
class_name="flex flex-col",
),
),
class_name="flex-col gap-4 w-[13rem] p-8 rounded-[1.125rem] border border-slate-3 bg-slate-2 z-[1] justify-start absolute right-[-6.5rem] top-[12rem] hidden xl:flex",
is_external=True,
)
def more_customers(current_customer: str) -> rx.Component:
from pcweb.pages.customers.data.customers import customer_data
|
# Filter out the current company
other_customers = [
c for c in customer_items if c[1].metadata.get("company") != current_customer
]
if not other_customers:
return rx.box() # Return an empty box if there are no other customers
# Find the index of the current company in the original list
current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
)
# Get the previous and next customers
prev_index = (current_index - 1) % len(customer_items)
next_index = (current_index + 1) % len(customer_items)
prev_customer = customer_items[prev_index]
next_customer = customer_items[next_index]
# Ensure we're not using the current company
while prev_customer[1].metadata.get("company") == current_customer:
prev_index = (prev_index - 1) % len(customer_items)
prev_customer = customer_ite | customer_items = list(customer_data.items()) |
olor",
),
# Founded
rx.box(
rx.text("Founded", class_name="text-slate-9 font-small-smbold"),
rx.text(founded, class_name="text-slate-12 font-base truncate"),
class_name="flex flex-col",
),
# Investors
rx.cond(
investors,
rx.box(
rx.text("Investors", class_name="text-slate-9 font-small-smbold"),
rx.text(investors, class_name="text-slate-12 font-base truncate"),
class_name="flex flex-col",
),
),
class_name="flex-col gap-4 w-[13rem] p-8 rounded-[1.125rem] border border-slate-3 bg-slate-2 z-[1] justify-start absolute right-[-6.5rem] top-[12rem] hidden xl:flex",
is_external=True,
)
def more_customers(current_customer: str) -> rx.Component:
from pcweb.pages.customers.data.customers import customer_data
customer_items = list(customer_data.items())
# Filter out the current company
|
if not other_customers:
return rx.box() # Return an empty box if there are no other customers
# Find the index of the current company in the original list
current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
)
# Get the previous and next customers
prev_index = (current_index - 1) % len(customer_items)
next_index = (current_index + 1) % len(customer_items)
prev_customer = customer_items[prev_index]
next_customer = customer_items[next_index]
# Ensure we're not using the current company
while prev_customer[1].metadata.get("company") == current_customer:
prev_index = (prev_index - 1) % len(customer_items)
prev_customer = customer_items[prev_index]
while next_customer[1].metadata.get("company") == current_customer:
next_index = (next_index + 1) % len(customer_items)
| other_customers = [
c for c in customer_items if c[1].metadata.get("company") != current_customer
] |
ll-smbold"),
rx.text(founded, class_name="text-slate-12 font-base truncate"),
class_name="flex flex-col",
),
# Investors
rx.cond(
investors,
rx.box(
rx.text("Investors", class_name="text-slate-9 font-small-smbold"),
rx.text(investors, class_name="text-slate-12 font-base truncate"),
class_name="flex flex-col",
),
),
class_name="flex-col gap-4 w-[13rem] p-8 rounded-[1.125rem] border border-slate-3 bg-slate-2 z-[1] justify-start absolute right-[-6.5rem] top-[12rem] hidden xl:flex",
is_external=True,
)
def more_customers(current_customer: str) -> rx.Component:
from pcweb.pages.customers.data.customers import customer_data
customer_items = list(customer_data.items())
# Filter out the current company
other_customers = [
c for c in customer_items if c[1].metadata.get("company") != current_customer
]
| # Return an empty box if there are no other customers
# Find the index of the current company in the original list
current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
)
# Get the previous and next customers
prev_index = (current_index - 1) % len(customer_items)
next_index = (current_index + 1) % len(customer_items)
prev_customer = customer_items[prev_index]
next_customer = customer_items[next_index]
# Ensure we're not using the current company
while prev_customer[1].metadata.get("company") == current_customer:
prev_index = (prev_index - 1) % len(customer_items)
prev_customer = customer_items[prev_index]
while next_customer[1].metadata.get("company") == current_customer:
next_index = (next_index + 1) % len(customer_items)
next_customer = customer_items[next_index]
cu | if not other_customers:
return rx.box() |
ond(
investors,
rx.box(
rx.text("Investors", class_name="text-slate-9 font-small-smbold"),
rx.text(investors, class_name="text-slate-12 font-base truncate"),
class_name="flex flex-col",
),
),
class_name="flex-col gap-4 w-[13rem] p-8 rounded-[1.125rem] border border-slate-3 bg-slate-2 z-[1] justify-start absolute right-[-6.5rem] top-[12rem] hidden xl:flex",
is_external=True,
)
def more_customers(current_customer: str) -> rx.Component:
from pcweb.pages.customers.data.customers import customer_data
customer_items = list(customer_data.items())
# Filter out the current company
other_customers = [
c for c in customer_items if c[1].metadata.get("company") != current_customer
]
if not other_customers:
return rx.box() # Return an empty box if there are no other customers
# Find the index of the current company in the original list
|
# Get the previous and next customers
prev_index = (current_index - 1) % len(customer_items)
next_index = (current_index + 1) % len(customer_items)
prev_customer = customer_items[prev_index]
next_customer = customer_items[next_index]
# Ensure we're not using the current company
while prev_customer[1].metadata.get("company") == current_customer:
prev_index = (prev_index - 1) % len(customer_items)
prev_customer = customer_items[prev_index]
while next_customer[1].metadata.get("company") == current_customer:
next_index = (next_index + 1) % len(customer_items)
next_customer = customer_items[next_index]
customers = [
rx.box(
rx.link(
rx.box(
"Previous",
get_icon(icon="arrow_right", class_name="rotate-180"),
class_name="flex flex-row-reverse justify-center lg:justify-start items-center gap-2 rounded-lg w-full self-end",
| current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
) |
"flex flex-col",
),
),
class_name="flex-col gap-4 w-[13rem] p-8 rounded-[1.125rem] border border-slate-3 bg-slate-2 z-[1] justify-start absolute right-[-6.5rem] top-[12rem] hidden xl:flex",
is_external=True,
)
def more_customers(current_customer: str) -> rx.Component:
from pcweb.pages.customers.data.customers import customer_data
customer_items = list(customer_data.items())
# Filter out the current company
other_customers = [
c for c in customer_items if c[1].metadata.get("company") != current_customer
]
if not other_customers:
return rx.box() # Return an empty box if there are no other customers
# Find the index of the current company in the original list
current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
)
# Get the previous and next customers
|
next_index = (current_index + 1) % len(customer_items)
prev_customer = customer_items[prev_index]
next_customer = customer_items[next_index]
# Ensure we're not using the current company
while prev_customer[1].metadata.get("company") == current_customer:
prev_index = (prev_index - 1) % len(customer_items)
prev_customer = customer_items[prev_index]
while next_customer[1].metadata.get("company") == current_customer:
next_index = (next_index + 1) % len(customer_items)
next_customer = customer_items[next_index]
customers = [
rx.box(
rx.link(
rx.box(
"Previous",
get_icon(icon="arrow_right", class_name="rotate-180"),
class_name="flex flex-row-reverse justify-center lg:justify-start items-center gap-2 rounded-lg w-full self-end",
),
underline="none",
href=f"/customers/{prev_customer[1].me | prev_index = (current_index - 1) % len(customer_items) |
me="flex-col gap-4 w-[13rem] p-8 rounded-[1.125rem] border border-slate-3 bg-slate-2 z-[1] justify-start absolute right-[-6.5rem] top-[12rem] hidden xl:flex",
is_external=True,
)
def more_customers(current_customer: str) -> rx.Component:
from pcweb.pages.customers.data.customers import customer_data
customer_items = list(customer_data.items())
# Filter out the current company
other_customers = [
c for c in customer_items if c[1].metadata.get("company") != current_customer
]
if not other_customers:
return rx.box() # Return an empty box if there are no other customers
# Find the index of the current company in the original list
current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
)
# Get the previous and next customers
prev_index = (current_index - 1) % len(customer_items)
|
prev_customer = customer_items[prev_index]
next_customer = customer_items[next_index]
# Ensure we're not using the current company
while prev_customer[1].metadata.get("company") == current_customer:
prev_index = (prev_index - 1) % len(customer_items)
prev_customer = customer_items[prev_index]
while next_customer[1].metadata.get("company") == current_customer:
next_index = (next_index + 1) % len(customer_items)
next_customer = customer_items[next_index]
customers = [
rx.box(
rx.link(
rx.box(
"Previous",
get_icon(icon="arrow_right", class_name="rotate-180"),
class_name="flex flex-row-reverse justify-center lg:justify-start items-center gap-2 rounded-lg w-full self-end",
),
underline="none",
href=f"/customers/{prev_customer[1].metadata['company'].lower()}",
class_name="py | next_index = (current_index + 1) % len(customer_items) |
order-slate-3 bg-slate-2 z-[1] justify-start absolute right-[-6.5rem] top-[12rem] hidden xl:flex",
is_external=True,
)
def more_customers(current_customer: str) -> rx.Component:
from pcweb.pages.customers.data.customers import customer_data
customer_items = list(customer_data.items())
# Filter out the current company
other_customers = [
c for c in customer_items if c[1].metadata.get("company") != current_customer
]
if not other_customers:
return rx.box() # Return an empty box if there are no other customers
# Find the index of the current company in the original list
current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
)
# Get the previous and next customers
prev_index = (current_index - 1) % len(customer_items)
next_index = (current_index + 1) % len(customer_items)
|
next_customer = customer_items[next_index]
# Ensure we're not using the current company
while prev_customer[1].metadata.get("company") == current_customer:
prev_index = (prev_index - 1) % len(customer_items)
prev_customer = customer_items[prev_index]
while next_customer[1].metadata.get("company") == current_customer:
next_index = (next_index + 1) % len(customer_items)
next_customer = customer_items[next_index]
customers = [
rx.box(
rx.link(
rx.box(
"Previous",
get_icon(icon="arrow_right", class_name="rotate-180"),
class_name="flex flex-row-reverse justify-center lg:justify-start items-center gap-2 rounded-lg w-full self-end",
),
underline="none",
href=f"/customers/{prev_customer[1].metadata['company'].lower()}",
class_name="py-0.5 lg:py-0 rounded-lg lg:w-auto font-small tex | prev_customer = customer_items[prev_index] |
solute right-[-6.5rem] top-[12rem] hidden xl:flex",
is_external=True,
)
def more_customers(current_customer: str) -> rx.Component:
from pcweb.pages.customers.data.customers import customer_data
customer_items = list(customer_data.items())
# Filter out the current company
other_customers = [
c for c in customer_items if c[1].metadata.get("company") != current_customer
]
if not other_customers:
return rx.box() # Return an empty box if there are no other customers
# Find the index of the current company in the original list
current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
)
# Get the previous and next customers
prev_index = (current_index - 1) % len(customer_items)
next_index = (current_index + 1) % len(customer_items)
prev_customer = customer_items[prev_index]
|
# Ensure we're not using the current company
while prev_customer[1].metadata.get("company") == current_customer:
prev_index = (prev_index - 1) % len(customer_items)
prev_customer = customer_items[prev_index]
while next_customer[1].metadata.get("company") == current_customer:
next_index = (next_index + 1) % len(customer_items)
next_customer = customer_items[next_index]
customers = [
rx.box(
rx.link(
rx.box(
"Previous",
get_icon(icon="arrow_right", class_name="rotate-180"),
class_name="flex flex-row-reverse justify-center lg:justify-start items-center gap-2 rounded-lg w-full self-end",
),
underline="none",
href=f"/customers/{prev_customer[1].metadata['company'].lower()}",
class_name="py-0.5 lg:py-0 rounded-lg lg:w-auto font-small text-slate-9 hover:!text-slate-11 transition-color | next_customer = customer_items[next_index] |
stomers(current_customer: str) -> rx.Component:
from pcweb.pages.customers.data.customers import customer_data
customer_items = list(customer_data.items())
# Filter out the current company
other_customers = [
c for c in customer_items if c[1].metadata.get("company") != current_customer
]
if not other_customers:
return rx.box() # Return an empty box if there are no other customers
# Find the index of the current company in the original list
current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
)
# Get the previous and next customers
prev_index = (current_index - 1) % len(customer_items)
next_index = (current_index + 1) % len(customer_items)
prev_customer = customer_items[prev_index]
next_customer = customer_items[next_index]
# Ensure we're not using the current company
|
while next_customer[1].metadata.get("company") == current_customer:
next_index = (next_index + 1) % len(customer_items)
next_customer = customer_items[next_index]
customers = [
rx.box(
rx.link(
rx.box(
"Previous",
get_icon(icon="arrow_right", class_name="rotate-180"),
class_name="flex flex-row-reverse justify-center lg:justify-start items-center gap-2 rounded-lg w-full self-end",
),
underline="none",
href=f"/customers/{prev_customer[1].metadata['company'].lower()}",
class_name="py-0.5 lg:py-0 rounded-lg lg:w-auto font-small text-slate-9 hover:!text-slate-11 transition-color",
),
rx.box(
rx.image(
src=rx.color_mode_cond(
light=f"/customers/light/{prev_customer[1].metadata['company'].lower()}/{prev_customer[1].metadata['c | while prev_customer[1].metadata.get("company") == current_customer:
prev_index = (prev_index - 1) % len(customer_items)
prev_customer = customer_items[prev_index] |
rs.data.customers import customer_data
customer_items = list(customer_data.items())
# Filter out the current company
other_customers = [
c for c in customer_items if c[1].metadata.get("company") != current_customer
]
if not other_customers:
return rx.box() # Return an empty box if there are no other customers
# Find the index of the current company in the original list
current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
)
# Get the previous and next customers
prev_index = (current_index - 1) % len(customer_items)
next_index = (current_index + 1) % len(customer_items)
prev_customer = customer_items[prev_index]
next_customer = customer_items[next_index]
# Ensure we're not using the current company
while prev_customer[1].metadata.get("company") == current_customer:
|
prev_customer = customer_items[prev_index]
while next_customer[1].metadata.get("company") == current_customer:
next_index = (next_index + 1) % len(customer_items)
next_customer = customer_items[next_index]
customers = [
rx.box(
rx.link(
rx.box(
"Previous",
get_icon(icon="arrow_right", class_name="rotate-180"),
class_name="flex flex-row-reverse justify-center lg:justify-start items-center gap-2 rounded-lg w-full self-end",
),
underline="none",
href=f"/customers/{prev_customer[1].metadata['company'].lower()}",
class_name="py-0.5 lg:py-0 rounded-lg lg:w-auto font-small text-slate-9 hover:!text-slate-11 transition-color",
),
rx.box(
rx.image(
src=rx.color_mode_cond(
light=f"/customers/light/{prev_customer[1].metadat | prev_index = (prev_index - 1) % len(customer_items) |
list(customer_data.items())
# Filter out the current company
other_customers = [
c for c in customer_items if c[1].metadata.get("company") != current_customer
]
if not other_customers:
return rx.box() # Return an empty box if there are no other customers
# Find the index of the current company in the original list
current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
)
# Get the previous and next customers
prev_index = (current_index - 1) % len(customer_items)
next_index = (current_index + 1) % len(customer_items)
prev_customer = customer_items[prev_index]
next_customer = customer_items[next_index]
# Ensure we're not using the current company
while prev_customer[1].metadata.get("company") == current_customer:
prev_index = (prev_index - 1) % len(customer_items)
|
while next_customer[1].metadata.get("company") == current_customer:
next_index = (next_index + 1) % len(customer_items)
next_customer = customer_items[next_index]
customers = [
rx.box(
rx.link(
rx.box(
"Previous",
get_icon(icon="arrow_right", class_name="rotate-180"),
class_name="flex flex-row-reverse justify-center lg:justify-start items-center gap-2 rounded-lg w-full self-end",
),
underline="none",
href=f"/customers/{prev_customer[1].metadata['company'].lower()}",
class_name="py-0.5 lg:py-0 rounded-lg lg:w-auto font-small text-slate-9 hover:!text-slate-11 transition-color",
),
rx.box(
rx.image(
src=rx.color_mode_cond(
light=f"/customers/light/{prev_customer[1].metadata['company'].lower()}/{prev_customer[1].metadata['c | prev_customer = customer_items[prev_index] |
he current company
other_customers = [
c for c in customer_items if c[1].metadata.get("company") != current_customer
]
if not other_customers:
return rx.box() # Return an empty box if there are no other customers
# Find the index of the current company in the original list
current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
)
# Get the previous and next customers
prev_index = (current_index - 1) % len(customer_items)
next_index = (current_index + 1) % len(customer_items)
prev_customer = customer_items[prev_index]
next_customer = customer_items[next_index]
# Ensure we're not using the current company
while prev_customer[1].metadata.get("company") == current_customer:
prev_index = (prev_index - 1) % len(customer_items)
prev_customer = customer_items[prev_index]
|
customers = [
rx.box(
rx.link(
rx.box(
"Previous",
get_icon(icon="arrow_right", class_name="rotate-180"),
class_name="flex flex-row-reverse justify-center lg:justify-start items-center gap-2 rounded-lg w-full self-end",
),
underline="none",
href=f"/customers/{prev_customer[1].metadata['company'].lower()}",
class_name="py-0.5 lg:py-0 rounded-lg lg:w-auto font-small text-slate-9 hover:!text-slate-11 transition-color",
),
rx.box(
rx.image(
src=rx.color_mode_cond(
light=f"/customers/light/{prev_customer[1].metadata['company'].lower()}/{prev_customer[1].metadata['company'].lower()}_small.svg",
dark=f"/customers/dark/{prev_customer[1].metadata['company'].lower()}/{prev_customer[1].metadata['company'].lower()}_small.svg",
| while next_customer[1].metadata.get("company") == current_customer:
next_index = (next_index + 1) % len(customer_items)
next_customer = customer_items[next_index] |
if c[1].metadata.get("company") != current_customer
]
if not other_customers:
return rx.box() # Return an empty box if there are no other customers
# Find the index of the current company in the original list
current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
)
# Get the previous and next customers
prev_index = (current_index - 1) % len(customer_items)
next_index = (current_index + 1) % len(customer_items)
prev_customer = customer_items[prev_index]
next_customer = customer_items[next_index]
# Ensure we're not using the current company
while prev_customer[1].metadata.get("company") == current_customer:
prev_index = (prev_index - 1) % len(customer_items)
prev_customer = customer_items[prev_index]
while next_customer[1].metadata.get("company") == current_customer:
|
next_customer = customer_items[next_index]
customers = [
rx.box(
rx.link(
rx.box(
"Previous",
get_icon(icon="arrow_right", class_name="rotate-180"),
class_name="flex flex-row-reverse justify-center lg:justify-start items-center gap-2 rounded-lg w-full self-end",
),
underline="none",
href=f"/customers/{prev_customer[1].metadata['company'].lower()}",
class_name="py-0.5 lg:py-0 rounded-lg lg:w-auto font-small text-slate-9 hover:!text-slate-11 transition-color",
),
rx.box(
rx.image(
src=rx.color_mode_cond(
light=f"/customers/light/{prev_customer[1].metadata['company'].lower()}/{prev_customer[1].metadata['company'].lower()}_small.svg",
dark=f"/customers/dark/{prev_customer[1].metadata['company'].lower()}/{prev_cus | next_index = (next_index + 1) % len(customer_items) |
if not other_customers:
return rx.box() # Return an empty box if there are no other customers
# Find the index of the current company in the original list
current_index = next(
(
i
for i, (_, doc) in enumerate(customer_items)
if doc.metadata.get("company") == current_customer
),
0,
)
# Get the previous and next customers
prev_index = (current_index - 1) % len(customer_items)
next_index = (current_index + 1) % len(customer_items)
prev_customer = customer_items[prev_index]
next_customer = customer_items[next_index]
# Ensure we're not using the current company
while prev_customer[1].metadata.get("company") == current_customer:
prev_index = (prev_index - 1) % len(customer_items)
prev_customer = customer_items[prev_index]
while next_customer[1].metadata.get("company") == current_customer:
next_index = (next_index + 1) % len(customer_items)
|
customers = [
rx.box(
rx.link(
rx.box(
"Previous",
get_icon(icon="arrow_right", class_name="rotate-180"),
class_name="flex flex-row-reverse justify-center lg:justify-start items-center gap-2 rounded-lg w-full self-end",
),
underline="none",
href=f"/customers/{prev_customer[1].metadata['company'].lower()}",
class_name="py-0.5 lg:py-0 rounded-lg lg:w-auto font-small text-slate-9 hover:!text-slate-11 transition-color",
),
rx.box(
rx.image(
src=rx.color_mode_cond(
light=f"/customers/light/{prev_customer[1].metadata['company'].lower()}/{prev_customer[1].metadata['company'].lower()}_small.svg",
dark=f"/customers/dark/{prev_customer[1].metadata['company'].lower()}/{prev_customer[1].metadata['company'].lower()}_small.svg",
| next_customer = customer_items[next_index] |
storypage(
path: str,
description: str,
company: str,
domain: str | None = None,
founded: str | None = None,
investors: str | None = None,
stats: list[dict[str, str]] | None = None,
meta: list[dict[str, str]] | None = None,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
description: The description of the page.
company: The company name.
domain: The company domain.
founded: The company founded date.
investors: The company investors.
stats: The company stats to show in the hero.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
|
def storypage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
from pcweb.pages.customers.views.footer import footer_customer
from pcweb.views.bottom_section.bottom_section import bottom_section
# Wrap the component in the template.
return rx.box(
rx.box(
i | props = props or {} |
stors.
stats: The company stats to show in the hero.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def storypage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
|
from pcweb.pages.customers.views.footer import footer_customer
from pcweb.views.bottom_section.bottom_section import bottom_section
# Wrap the component in the template.
return rx.box(
rx.box(
index_colors(),
navbar(),
company_card(company, founded, investors, domain),
rx.el.main(
hero(company, description, stats),
contents(*children, **props),
more_customers(company),
rx.box(class_name="flex-grow"),
class_name="w-full z-[1] relative flex flex-col justify-center mx-auto max-w-[640px] lg:px-0 px-4 pb-20",
),
rx.box(class_name="h-[1px] bg-slate-3 w-full"),
bottom_section(),
footer_customer(),
class_name="relative flex flex-col j | from pcweb.components.docpage.navbar import navbar |
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def storypage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
|
from pcweb.views.bottom_section.bottom_section import bottom_section
# Wrap the component in the template.
return rx.box(
rx.box(
index_colors(),
navbar(),
company_card(company, founded, investors, domain),
rx.el.main(
hero(company, description, stats),
contents(*children, **props),
more_customers(company),
rx.box(class_name="flex-grow"),
class_name="w-full z-[1] relative flex flex-col justify-center mx-auto max-w-[640px] lg:px-0 px-4 pb-20",
),
rx.box(class_name="h-[1px] bg-slate-3 w-full"),
bottom_section(),
footer_customer(),
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans g | from pcweb.pages.customers.views.footer import footer_customer |
o apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def storypage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
from pcweb.pages.customers.views.footer import footer_customer
|
# Wrap the component in the template.
return rx.box(
rx.box(
index_colors(),
navbar(),
company_card(company, founded, investors, domain),
rx.el.main(
hero(company, description, stats),
contents(*children, **props),
more_customers(company),
rx.box(class_name="flex-grow"),
class_name="w-full z-[1] relative flex flex-col justify-center mx-auto max-w-[640px] lg:px-0 px-4 pb-20",
),
rx.box(class_name="h-[1px] bg-slate-3 w-full"),
bottom_section(),
footer_customer(),
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans gap-4 mx-auto max-w-[64.19rem] lg:border-x border-slate-3 pt-24 lg:pt-48",
| from pcweb.views.bottom_section.bottom_section import bottom_section |
from typing import Callable
import reflex as rx
from pcweb.route import Route
DEFAULT_TITLE = "Web Apps in Pure Python"
def webpage(
path: str,
title: str = DEFAULT_TITLE,
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] | None = None,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image to use for social media.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
| import functools | |
import functools
|
import reflex as rx
from pcweb.route import Route
DEFAULT_TITLE = "Web Apps in Pure Python"
def webpage(
path: str,
title: str = DEFAULT_TITLE,
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] | None = None,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image to use for social media.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a | from typing import Callable |
import functools
from typing import Callable
|
from pcweb.route import Route
DEFAULT_TITLE = "Web Apps in Pure Python"
def webpage(
path: str,
title: str = DEFAULT_TITLE,
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] | None = None,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image to use for social media.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
| import reflex as rx |
import functools
from typing import Callable
import reflex as rx
|
DEFAULT_TITLE = "Web Apps in Pure Python"
def webpage(
path: str,
title: str = DEFAULT_TITLE,
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] | None = None,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image to use for social media.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
content | from pcweb.route import Route |
import functools
from typing import Callable
import reflex as rx
from pcweb.route import Route
|
def webpage(
path: str,
title: str = DEFAULT_TITLE,
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] | None = None,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image to use for social media.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
| DEFAULT_TITLE = "Web Apps in Pure Python" |
import functools
from typing import Callable
import reflex as rx
from pcweb.route import Route
DEFAULT_TITLE = "Web Apps in Pure Python"
def webpage(
path: str,
title: str = DEFAULT_TITLE,
description: str | None = None,
image: str | None = None,
meta: list[dict[str, str]] | None = None,
props=None,
add_as_page=True,
) -> Callable:
"""A template that most pages on the reflex.dev site should use.
This template wraps the webpage with the navbar and footer.
Args:
path: The path of the page.
title: The title of the page.
description: The description of the page.
image: The image to use for social media.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
|
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
from pcweb.components.icons.patterns import default_patterns
from pcweb.views.bottom_section.bottom_section import bottom_section
from pcweb.views.footer import footer
# Wrap the component in the template.
return rx.box( | props = props or {} |
of the page.
image: The image to use for social media.
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
|
from pcweb.components.icons.patterns import default_patterns
from pcweb.views.bottom_section.bottom_section import bottom_section
from pcweb.views.footer import footer
# Wrap the component in the template.
return rx.box(
*default_patterns(),
navbar(),
rx.el.main(
contents(*children, **props),
rx.box(class_name="flex-grow"),
class_name="w-full z-[1]",
),
bottom_section(),
footer(),
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans overflow-hidden",
**props,
)
return Route(
path=path,
title=title,
description=description,
image=image,
meta=meta,
component=wrapper,
add_as_page=add_ | from pcweb.components.docpage.navbar import navbar |
meta: Additional meta tags to add to the page.
props: Props to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
|
from pcweb.views.bottom_section.bottom_section import bottom_section
from pcweb.views.footer import footer
# Wrap the component in the template.
return rx.box(
*default_patterns(),
navbar(),
rx.el.main(
contents(*children, **props),
rx.box(class_name="flex-grow"),
class_name="w-full z-[1]",
),
bottom_section(),
footer(),
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans overflow-hidden",
**props,
)
return Route(
path=path,
title=title,
description=description,
image=image,
meta=meta,
component=wrapper,
add_as_page=add_as_page,
)
return webpage
| from pcweb.components.icons.patterns import default_patterns |
ps to apply to the template.
add_as_page: whether to add the route to the app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
from pcweb.components.icons.patterns import default_patterns
|
from pcweb.views.footer import footer
# Wrap the component in the template.
return rx.box(
*default_patterns(),
navbar(),
rx.el.main(
contents(*children, **props),
rx.box(class_name="flex-grow"),
class_name="w-full z-[1]",
),
bottom_section(),
footer(),
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans overflow-hidden",
**props,
)
return Route(
path=path,
title=title,
description=description,
image=image,
meta=meta,
component=wrapper,
add_as_page=add_as_page,
)
return webpage
| from pcweb.views.bottom_section.bottom_section import bottom_section |
app pages.
Returns:
A wrapper function that returns the full webpage.
"""
props = props or {}
def webpage(contents: Callable[[], Route]) -> Route:
"""Wrapper to create a templated route.
Args:
contents: The function to create the page route.
Returns:
The templated route.
"""
@functools.wraps(contents)
def wrapper(*children, **props) -> rx.Component:
"""The template component.
Args:
children: The children components.
props: The props to apply to the component.
Returns:
The component with the template applied.
"""
# Import here to avoid circular imports.
from pcweb.components.docpage.navbar import navbar
from pcweb.components.icons.patterns import default_patterns
from pcweb.views.bottom_section.bottom_section import bottom_section
|
# Wrap the component in the template.
return rx.box(
*default_patterns(),
navbar(),
rx.el.main(
contents(*children, **props),
rx.box(class_name="flex-grow"),
class_name="w-full z-[1]",
),
bottom_section(),
footer(),
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans overflow-hidden",
**props,
)
return Route(
path=path,
title=title,
description=description,
image=image,
meta=meta,
component=wrapper,
add_as_page=add_as_page,
)
return webpage
| from pcweb.views.footer import footer |
"""Template for documentation pages."""
|
from datetime import datetime
from typing import Callable
import flexdown
import mistletoe
import reflex as rx
from reflex.components.radix.themes.base import LiteralAccentColor
from reflex.utils.format import to_snake_case, to_title_case
from pcweb.components.button import button
from pcweb.components.icons.icons import get_icon
from pcweb.route import Route, get_path
from pcweb.styles.colors import c_color
from .blocks import *
from .state import FeedbackState
def right_sidebar_item_highlight():
return r"""
function setupTableOfContentsHighlight() {
// Delay to ensure DOM is fully loaded
setTimeout(() => {
const tocLinks = document.querySelectorAll('#toc-navigation a');
const activeClass = 'text-violet-9';
const defaultClass = 'text-slate-9';
function normalizeId(id) {
return id.toLowerCase().replace(/\s+/g, '-');
}
function highlightTocLink() {
// Get the current hash from the URL
| import functools |
"""Template for documentation pages."""
import functools
|
from typing import Callable
import flexdown
import mistletoe
import reflex as rx
from reflex.components.radix.themes.base import LiteralAccentColor
from reflex.utils.format import to_snake_case, to_title_case
from pcweb.components.button import button
from pcweb.components.icons.icons import get_icon
from pcweb.route import Route, get_path
from pcweb.styles.colors import c_color
from .blocks import *
from .state import FeedbackState
def right_sidebar_item_highlight():
return r"""
function setupTableOfContentsHighlight() {
// Delay to ensure DOM is fully loaded
setTimeout(() => {
const tocLinks = document.querySelectorAll('#toc-navigation a');
const activeClass = 'text-violet-9';
const defaultClass = 'text-slate-9';
function normalizeId(id) {
return id.toLowerCase().replace(/\s+/g, '-');
}
function highlightTocLink() {
// Get the current hash from the URL
const currentHash = window | from datetime import datetime |
"""Template for documentation pages."""
import functools
from datetime import datetime
|
import flexdown
import mistletoe
import reflex as rx
from reflex.components.radix.themes.base import LiteralAccentColor
from reflex.utils.format import to_snake_case, to_title_case
from pcweb.components.button import button
from pcweb.components.icons.icons import get_icon
from pcweb.route import Route, get_path
from pcweb.styles.colors import c_color
from .blocks import *
from .state import FeedbackState
def right_sidebar_item_highlight():
return r"""
function setupTableOfContentsHighlight() {
// Delay to ensure DOM is fully loaded
setTimeout(() => {
const tocLinks = document.querySelectorAll('#toc-navigation a');
const activeClass = 'text-violet-9';
const defaultClass = 'text-slate-9';
function normalizeId(id) {
return id.toLowerCase().replace(/\s+/g, '-');
}
function highlightTocLink() {
// Get the current hash from the URL
const currentHash = window.location.hash.substring(1); | from typing import Callable |
"""Template for documentation pages."""
import functools
from datetime import datetime
from typing import Callable
|
import mistletoe
import reflex as rx
from reflex.components.radix.themes.base import LiteralAccentColor
from reflex.utils.format import to_snake_case, to_title_case
from pcweb.components.button import button
from pcweb.components.icons.icons import get_icon
from pcweb.route import Route, get_path
from pcweb.styles.colors import c_color
from .blocks import *
from .state import FeedbackState
def right_sidebar_item_highlight():
return r"""
function setupTableOfContentsHighlight() {
// Delay to ensure DOM is fully loaded
setTimeout(() => {
const tocLinks = document.querySelectorAll('#toc-navigation a');
const activeClass = 'text-violet-9';
const defaultClass = 'text-slate-9';
function normalizeId(id) {
return id.toLowerCase().replace(/\s+/g, '-');
}
function highlightTocLink() {
// Get the current hash from the URL
const currentHash = window.location.hash.substring(1);
// | import flexdown |
"""Template for documentation pages."""
import functools
from datetime import datetime
from typing import Callable
import flexdown
|
import reflex as rx
from reflex.components.radix.themes.base import LiteralAccentColor
from reflex.utils.format import to_snake_case, to_title_case
from pcweb.components.button import button
from pcweb.components.icons.icons import get_icon
from pcweb.route import Route, get_path
from pcweb.styles.colors import c_color
from .blocks import *
from .state import FeedbackState
def right_sidebar_item_highlight():
return r"""
function setupTableOfContentsHighlight() {
// Delay to ensure DOM is fully loaded
setTimeout(() => {
const tocLinks = document.querySelectorAll('#toc-navigation a');
const activeClass = 'text-violet-9';
const defaultClass = 'text-slate-9';
function normalizeId(id) {
return id.toLowerCase().replace(/\s+/g, '-');
}
function highlightTocLink() {
// Get the current hash from the URL
const currentHash = window.location.hash.substring(1);
// Reset all links
| import mistletoe |
"""Template for documentation pages."""
import functools
from datetime import datetime
from typing import Callable
import flexdown
import mistletoe
|
from reflex.components.radix.themes.base import LiteralAccentColor
from reflex.utils.format import to_snake_case, to_title_case
from pcweb.components.button import button
from pcweb.components.icons.icons import get_icon
from pcweb.route import Route, get_path
from pcweb.styles.colors import c_color
from .blocks import *
from .state import FeedbackState
def right_sidebar_item_highlight():
return r"""
function setupTableOfContentsHighlight() {
// Delay to ensure DOM is fully loaded
setTimeout(() => {
const tocLinks = document.querySelectorAll('#toc-navigation a');
const activeClass = 'text-violet-9';
const defaultClass = 'text-slate-9';
function normalizeId(id) {
return id.toLowerCase().replace(/\s+/g, '-');
}
function highlightTocLink() {
// Get the current hash from the URL
const currentHash = window.location.hash.substring(1);
// Reset all links
tocLinks. | import reflex as rx |
"""Template for documentation pages."""
import functools
from datetime import datetime
from typing import Callable
import flexdown
import mistletoe
import reflex as rx
|
from reflex.utils.format import to_snake_case, to_title_case
from pcweb.components.button import button
from pcweb.components.icons.icons import get_icon
from pcweb.route import Route, get_path
from pcweb.styles.colors import c_color
from .blocks import *
from .state import FeedbackState
def right_sidebar_item_highlight():
return r"""
function setupTableOfContentsHighlight() {
// Delay to ensure DOM is fully loaded
setTimeout(() => {
const tocLinks = document.querySelectorAll('#toc-navigation a');
const activeClass = 'text-violet-9';
const defaultClass = 'text-slate-9';
function normalizeId(id) {
return id.toLowerCase().replace(/\s+/g, '-');
}
function highlightTocLink() {
// Get the current hash from the URL
const currentHash = window.location.hash.substring(1);
// Reset all links
tocLinks.forEach(link => {
link.classList.remove(activeClass | from reflex.components.radix.themes.base import LiteralAccentColor |
"""Template for documentation pages."""
import functools
from datetime import datetime
from typing import Callable
import flexdown
import mistletoe
import reflex as rx
from reflex.components.radix.themes.base import LiteralAccentColor
|
from pcweb.components.button import button
from pcweb.components.icons.icons import get_icon
from pcweb.route import Route, get_path
from pcweb.styles.colors import c_color
from .blocks import *
from .state import FeedbackState
def right_sidebar_item_highlight():
return r"""
function setupTableOfContentsHighlight() {
// Delay to ensure DOM is fully loaded
setTimeout(() => {
const tocLinks = document.querySelectorAll('#toc-navigation a');
const activeClass = 'text-violet-9';
const defaultClass = 'text-slate-9';
function normalizeId(id) {
return id.toLowerCase().replace(/\s+/g, '-');
}
function highlightTocLink() {
// Get the current hash from the URL
const currentHash = window.location.hash.substring(1);
// Reset all links
tocLinks.forEach(link => {
link.classList.remove(activeClass);
link.classList.add(defaultClass);
| from reflex.utils.format import to_snake_case, to_title_case |
"""Template for documentation pages."""
import functools
from datetime import datetime
from typing import Callable
import flexdown
import mistletoe
import reflex as rx
from reflex.components.radix.themes.base import LiteralAccentColor
from reflex.utils.format import to_snake_case, to_title_case
|
from pcweb.components.icons.icons import get_icon
from pcweb.route import Route, get_path
from pcweb.styles.colors import c_color
from .blocks import *
from .state import FeedbackState
def right_sidebar_item_highlight():
return r"""
function setupTableOfContentsHighlight() {
// Delay to ensure DOM is fully loaded
setTimeout(() => {
const tocLinks = document.querySelectorAll('#toc-navigation a');
const activeClass = 'text-violet-9';
const defaultClass = 'text-slate-9';
function normalizeId(id) {
return id.toLowerCase().replace(/\s+/g, '-');
}
function highlightTocLink() {
// Get the current hash from the URL
const currentHash = window.location.hash.substring(1);
// Reset all links
tocLinks.forEach(link => {
link.classList.remove(activeClass);
link.classList.add(defaultClass);
});
// If there's a hash, f | from pcweb.components.button import button |
"""Template for documentation pages."""
import functools
from datetime import datetime
from typing import Callable
import flexdown
import mistletoe
import reflex as rx
from reflex.components.radix.themes.base import LiteralAccentColor
from reflex.utils.format import to_snake_case, to_title_case
from pcweb.components.button import button
from pcweb.components.icons.icons import get_icon
|
from pcweb.styles.colors import c_color
from .blocks import *
from .state import FeedbackState
def right_sidebar_item_highlight():
return r"""
function setupTableOfContentsHighlight() {
// Delay to ensure DOM is fully loaded
setTimeout(() => {
const tocLinks = document.querySelectorAll('#toc-navigation a');
const activeClass = 'text-violet-9';
const defaultClass = 'text-slate-9';
function normalizeId(id) {
return id.toLowerCase().replace(/\s+/g, '-');
}
function highlightTocLink() {
// Get the current hash from the URL
const currentHash = window.location.hash.substring(1);
// Reset all links
tocLinks.forEach(link => {
link.classList.remove(activeClass);
link.classList.add(defaultClass);
});
// If there's a hash, find and highlight the corresponding link
if (currentHash) {
co | from pcweb.route import Route, get_path |
"""Template for documentation pages."""
import functools
from datetime import datetime
from typing import Callable
import flexdown
import mistletoe
import reflex as rx
from reflex.components.radix.themes.base import LiteralAccentColor
from reflex.utils.format import to_snake_case, to_title_case
from pcweb.components.button import button
from pcweb.components.icons.icons import get_icon
from pcweb.route import Route, get_path
|
from .blocks import *
from .state import FeedbackState
def right_sidebar_item_highlight():
return r"""
function setupTableOfContentsHighlight() {
// Delay to ensure DOM is fully loaded
setTimeout(() => {
const tocLinks = document.querySelectorAll('#toc-navigation a');
const activeClass = 'text-violet-9';
const defaultClass = 'text-slate-9';
function normalizeId(id) {
return id.toLowerCase().replace(/\s+/g, '-');
}
function highlightTocLink() {
// Get the current hash from the URL
const currentHash = window.location.hash.substring(1);
// Reset all links
tocLinks.forEach(link => {
link.classList.remove(activeClass);
link.classList.add(defaultClass);
});
// If there's a hash, find and highlight the corresponding link
if (currentHash) {
const correspondingLink = Array.from(tocLi | from pcweb.styles.colors import c_color |
"""Template for documentation pages."""
import functools
from datetime import datetime
from typing import Callable
import flexdown
import mistletoe
import reflex as rx
from reflex.components.radix.themes.base import LiteralAccentColor
from reflex.utils.format import to_snake_case, to_title_case
from pcweb.components.button import button
from pcweb.components.icons.icons import get_icon
from pcweb.route import Route, get_path
from pcweb.styles.colors import c_color
|
from .state import FeedbackState
def right_sidebar_item_highlight():
return r"""
function setupTableOfContentsHighlight() {
// Delay to ensure DOM is fully loaded
setTimeout(() => {
const tocLinks = document.querySelectorAll('#toc-navigation a');
const activeClass = 'text-violet-9';
const defaultClass = 'text-slate-9';
function normalizeId(id) {
return id.toLowerCase().replace(/\s+/g, '-');
}
function highlightTocLink() {
// Get the current hash from the URL
const currentHash = window.location.hash.substring(1);
// Reset all links
tocLinks.forEach(link => {
link.classList.remove(activeClass);
link.classList.add(defaultClass);
});
// If there's a hash, find and highlight the corresponding link
if (currentHash) {
const correspondingLink = Array.from(tocLinks).find(link => {
| from .blocks import * |
"""Template for documentation pages."""
import functools
from datetime import datetime
from typing import Callable
import flexdown
import mistletoe
import reflex as rx
from reflex.components.radix.themes.base import LiteralAccentColor
from reflex.utils.format import to_snake_case, to_title_case
from pcweb.components.button import button
from pcweb.components.icons.icons import get_icon
from pcweb.route import Route, get_path
from pcweb.styles.colors import c_color
from .blocks import *
|
def right_sidebar_item_highlight():
return r"""
function setupTableOfContentsHighlight() {
// Delay to ensure DOM is fully loaded
setTimeout(() => {
const tocLinks = document.querySelectorAll('#toc-navigation a');
const activeClass = 'text-violet-9';
const defaultClass = 'text-slate-9';
function normalizeId(id) {
return id.toLowerCase().replace(/\s+/g, '-');
}
function highlightTocLink() {
// Get the current hash from the URL
const currentHash = window.location.hash.substring(1);
// Reset all links
tocLinks.forEach(link => {
link.classList.remove(activeClass);
link.classList.add(defaultClass);
});
// If there's a hash, find and highlight the corresponding link
if (currentHash) {
const correspondingLink = Array.from(tocLinks).find(link => {
// Extract the I | from .state import FeedbackState |
"""Template for documentation pages."""
import functools
from datetime import datetime
from typing import Callable
import flexdown
import mistletoe
import reflex as rx
from reflex.components.radix.themes.base import LiteralAccentColor
from reflex.utils.format import to_snake_case, to_title_case
from pcweb.components.button import button
from pcweb.components.icons.icons import get_icon
from pcweb.route import Route, get_path
from pcweb.styles.colors import c_color
from .blocks import *
from .state import FeedbackState
|
def footer_link(text: str, href: str):
return rx.link(
text,
class_name="font-small text-slate-9 hover:!text-slate-11 transition-color",
href=href,
underline="none",
)
def footer_link_flex(heading: str, links):
return rx.box(
rx.el.h4(
heading,
class_name="font-semibold text-slate-12 text-sm tracking-[-0.01313rem]",
),
*links,
class_name="flex flex-col gap-4",
)
def thumb_card(score: int, icon: str) -> rx.Component:
return rx.el.button(
rx.icon(
tag=icon,
color=rx.cond(
FeedbackState.score == score, c_color("slate", 11), c_color("slate", 9)
),
size=16,
),
background_color=rx.cond(
FeedbackState.score == score, c_color("slate", 3), c_color("white", 1)
),
on_click=FeedbackState.set_score(score),
class_name="transition-bg hover:bg-slate-3 shadow-medium b | def right_sidebar_item_highlight():
return r"""
function setupTableOfContentsHighlight() {
// Delay to ensure DOM is fully loaded
setTimeout(() => {
const tocLinks = document.querySelectorAll('#toc-navigation a');
const activeClass = 'text-violet-9';
const defaultClass = 'text-slate-9';
function normalizeId(id) {
return id.toLowerCase().replace(/\s+/g, '-');
}
function highlightTocLink() {
// Get the current hash from the URL
const currentHash = window.location.hash.substring(1);
// Reset all links
tocLinks.forEach(link => {
link.classList.remove(activeClass);
link.classList.add(defaultClass);
});
// If there's a hash, find and highlight the corresponding link
if (currentHash) {
const correspondingLink = Array.from(tocLinks).find(link => {
// Extract the ID from the link's href
const linkHash = new URL(link.href).hash.substring(1);
return normalizeId(linkHash) === normalizeId(currentHash);
});
if (correspondingLink) {
correspondingLink.classList.remove(defaultClass);
correspondingLink.classList.add(activeClass);
}
}
}
// Add click event listeners to TOC links to force highlight
tocLinks.forEach(link => {
link.addEventListener('click', (e) => {
// Remove active class from all links
tocLinks.forEach(otherLink => {
otherLink.classList.remove(activeClass);
otherLink.classList.add(defaultClass);
});
// Add active class to clicked link
e.target.classList.remove(defaultClass);
e.target.classList.add(activeClass);
});
});
// Intersection Observer for scroll-based highlighting
const observerOptions = {
root: null,
rootMargin: '-20% 0px -70% 0px',
threshold: 0
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const headerId = entry.target.id;
// Find corresponding TOC link
const correspondingLink = Array.from(tocLinks).find(link => {
const linkHash = new URL(link.href).hash.substring(1);
return normalizeId(linkHash) === normalizeId(headerId);
});
if (correspondingLink) {
// Reset all links
tocLinks.forEach(link => {
link.classList.remove(activeClass);
link.classList.add(defaultClass);
});
// Highlight current link
correspondingLink.classList.remove(defaultClass);
correspondingLink.classList.add(activeClass);
}
}
});
}, observerOptions);
// Observe headers
const headerSelectors = Array.from(tocLinks).map(link =>
new URL(link.href).hash.substring(1)
);
headerSelectors.forEach(selector => {
const header = document.getElementById(selector);
if (header) {
observer.observe(header);
}
});
// Initial highlighting
highlightTocLink();
// Handle hash changes
window.addEventListener('hashchange', highlightTocLink);
}, 100);
}
// Run the function when the page loads
setupTableOfContentsHighlight();
""" |
ve(activeClass);
link.classList.add(defaultClass);
});
// Highlight current link
correspondingLink.classList.remove(defaultClass);
correspondingLink.classList.add(activeClass);
}
}
});
}, observerOptions);
// Observe headers
const headerSelectors = Array.from(tocLinks).map(link =>
new URL(link.href).hash.substring(1)
);
headerSelectors.forEach(selector => {
const header = document.getElementById(selector);
if (header) {
observer.observe(header);
}
});
// Initial highlighting
highlightTocLink();
// Handle hash changes
window.addEventListener('hashchange', highlightTocLink);
}, 100);
}
// Run the function when the page loads
setupTableOfContentsHighlight();
"""
|
def footer_link_flex(heading: str, links):
return rx.box(
rx.el.h4(
heading,
class_name="font-semibold text-slate-12 text-sm tracking-[-0.01313rem]",
),
*links,
class_name="flex flex-col gap-4",
)
def thumb_card(score: int, icon: str) -> rx.Component:
return rx.el.button(
rx.icon(
tag=icon,
color=rx.cond(
FeedbackState.score == score, c_color("slate", 11), c_color("slate", 9)
),
size=16,
),
background_color=rx.cond(
FeedbackState.score == score, c_color("slate", 3), c_color("white", 1)
),
on_click=FeedbackState.set_score(score),
class_name="transition-bg hover:bg-slate-3 shadow-medium border border-slate-4 rounded-lg items-center justify-center cursor-pointer p-2 size-9 flex",
)
def thumbs_cards() -> rx.Component:
return rx.hstack(
thumb_card(1, "thumbs-up"),
thumb_c | def footer_link(text: str, href: str):
return rx.link(
text,
class_name="font-small text-slate-9 hover:!text-slate-11 transition-color",
href=href,
underline="none",
) |
remove(defaultClass);
correspondingLink.classList.add(activeClass);
}
}
});
}, observerOptions);
// Observe headers
const headerSelectors = Array.from(tocLinks).map(link =>
new URL(link.href).hash.substring(1)
);
headerSelectors.forEach(selector => {
const header = document.getElementById(selector);
if (header) {
observer.observe(header);
}
});
// Initial highlighting
highlightTocLink();
// Handle hash changes
window.addEventListener('hashchange', highlightTocLink);
}, 100);
}
// Run the function when the page loads
setupTableOfContentsHighlight();
"""
def footer_link(text: str, href: str):
return rx.link(
text,
class_name="font-small text-slate-9 hover:!text-slate-11 transition-color",
href=href,
underline="none",
)
|
def thumb_card(score: int, icon: str) -> rx.Component:
return rx.el.button(
rx.icon(
tag=icon,
color=rx.cond(
FeedbackState.score == score, c_color("slate", 11), c_color("slate", 9)
),
size=16,
),
background_color=rx.cond(
FeedbackState.score == score, c_color("slate", 3), c_color("white", 1)
),
on_click=FeedbackState.set_score(score),
class_name="transition-bg hover:bg-slate-3 shadow-medium border border-slate-4 rounded-lg items-center justify-center cursor-pointer p-2 size-9 flex",
)
def thumbs_cards() -> rx.Component:
return rx.hstack(
thumb_card(1, "thumbs-up"),
thumb_card(0, "thumbs-down"),
gap="8px",
)
def feedback_content() -> rx.Component:
return rx.box(
rx.box(
rx.text(
"Send feedback",
class_name="font-md text-slate-11",
),
rx.fo | def footer_link_flex(heading: str, links):
return rx.box(
rx.el.h4(
heading,
class_name="font-semibold text-slate-12 text-sm tracking-[-0.01313rem]",
),
*links,
class_name="flex flex-col gap-4",
) |
ink =>
new URL(link.href).hash.substring(1)
);
headerSelectors.forEach(selector => {
const header = document.getElementById(selector);
if (header) {
observer.observe(header);
}
});
// Initial highlighting
highlightTocLink();
// Handle hash changes
window.addEventListener('hashchange', highlightTocLink);
}, 100);
}
// Run the function when the page loads
setupTableOfContentsHighlight();
"""
def footer_link(text: str, href: str):
return rx.link(
text,
class_name="font-small text-slate-9 hover:!text-slate-11 transition-color",
href=href,
underline="none",
)
def footer_link_flex(heading: str, links):
return rx.box(
rx.el.h4(
heading,
class_name="font-semibold text-slate-12 text-sm tracking-[-0.01313rem]",
),
*links,
class_name="flex flex-col gap-4",
)
|
def thumbs_cards() -> rx.Component:
return rx.hstack(
thumb_card(1, "thumbs-up"),
thumb_card(0, "thumbs-down"),
gap="8px",
)
def feedback_content() -> rx.Component:
return rx.box(
rx.box(
rx.text(
"Send feedback",
class_name="font-md text-slate-11",
),
rx.form(
rx.box(
rx.el.textarea(
name="feedback",
placeholder="Write a comment…",
type="text",
max_length=500,
enter_key_submit=True,
resize="vertical",
required=True,
class_name="w-full h-full p-2 text-slate-11 font-small bg-white-1 border border-slate-4 rounded-[10px] max-h-[300px] min-h-[72px] outline-none overflow-y-auto placeholder-slate-9 focus:border-violet-9 focus:border-1",
| def thumb_card(score: int, icon: str) -> rx.Component:
return rx.el.button(
rx.icon(
tag=icon,
color=rx.cond(
FeedbackState.score == score, c_color("slate", 11), c_color("slate", 9)
),
size=16,
),
background_color=rx.cond(
FeedbackState.score == score, c_color("slate", 3), c_color("white", 1)
),
on_click=FeedbackState.set_score(score),
class_name="transition-bg hover:bg-slate-3 shadow-medium border border-slate-4 rounded-lg items-center justify-center cursor-pointer p-2 size-9 flex",
) |
small text-slate-9 hover:!text-slate-11 transition-color",
href=href,
underline="none",
)
def footer_link_flex(heading: str, links):
return rx.box(
rx.el.h4(
heading,
class_name="font-semibold text-slate-12 text-sm tracking-[-0.01313rem]",
),
*links,
class_name="flex flex-col gap-4",
)
def thumb_card(score: int, icon: str) -> rx.Component:
return rx.el.button(
rx.icon(
tag=icon,
color=rx.cond(
FeedbackState.score == score, c_color("slate", 11), c_color("slate", 9)
),
size=16,
),
background_color=rx.cond(
FeedbackState.score == score, c_color("slate", 3), c_color("white", 1)
),
on_click=FeedbackState.set_score(score),
class_name="transition-bg hover:bg-slate-3 shadow-medium border border-slate-4 rounded-lg items-center justify-center cursor-pointer p-2 size-9 flex",
)
|
def feedback_content() -> rx.Component:
return rx.box(
rx.box(
rx.text(
"Send feedback",
class_name="font-md text-slate-11",
),
rx.form(
rx.box(
rx.el.textarea(
name="feedback",
placeholder="Write a comment…",
type="text",
max_length=500,
enter_key_submit=True,
resize="vertical",
required=True,
class_name="w-full h-full p-2 text-slate-11 font-small bg-white-1 border border-slate-4 rounded-[10px] max-h-[300px] min-h-[72px] outline-none overflow-y-auto placeholder-slate-9 focus:border-violet-9 focus:border-1",
),
thumbs_cards(),
rx.el.input(
name="email",
type="email",
| def thumbs_cards() -> rx.Component:
return rx.hstack(
thumb_card(1, "thumbs-up"),
thumb_card(0, "thumbs-down"),
gap="8px",
) |
return rx.box(
rx.el.h4(
heading,
class_name="font-semibold text-slate-12 text-sm tracking-[-0.01313rem]",
),
*links,
class_name="flex flex-col gap-4",
)
def thumb_card(score: int, icon: str) -> rx.Component:
return rx.el.button(
rx.icon(
tag=icon,
color=rx.cond(
FeedbackState.score == score, c_color("slate", 11), c_color("slate", 9)
),
size=16,
),
background_color=rx.cond(
FeedbackState.score == score, c_color("slate", 3), c_color("white", 1)
),
on_click=FeedbackState.set_score(score),
class_name="transition-bg hover:bg-slate-3 shadow-medium border border-slate-4 rounded-lg items-center justify-center cursor-pointer p-2 size-9 flex",
)
def thumbs_cards() -> rx.Component:
return rx.hstack(
thumb_card(1, "thumbs-up"),
thumb_card(0, "thumbs-down"),
gap="8px",
)
|
def feedback_button() -> rx.Component:
thumb_cn = " flex flex-row items-center justify-center gap-2 text-slate-9 whitespace-nowrap border border-slate-5 bg-slate-1 shadow-large cursor-pointer transition-bg hover:bg-slate-3 font-small"
return rx.popover.root(
rx.box(
rx.popover.trigger(
rx.box(
rx.icon(tag="thumbs-up", size=15, class_name="!text-slate-9"),
rx.text(
"Yes",
),
class_name="w-full gap-2 border-r-0 px-3 py-0.5 rounded-[20px_0_0_20px]"
+ thumb_cn,
),
on_click=FeedbackState.set_score(1),
),
rx.popover.trigger(
rx.box(
rx.icon(tag="thumbs-down", size=15, class_name="!text-slate-9"),
rx.text(
"No",
),
class_name="w-full gap-2 px-3 py-0.5 | def feedback_content() -> rx.Component:
return rx.box(
rx.box(
rx.text(
"Send feedback",
class_name="font-md text-slate-11",
),
rx.form(
rx.box(
rx.el.textarea(
name="feedback",
placeholder="Write a comment…",
type="text",
max_length=500,
enter_key_submit=True,
resize="vertical",
required=True,
class_name="w-full h-full p-2 text-slate-11 font-small bg-white-1 border border-slate-4 rounded-[10px] max-h-[300px] min-h-[72px] outline-none overflow-y-auto placeholder-slate-9 focus:border-violet-9 focus:border-1",
),
thumbs_cards(),
rx.el.input(
name="email",
type="email",
placeholder="Contact email (optional)",
max_length=100,
class_name="w-full h-full p-2 text-slate-11 font-small bg-white-1 border border-slate-4 rounded-[10px] box-border outline-none placeholder-slate-9 focus:border-violet-9 focus:border-1",
),
rx.box(
rx.popover.close(
button(
"Send",
type="submit",
)
),
rx.popover.close(
button(
"Cancel",
variant="secondary",
)
),
class_name="flex flex-row gap-4 justify-between items-center",
),
class_name="w-full gap-4 flex flex-col",
),
class_name="w-full",
reset_on_submit=True,
on_submit=FeedbackState.handle_submit,
),
class_name="flex flex-col gap-4 w-full",
),
class_name="rounded-[26px] bg-white-1 w-[341px] max-h-[564px] shadow-large h-auto p-4",
) |
),
rx.box(
rx.popover.close(
button(
"Send",
type="submit",
)
),
rx.popover.close(
button(
"Cancel",
variant="secondary",
)
),
class_name="flex flex-row gap-4 justify-between items-center",
),
class_name="w-full gap-4 flex flex-col",
),
class_name="w-full",
reset_on_submit=True,
on_submit=FeedbackState.handle_submit,
),
class_name="flex flex-col gap-4 w-full",
),
class_name="rounded-[26px] bg-white-1 w-[341px] max-h-[564px] shadow-large h-auto p-4",
)
|
def link_pill(text: str, href: str) -> rx.Component:
return rx.link(
text,
href=href,
underline="none",
class_name="lg:flex hidden flex-row justify-center items-center gap-2 lg:border-slate-5 bg-slate-3 lg:bg-slate-1 hover:bg-slate-3 shadow-none lg:shadow-large px-3 py-0.5 lg:border lg:border-solid border-none rounded-lg lg:rounded-full w-auto font-small font-small text-slate-9 !hover:text-slate-11 hover:!text-slate-9 truncate whitespace-nowrap transition-bg transition-color cursor-pointer",
)
@rx.memo
def docpage_footer(path: str):
from pcweb.constants import FORUM_URL, ROADMAP_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started, hosting
from pcweb.pages.docs.library import library
from pcweb.pages.errors import errors
from pcweb.pages.faq import faq
from pcweb.pages.framework.views.footer_index import dark_mode_toggle
from pcweb.pages.gallery import gallery
from pcweb.view | def feedback_button() -> rx.Component:
thumb_cn = " flex flex-row items-center justify-center gap-2 text-slate-9 whitespace-nowrap border border-slate-5 bg-slate-1 shadow-large cursor-pointer transition-bg hover:bg-slate-3 font-small"
return rx.popover.root(
rx.box(
rx.popover.trigger(
rx.box(
rx.icon(tag="thumbs-up", size=15, class_name="!text-slate-9"),
rx.text(
"Yes",
),
class_name="w-full gap-2 border-r-0 px-3 py-0.5 rounded-[20px_0_0_20px]"
+ thumb_cn,
),
on_click=FeedbackState.set_score(1),
),
rx.popover.trigger(
rx.box(
rx.icon(tag="thumbs-down", size=15, class_name="!text-slate-9"),
rx.text(
"No",
),
class_name="w-full gap-2 px-3 py-0.5 rounded-[0_20px_20px_0]"
+ thumb_cn,
),
on_click=FeedbackState.set_score(0),
),
class_name="w-full lg:w-auto items-center flex flex-row",
),
rx.popover.content(
feedback_content(),
align="start",
class_name="border-none left-0 lg:left-[-255px] origin-bottom lg:origin-bottom-right !p-0 overflow-visible !bg-transparent shadow-none",
avoid_collisions=True,
),
) |
(
rx.popover.close(
button(
"Send",
type="submit",
)
),
rx.popover.close(
button(
"Cancel",
variant="secondary",
)
),
class_name="flex flex-row gap-4 justify-between items-center",
),
class_name="w-full gap-4 flex flex-col",
),
class_name="w-full",
reset_on_submit=True,
on_submit=FeedbackState.handle_submit,
),
class_name="flex flex-col gap-4 w-full",
),
class_name="rounded-[26px] bg-white-1 w-[341px] max-h-[564px] shadow-large h-auto p-4",
)
def feedback_button() -> rx.Component:
|
return rx.popover.root(
rx.box(
rx.popover.trigger(
rx.box(
rx.icon(tag="thumbs-up", size=15, class_name="!text-slate-9"),
rx.text(
"Yes",
),
class_name="w-full gap-2 border-r-0 px-3 py-0.5 rounded-[20px_0_0_20px]"
+ thumb_cn,
),
on_click=FeedbackState.set_score(1),
),
rx.popover.trigger(
rx.box(
rx.icon(tag="thumbs-down", size=15, class_name="!text-slate-9"),
rx.text(
"No",
),
class_name="w-full gap-2 px-3 py-0.5 rounded-[0_20px_20px_0]"
+ thumb_cn,
),
on_click=FeedbackState.set_score(0),
),
class_name="w-full lg:w-auto items-center flex flex-row",
),
rx.popov | thumb_cn = " flex flex-row items-center justify-center gap-2 text-slate-9 whitespace-nowrap border border-slate-5 bg-slate-1 shadow-large cursor-pointer transition-bg hover:bg-slate-3 font-small" |
class_name="w-full gap-2 border-r-0 px-3 py-0.5 rounded-[20px_0_0_20px]"
+ thumb_cn,
),
on_click=FeedbackState.set_score(1),
),
rx.popover.trigger(
rx.box(
rx.icon(tag="thumbs-down", size=15, class_name="!text-slate-9"),
rx.text(
"No",
),
class_name="w-full gap-2 px-3 py-0.5 rounded-[0_20px_20px_0]"
+ thumb_cn,
),
on_click=FeedbackState.set_score(0),
),
class_name="w-full lg:w-auto items-center flex flex-row",
),
rx.popover.content(
feedback_content(),
align="start",
class_name="border-none left-0 lg:left-[-255px] origin-bottom lg:origin-bottom-right !p-0 overflow-visible !bg-transparent shadow-none",
avoid_collisions=True,
),
)
|
@rx.memo
def docpage_footer(path: str):
from pcweb.constants import FORUM_URL, ROADMAP_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started, hosting
from pcweb.pages.docs.library import library
from pcweb.pages.errors import errors
from pcweb.pages.faq import faq
from pcweb.pages.framework.views.footer_index import dark_mode_toggle
from pcweb.pages.gallery import gallery
from pcweb.views.footer import menu_socials, newsletter_form, ph_1
return rx.el.footer(
rx.box(
rx.box(
rx.text(
"Did you find this useful?",
class_name="font-small text-slate-11 lg:text-slate-9 whitespace-nowrap",
),
feedback_button(),
class_name="flex lg:flex-row flex-col items-center gap-3 lg:gap-4 bg-slate-3 lg:bg-transparent p-4 lg:p-0 rounded-lg w-full",
),
rx.box(
link_pill(
| def link_pill(text: str, href: str) -> rx.Component:
return rx.link(
text,
href=href,
underline="none",
class_name="lg:flex hidden flex-row justify-center items-center gap-2 lg:border-slate-5 bg-slate-3 lg:bg-slate-1 hover:bg-slate-3 shadow-none lg:shadow-large px-3 py-0.5 lg:border lg:border-solid border-none rounded-lg lg:rounded-full w-auto font-small font-small text-slate-9 !hover:text-slate-11 hover:!text-slate-9 truncate whitespace-nowrap transition-bg transition-color cursor-pointer",
) |
),
on_click=FeedbackState.set_score(0),
),
class_name="w-full lg:w-auto items-center flex flex-row",
),
rx.popover.content(
feedback_content(),
align="start",
class_name="border-none left-0 lg:left-[-255px] origin-bottom lg:origin-bottom-right !p-0 overflow-visible !bg-transparent shadow-none",
avoid_collisions=True,
),
)
def link_pill(text: str, href: str) -> rx.Component:
return rx.link(
text,
href=href,
underline="none",
class_name="lg:flex hidden flex-row justify-center items-center gap-2 lg:border-slate-5 bg-slate-3 lg:bg-slate-1 hover:bg-slate-3 shadow-none lg:shadow-large px-3 py-0.5 lg:border lg:border-solid border-none rounded-lg lg:rounded-full w-auto font-small font-small text-slate-9 !hover:text-slate-11 hover:!text-slate-9 truncate whitespace-nowrap transition-bg transition-color cursor-pointer",
)
@rx.memo
|
def breadcrumb(path: str, nav_sidebar: rx.Component):
from pcweb.components.docpage.navbar.buttons.sidebar import docs_sidebar_drawer
# Split the path into segments, removing 'docs' and capitalizing each segment
segments = [
segment.capitalize()
for segment in path.split("/")
if segment and segment != "docs"
]
# Initialize an empty list to store the breadcrumbs and their separators
breadcrumbs = []
# Iteratively build the href for each segment
current_path = "/docs"
for i, segment in enumerate(segments):
current_path += f"/{segment.lower()}"
# Add the breadcrumb item to the list
breadcrumbs.append(
rx.link(
to_title_case(to_snake_case(segment), sep=" "),
class_name="font-small text-slate-9 hover:!text-slate-11 transition-color"
+ (" truncate" if i == len(segments) - 1 else ""),
underline="none",
href=curre | def docpage_footer(path: str):
from pcweb.constants import FORUM_URL, ROADMAP_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started, hosting
from pcweb.pages.docs.library import library
from pcweb.pages.errors import errors
from pcweb.pages.faq import faq
from pcweb.pages.framework.views.footer_index import dark_mode_toggle
from pcweb.pages.gallery import gallery
from pcweb.views.footer import menu_socials, newsletter_form, ph_1
return rx.el.footer(
rx.box(
rx.box(
rx.text(
"Did you find this useful?",
class_name="font-small text-slate-11 lg:text-slate-9 whitespace-nowrap",
),
feedback_button(),
class_name="flex lg:flex-row flex-col items-center gap-3 lg:gap-4 bg-slate-3 lg:bg-transparent p-4 lg:p-0 rounded-lg w-full",
),
rx.box(
link_pill(
"Raise an issue",
href=f"https://github.com/reflex-dev/reflex-web/issues/new?title=Issue with reflex.dev documentation&body=Path: {path}",
),
link_pill(
"Edit this page",
f"https://github.com/reflex-dev/reflex-web/tree/main{path}.md",
),
class_name="lg:flex hidden flex-row items-center gap-2 w-auto",
),
class_name="flex flex-row justify-center lg:justify-between items-center border-slate-4 border-y-0 lg:border-y pt-0 lg:pt-8 pb-6 lg:pb-8 w-full",
),
rx.box(newsletter_form(), class_name="pt-8 pb-10"),
rx.box(
rx.box(
footer_link_flex(
"Links",
[
footer_link("Home", "/"),
footer_link("Templates", gallery.path),
footer_link("Blog", blogs.path),
footer_link(
"Changelog", "https://github.com/reflex-dev/reflex/releases"
),
],
),
footer_link_flex(
"Documentation",
[
footer_link("Introduction", getting_started.introduction.path),
footer_link("Installation", getting_started.installation.path),
footer_link("Components", library.path),
footer_link("Hosting", hosting.deploy_quick_start.path),
],
),
footer_link_flex(
"Resources",
[
footer_link("FAQ", faq.path),
footer_link("Common Errors", errors.path),
footer_link("Roadmap", ROADMAP_URL),
footer_link("Forum", FORUM_URL),
footer_link("Use Case", "/use-cases"),
],
),
class_name="flex flex-wrap justify-between gap-12 w-full",
),
rx.box(
rx.box(
ph_1(),
rx.text(
f"Copyright © {datetime.now().year} Pynecone, Inc.",
class_name="font-small text-slate-9",
),
dark_mode_toggle(),
class_name="flex flex-col gap-6",
),
menu_socials(),
class_name="flex flex-row gap-6 justify-between items-end w-full",
),
class_name="flex flex-col justify-between gap-10 py-6 lg:py-8 w-full",
),
class_name="flex flex-col max-w-full lg:max-w-auto",
) |
=FeedbackState.set_score(0),
),
class_name="w-full lg:w-auto items-center flex flex-row",
),
rx.popover.content(
feedback_content(),
align="start",
class_name="border-none left-0 lg:left-[-255px] origin-bottom lg:origin-bottom-right !p-0 overflow-visible !bg-transparent shadow-none",
avoid_collisions=True,
),
)
def link_pill(text: str, href: str) -> rx.Component:
return rx.link(
text,
href=href,
underline="none",
class_name="lg:flex hidden flex-row justify-center items-center gap-2 lg:border-slate-5 bg-slate-3 lg:bg-slate-1 hover:bg-slate-3 shadow-none lg:shadow-large px-3 py-0.5 lg:border lg:border-solid border-none rounded-lg lg:rounded-full w-auto font-small font-small text-slate-9 !hover:text-slate-11 hover:!text-slate-9 truncate whitespace-nowrap transition-bg transition-color cursor-pointer",
)
@rx.memo
def docpage_footer(path: str):
|
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started, hosting
from pcweb.pages.docs.library import library
from pcweb.pages.errors import errors
from pcweb.pages.faq import faq
from pcweb.pages.framework.views.footer_index import dark_mode_toggle
from pcweb.pages.gallery import gallery
from pcweb.views.footer import menu_socials, newsletter_form, ph_1
return rx.el.footer(
rx.box(
rx.box(
rx.text(
"Did you find this useful?",
class_name="font-small text-slate-11 lg:text-slate-9 whitespace-nowrap",
),
feedback_button(),
class_name="flex lg:flex-row flex-col items-center gap-3 lg:gap-4 bg-slate-3 lg:bg-transparent p-4 lg:p-0 rounded-lg w-full",
),
rx.box(
link_pill(
"Raise an issue",
href=f"https://github.com/reflex-dev/refl | from pcweb.constants import FORUM_URL, ROADMAP_URL |
class_name="w-full lg:w-auto items-center flex flex-row",
),
rx.popover.content(
feedback_content(),
align="start",
class_name="border-none left-0 lg:left-[-255px] origin-bottom lg:origin-bottom-right !p-0 overflow-visible !bg-transparent shadow-none",
avoid_collisions=True,
),
)
def link_pill(text: str, href: str) -> rx.Component:
return rx.link(
text,
href=href,
underline="none",
class_name="lg:flex hidden flex-row justify-center items-center gap-2 lg:border-slate-5 bg-slate-3 lg:bg-slate-1 hover:bg-slate-3 shadow-none lg:shadow-large px-3 py-0.5 lg:border lg:border-solid border-none rounded-lg lg:rounded-full w-auto font-small font-small text-slate-9 !hover:text-slate-11 hover:!text-slate-9 truncate whitespace-nowrap transition-bg transition-color cursor-pointer",
)
@rx.memo
def docpage_footer(path: str):
from pcweb.constants import FORUM_URL, ROADMAP_URL
|
from pcweb.pages.docs import getting_started, hosting
from pcweb.pages.docs.library import library
from pcweb.pages.errors import errors
from pcweb.pages.faq import faq
from pcweb.pages.framework.views.footer_index import dark_mode_toggle
from pcweb.pages.gallery import gallery
from pcweb.views.footer import menu_socials, newsletter_form, ph_1
return rx.el.footer(
rx.box(
rx.box(
rx.text(
"Did you find this useful?",
class_name="font-small text-slate-11 lg:text-slate-9 whitespace-nowrap",
),
feedback_button(),
class_name="flex lg:flex-row flex-col items-center gap-3 lg:gap-4 bg-slate-3 lg:bg-transparent p-4 lg:p-0 rounded-lg w-full",
),
rx.box(
link_pill(
"Raise an issue",
href=f"https://github.com/reflex-dev/reflex-web/issues/new?title=Issue with refl | from pcweb.pages.blog import blogs |
ter flex flex-row",
),
rx.popover.content(
feedback_content(),
align="start",
class_name="border-none left-0 lg:left-[-255px] origin-bottom lg:origin-bottom-right !p-0 overflow-visible !bg-transparent shadow-none",
avoid_collisions=True,
),
)
def link_pill(text: str, href: str) -> rx.Component:
return rx.link(
text,
href=href,
underline="none",
class_name="lg:flex hidden flex-row justify-center items-center gap-2 lg:border-slate-5 bg-slate-3 lg:bg-slate-1 hover:bg-slate-3 shadow-none lg:shadow-large px-3 py-0.5 lg:border lg:border-solid border-none rounded-lg lg:rounded-full w-auto font-small font-small text-slate-9 !hover:text-slate-11 hover:!text-slate-9 truncate whitespace-nowrap transition-bg transition-color cursor-pointer",
)
@rx.memo
def docpage_footer(path: str):
from pcweb.constants import FORUM_URL, ROADMAP_URL
from pcweb.pages.blog import blogs
|
from pcweb.pages.docs.library import library
from pcweb.pages.errors import errors
from pcweb.pages.faq import faq
from pcweb.pages.framework.views.footer_index import dark_mode_toggle
from pcweb.pages.gallery import gallery
from pcweb.views.footer import menu_socials, newsletter_form, ph_1
return rx.el.footer(
rx.box(
rx.box(
rx.text(
"Did you find this useful?",
class_name="font-small text-slate-11 lg:text-slate-9 whitespace-nowrap",
),
feedback_button(),
class_name="flex lg:flex-row flex-col items-center gap-3 lg:gap-4 bg-slate-3 lg:bg-transparent p-4 lg:p-0 rounded-lg w-full",
),
rx.box(
link_pill(
"Raise an issue",
href=f"https://github.com/reflex-dev/reflex-web/issues/new?title=Issue with reflex.dev documentation&body=Path: {path}",
| from pcweb.pages.docs import getting_started, hosting |
feedback_content(),
align="start",
class_name="border-none left-0 lg:left-[-255px] origin-bottom lg:origin-bottom-right !p-0 overflow-visible !bg-transparent shadow-none",
avoid_collisions=True,
),
)
def link_pill(text: str, href: str) -> rx.Component:
return rx.link(
text,
href=href,
underline="none",
class_name="lg:flex hidden flex-row justify-center items-center gap-2 lg:border-slate-5 bg-slate-3 lg:bg-slate-1 hover:bg-slate-3 shadow-none lg:shadow-large px-3 py-0.5 lg:border lg:border-solid border-none rounded-lg lg:rounded-full w-auto font-small font-small text-slate-9 !hover:text-slate-11 hover:!text-slate-9 truncate whitespace-nowrap transition-bg transition-color cursor-pointer",
)
@rx.memo
def docpage_footer(path: str):
from pcweb.constants import FORUM_URL, ROADMAP_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started, hosting
|
from pcweb.pages.errors import errors
from pcweb.pages.faq import faq
from pcweb.pages.framework.views.footer_index import dark_mode_toggle
from pcweb.pages.gallery import gallery
from pcweb.views.footer import menu_socials, newsletter_form, ph_1
return rx.el.footer(
rx.box(
rx.box(
rx.text(
"Did you find this useful?",
class_name="font-small text-slate-11 lg:text-slate-9 whitespace-nowrap",
),
feedback_button(),
class_name="flex lg:flex-row flex-col items-center gap-3 lg:gap-4 bg-slate-3 lg:bg-transparent p-4 lg:p-0 rounded-lg w-full",
),
rx.box(
link_pill(
"Raise an issue",
href=f"https://github.com/reflex-dev/reflex-web/issues/new?title=Issue with reflex.dev documentation&body=Path: {path}",
),
link_pill(
| from pcweb.pages.docs.library import library |
n="start",
class_name="border-none left-0 lg:left-[-255px] origin-bottom lg:origin-bottom-right !p-0 overflow-visible !bg-transparent shadow-none",
avoid_collisions=True,
),
)
def link_pill(text: str, href: str) -> rx.Component:
return rx.link(
text,
href=href,
underline="none",
class_name="lg:flex hidden flex-row justify-center items-center gap-2 lg:border-slate-5 bg-slate-3 lg:bg-slate-1 hover:bg-slate-3 shadow-none lg:shadow-large px-3 py-0.5 lg:border lg:border-solid border-none rounded-lg lg:rounded-full w-auto font-small font-small text-slate-9 !hover:text-slate-11 hover:!text-slate-9 truncate whitespace-nowrap transition-bg transition-color cursor-pointer",
)
@rx.memo
def docpage_footer(path: str):
from pcweb.constants import FORUM_URL, ROADMAP_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started, hosting
from pcweb.pages.docs.library import library
|
from pcweb.pages.faq import faq
from pcweb.pages.framework.views.footer_index import dark_mode_toggle
from pcweb.pages.gallery import gallery
from pcweb.views.footer import menu_socials, newsletter_form, ph_1
return rx.el.footer(
rx.box(
rx.box(
rx.text(
"Did you find this useful?",
class_name="font-small text-slate-11 lg:text-slate-9 whitespace-nowrap",
),
feedback_button(),
class_name="flex lg:flex-row flex-col items-center gap-3 lg:gap-4 bg-slate-3 lg:bg-transparent p-4 lg:p-0 rounded-lg w-full",
),
rx.box(
link_pill(
"Raise an issue",
href=f"https://github.com/reflex-dev/reflex-web/issues/new?title=Issue with reflex.dev documentation&body=Path: {path}",
),
link_pill(
"Edit this page",
| from pcweb.pages.errors import errors |
none left-0 lg:left-[-255px] origin-bottom lg:origin-bottom-right !p-0 overflow-visible !bg-transparent shadow-none",
avoid_collisions=True,
),
)
def link_pill(text: str, href: str) -> rx.Component:
return rx.link(
text,
href=href,
underline="none",
class_name="lg:flex hidden flex-row justify-center items-center gap-2 lg:border-slate-5 bg-slate-3 lg:bg-slate-1 hover:bg-slate-3 shadow-none lg:shadow-large px-3 py-0.5 lg:border lg:border-solid border-none rounded-lg lg:rounded-full w-auto font-small font-small text-slate-9 !hover:text-slate-11 hover:!text-slate-9 truncate whitespace-nowrap transition-bg transition-color cursor-pointer",
)
@rx.memo
def docpage_footer(path: str):
from pcweb.constants import FORUM_URL, ROADMAP_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started, hosting
from pcweb.pages.docs.library import library
from pcweb.pages.errors import errors
|
from pcweb.pages.framework.views.footer_index import dark_mode_toggle
from pcweb.pages.gallery import gallery
from pcweb.views.footer import menu_socials, newsletter_form, ph_1
return rx.el.footer(
rx.box(
rx.box(
rx.text(
"Did you find this useful?",
class_name="font-small text-slate-11 lg:text-slate-9 whitespace-nowrap",
),
feedback_button(),
class_name="flex lg:flex-row flex-col items-center gap-3 lg:gap-4 bg-slate-3 lg:bg-transparent p-4 lg:p-0 rounded-lg w-full",
),
rx.box(
link_pill(
"Raise an issue",
href=f"https://github.com/reflex-dev/reflex-web/issues/new?title=Issue with reflex.dev documentation&body=Path: {path}",
),
link_pill(
"Edit this page",
f"https://github.com/reflex-dev/refl | from pcweb.pages.faq import faq |
bottom lg:origin-bottom-right !p-0 overflow-visible !bg-transparent shadow-none",
avoid_collisions=True,
),
)
def link_pill(text: str, href: str) -> rx.Component:
return rx.link(
text,
href=href,
underline="none",
class_name="lg:flex hidden flex-row justify-center items-center gap-2 lg:border-slate-5 bg-slate-3 lg:bg-slate-1 hover:bg-slate-3 shadow-none lg:shadow-large px-3 py-0.5 lg:border lg:border-solid border-none rounded-lg lg:rounded-full w-auto font-small font-small text-slate-9 !hover:text-slate-11 hover:!text-slate-9 truncate whitespace-nowrap transition-bg transition-color cursor-pointer",
)
@rx.memo
def docpage_footer(path: str):
from pcweb.constants import FORUM_URL, ROADMAP_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started, hosting
from pcweb.pages.docs.library import library
from pcweb.pages.errors import errors
from pcweb.pages.faq import faq
|
from pcweb.pages.gallery import gallery
from pcweb.views.footer import menu_socials, newsletter_form, ph_1
return rx.el.footer(
rx.box(
rx.box(
rx.text(
"Did you find this useful?",
class_name="font-small text-slate-11 lg:text-slate-9 whitespace-nowrap",
),
feedback_button(),
class_name="flex lg:flex-row flex-col items-center gap-3 lg:gap-4 bg-slate-3 lg:bg-transparent p-4 lg:p-0 rounded-lg w-full",
),
rx.box(
link_pill(
"Raise an issue",
href=f"https://github.com/reflex-dev/reflex-web/issues/new?title=Issue with reflex.dev documentation&body=Path: {path}",
),
link_pill(
"Edit this page",
f"https://github.com/reflex-dev/reflex-web/tree/main{path}.md",
),
class_name= | from pcweb.pages.framework.views.footer_index import dark_mode_toggle |
-none",
avoid_collisions=True,
),
)
def link_pill(text: str, href: str) -> rx.Component:
return rx.link(
text,
href=href,
underline="none",
class_name="lg:flex hidden flex-row justify-center items-center gap-2 lg:border-slate-5 bg-slate-3 lg:bg-slate-1 hover:bg-slate-3 shadow-none lg:shadow-large px-3 py-0.5 lg:border lg:border-solid border-none rounded-lg lg:rounded-full w-auto font-small font-small text-slate-9 !hover:text-slate-11 hover:!text-slate-9 truncate whitespace-nowrap transition-bg transition-color cursor-pointer",
)
@rx.memo
def docpage_footer(path: str):
from pcweb.constants import FORUM_URL, ROADMAP_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started, hosting
from pcweb.pages.docs.library import library
from pcweb.pages.errors import errors
from pcweb.pages.faq import faq
from pcweb.pages.framework.views.footer_index import dark_mode_toggle
|
from pcweb.views.footer import menu_socials, newsletter_form, ph_1
return rx.el.footer(
rx.box(
rx.box(
rx.text(
"Did you find this useful?",
class_name="font-small text-slate-11 lg:text-slate-9 whitespace-nowrap",
),
feedback_button(),
class_name="flex lg:flex-row flex-col items-center gap-3 lg:gap-4 bg-slate-3 lg:bg-transparent p-4 lg:p-0 rounded-lg w-full",
),
rx.box(
link_pill(
"Raise an issue",
href=f"https://github.com/reflex-dev/reflex-web/issues/new?title=Issue with reflex.dev documentation&body=Path: {path}",
),
link_pill(
"Edit this page",
f"https://github.com/reflex-dev/reflex-web/tree/main{path}.md",
),
class_name="lg:flex hidden flex-row items-center gap-2 | from pcweb.pages.gallery import gallery |
),
)
def link_pill(text: str, href: str) -> rx.Component:
return rx.link(
text,
href=href,
underline="none",
class_name="lg:flex hidden flex-row justify-center items-center gap-2 lg:border-slate-5 bg-slate-3 lg:bg-slate-1 hover:bg-slate-3 shadow-none lg:shadow-large px-3 py-0.5 lg:border lg:border-solid border-none rounded-lg lg:rounded-full w-auto font-small font-small text-slate-9 !hover:text-slate-11 hover:!text-slate-9 truncate whitespace-nowrap transition-bg transition-color cursor-pointer",
)
@rx.memo
def docpage_footer(path: str):
from pcweb.constants import FORUM_URL, ROADMAP_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started, hosting
from pcweb.pages.docs.library import library
from pcweb.pages.errors import errors
from pcweb.pages.faq import faq
from pcweb.pages.framework.views.footer_index import dark_mode_toggle
from pcweb.pages.gallery import gallery
|
return rx.el.footer(
rx.box(
rx.box(
rx.text(
"Did you find this useful?",
class_name="font-small text-slate-11 lg:text-slate-9 whitespace-nowrap",
),
feedback_button(),
class_name="flex lg:flex-row flex-col items-center gap-3 lg:gap-4 bg-slate-3 lg:bg-transparent p-4 lg:p-0 rounded-lg w-full",
),
rx.box(
link_pill(
"Raise an issue",
href=f"https://github.com/reflex-dev/reflex-web/issues/new?title=Issue with reflex.dev documentation&body=Path: {path}",
),
link_pill(
"Edit this page",
f"https://github.com/reflex-dev/reflex-web/tree/main{path}.md",
),
class_name="lg:flex hidden flex-row items-center gap-2 w-auto",
),
class_name="flex flex-row justify-c | from pcweb.views.footer import menu_socials, newsletter_form, ph_1 |
s", errors.path),
footer_link("Roadmap", ROADMAP_URL),
footer_link("Forum", FORUM_URL),
footer_link("Use Case", "/use-cases"),
],
),
class_name="flex flex-wrap justify-between gap-12 w-full",
),
rx.box(
rx.box(
ph_1(),
rx.text(
f"Copyright © {datetime.now().year} Pynecone, Inc.",
class_name="font-small text-slate-9",
),
dark_mode_toggle(),
class_name="flex flex-col gap-6",
),
menu_socials(),
class_name="flex flex-row gap-6 justify-between items-end w-full",
),
class_name="flex flex-col justify-between gap-10 py-6 lg:py-8 w-full",
),
class_name="flex flex-col max-w-full lg:max-w-auto",
)
|
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.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.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 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 speci | def breadcrumb(path: str, nav_sidebar: rx.Component):
from pcweb.components.docpage.navbar.buttons.sidebar import docs_sidebar_drawer
# Split the path into segments, removing 'docs' and capitalizing each segment
segments = [
segment.capitalize()
for segment in path.split("/")
if segment and segment != "docs"
]
# Initialize an empty list to store the breadcrumbs and their separators
breadcrumbs = []
# Iteratively build the href for each segment
current_path = "/docs"
for i, segment in enumerate(segments):
current_path += f"/{segment.lower()}"
# Add the breadcrumb item to the list
breadcrumbs.append(
rx.link(
to_title_case(to_snake_case(segment), sep=" "),
class_name="font-small text-slate-9 hover:!text-slate-11 transition-color"
+ (" truncate" if i == len(segments) - 1 else ""),
underline="none",
href=current_path,
)
)
# If it's not the last segment, add a separator
if i < len(segments) - 1:
breadcrumbs.append(
rx.icon(
tag="chevron-right",
size=14,
class_name="lg:flex hidden !text-slate-8",
),
)
breadcrumbs.append(
rx.text(
"/",
class_name="font-sm text-slate-8 lg:hidden flex",
)
)
from pcweb.components.hosting_banner import HostingBannerState
# Return the list of breadcrumb items with separators
return rx.box(
docs_sidebar_drawer(
nav_sidebar,
trigger=rx.box(
class_name="absolute inset-0 bg-transparent z-[1] lg:hidden flex",
),
),
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="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]",
" lg:mt-[119px]",
),
) |
dmap", ROADMAP_URL),
footer_link("Forum", FORUM_URL),
footer_link("Use Case", "/use-cases"),
],
),
class_name="flex flex-wrap justify-between gap-12 w-full",
),
rx.box(
rx.box(
ph_1(),
rx.text(
f"Copyright © {datetime.now().year} Pynecone, Inc.",
class_name="font-small text-slate-9",
),
dark_mode_toggle(),
class_name="flex flex-col gap-6",
),
menu_socials(),
class_name="flex flex-row gap-6 justify-between items-end w-full",
),
class_name="flex flex-col justify-between gap-10 py-6 lg:py-8 w-full",
),
class_name="flex flex-col max-w-full lg:max-w-auto",
)
def breadcrumb(path: str, nav_sidebar: rx.Component):
|
# Split the path into segments, removing 'docs' and capitalizing each segment
segments = [
segment.capitalize()
for segment in path.split("/")
if segment and segment != "docs"
]
# Initialize an empty list to store the breadcrumbs and their separators
breadcrumbs = []
# Iteratively build the href for each segment
current_path = "/docs"
for i, segment in enumerate(segments):
current_path += f"/{segment.lower()}"
# Add the breadcrumb item to the list
breadcrumbs.append(
rx.link(
to_title_case(to_snake_case(segment), sep=" "),
class_name="font-small text-slate-9 hover:!text-slate-11 transition-color"
+ (" truncate" if i == len(segments) - 1 else ""),
underline="none",
href=current_path,
)
)
# If it's not the last segment, add a separator
if i < len(segments) - 1:
brea | from pcweb.components.docpage.navbar.buttons.sidebar import docs_sidebar_drawer |
),
class_name="flex flex-wrap justify-between gap-12 w-full",
),
rx.box(
rx.box(
ph_1(),
rx.text(
f"Copyright © {datetime.now().year} Pynecone, Inc.",
class_name="font-small text-slate-9",
),
dark_mode_toggle(),
class_name="flex flex-col gap-6",
),
menu_socials(),
class_name="flex flex-row gap-6 justify-between items-end w-full",
),
class_name="flex flex-col justify-between gap-10 py-6 lg:py-8 w-full",
),
class_name="flex flex-col max-w-full lg:max-w-auto",
)
def breadcrumb(path: str, nav_sidebar: rx.Component):
from pcweb.components.docpage.navbar.buttons.sidebar import docs_sidebar_drawer
# Split the path into segments, removing 'docs' and capitalizing each segment
|
# Initialize an empty list to store the breadcrumbs and their separators
breadcrumbs = []
# Iteratively build the href for each segment
current_path = "/docs"
for i, segment in enumerate(segments):
current_path += f"/{segment.lower()}"
# Add the breadcrumb item to the list
breadcrumbs.append(
rx.link(
to_title_case(to_snake_case(segment), sep=" "),
class_name="font-small text-slate-9 hover:!text-slate-11 transition-color"
+ (" truncate" if i == len(segments) - 1 else ""),
underline="none",
href=current_path,
)
)
# If it's not the last segment, add a separator
if i < len(segments) - 1:
breadcrumbs.append(
rx.icon(
tag="chevron-right",
size=14,
class_name="lg:flex hidden !text-slate-8",
),
)
| segments = [
segment.capitalize()
for segment in path.split("/")
if segment and segment != "docs"
] |
f"Copyright © {datetime.now().year} Pynecone, Inc.",
class_name="font-small text-slate-9",
),
dark_mode_toggle(),
class_name="flex flex-col gap-6",
),
menu_socials(),
class_name="flex flex-row gap-6 justify-between items-end w-full",
),
class_name="flex flex-col justify-between gap-10 py-6 lg:py-8 w-full",
),
class_name="flex flex-col max-w-full lg:max-w-auto",
)
def breadcrumb(path: str, nav_sidebar: rx.Component):
from pcweb.components.docpage.navbar.buttons.sidebar import docs_sidebar_drawer
# Split the path into segments, removing 'docs' and capitalizing each segment
segments = [
segment.capitalize()
for segment in path.split("/")
if segment and segment != "docs"
]
# Initialize an empty list to store the breadcrumbs and their separators
|
# Iteratively build the href for each segment
current_path = "/docs"
for i, segment in enumerate(segments):
current_path += f"/{segment.lower()}"
# Add the breadcrumb item to the list
breadcrumbs.append(
rx.link(
to_title_case(to_snake_case(segment), sep=" "),
class_name="font-small text-slate-9 hover:!text-slate-11 transition-color"
+ (" truncate" if i == len(segments) - 1 else ""),
underline="none",
href=current_path,
)
)
# If it's not the last segment, add a separator
if i < len(segments) - 1:
breadcrumbs.append(
rx.icon(
tag="chevron-right",
size=14,
class_name="lg:flex hidden !text-slate-8",
),
)
breadcrumbs.append(
rx.text(
"/",
class | breadcrumbs = [] |
,
class_name="font-small text-slate-9",
),
dark_mode_toggle(),
class_name="flex flex-col gap-6",
),
menu_socials(),
class_name="flex flex-row gap-6 justify-between items-end w-full",
),
class_name="flex flex-col justify-between gap-10 py-6 lg:py-8 w-full",
),
class_name="flex flex-col max-w-full lg:max-w-auto",
)
def breadcrumb(path: str, nav_sidebar: rx.Component):
from pcweb.components.docpage.navbar.buttons.sidebar import docs_sidebar_drawer
# Split the path into segments, removing 'docs' and capitalizing each segment
segments = [
segment.capitalize()
for segment in path.split("/")
if segment and segment != "docs"
]
# Initialize an empty list to store the breadcrumbs and their separators
breadcrumbs = []
# Iteratively build the href for each segment
|
for i, segment in enumerate(segments):
current_path += f"/{segment.lower()}"
# Add the breadcrumb item to the list
breadcrumbs.append(
rx.link(
to_title_case(to_snake_case(segment), sep=" "),
class_name="font-small text-slate-9 hover:!text-slate-11 transition-color"
+ (" truncate" if i == len(segments) - 1 else ""),
underline="none",
href=current_path,
)
)
# If it's not the last segment, add a separator
if i < len(segments) - 1:
breadcrumbs.append(
rx.icon(
tag="chevron-right",
size=14,
class_name="lg:flex hidden !text-slate-8",
),
)
breadcrumbs.append(
rx.text(
"/",
class_name="font-sm text-slate-8 lg:hidden flex",
)
)
| current_path = "/docs" |
lass_name="font-small text-slate-9",
),
dark_mode_toggle(),
class_name="flex flex-col gap-6",
),
menu_socials(),
class_name="flex flex-row gap-6 justify-between items-end w-full",
),
class_name="flex flex-col justify-between gap-10 py-6 lg:py-8 w-full",
),
class_name="flex flex-col max-w-full lg:max-w-auto",
)
def breadcrumb(path: str, nav_sidebar: rx.Component):
from pcweb.components.docpage.navbar.buttons.sidebar import docs_sidebar_drawer
# Split the path into segments, removing 'docs' and capitalizing each segment
segments = [
segment.capitalize()
for segment in path.split("/")
if segment and segment != "docs"
]
# Initialize an empty list to store the breadcrumbs and their separators
breadcrumbs = []
# Iteratively build the href for each segment
current_path = "/docs"
|
from pcweb.components.hosting_banner import HostingBannerState
# Return the list of breadcrumb items with separators
return rx.box(
docs_sidebar_drawer(
nav_sidebar,
trigger=rx.box(
class_name="absolute inset-0 bg-transparent z-[1] lg:hidden flex",
),
),
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="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]",
" lg:mt-[119px]",
),
)
def get_headings( | for i, segment in enumerate(segments):
current_path += f"/{segment.lower()}"
# Add the breadcrumb item to the list
breadcrumbs.append(
rx.link(
to_title_case(to_snake_case(segment), sep=" "),
class_name="font-small text-slate-9 hover:!text-slate-11 transition-color"
+ (" truncate" if i == len(segments) - 1 else ""),
underline="none",
href=current_path,
)
)
# If it's not the last segment, add a separator
if i < len(segments) - 1:
breadcrumbs.append(
rx.icon(
tag="chevron-right",
size=14,
class_name="lg:flex hidden !text-slate-8",
),
)
breadcrumbs.append(
rx.text(
"/",
class_name="font-sm text-slate-8 lg:hidden flex",
)
) |
buttons.sidebar import docs_sidebar_drawer
# Split the path into segments, removing 'docs' and capitalizing each segment
segments = [
segment.capitalize()
for segment in path.split("/")
if segment and segment != "docs"
]
# Initialize an empty list to store the breadcrumbs and their separators
breadcrumbs = []
# Iteratively build the href for each segment
current_path = "/docs"
for i, segment in enumerate(segments):
current_path += f"/{segment.lower()}"
# Add the breadcrumb item to the list
breadcrumbs.append(
rx.link(
to_title_case(to_snake_case(segment), sep=" "),
class_name="font-small text-slate-9 hover:!text-slate-11 transition-color"
+ (" truncate" if i == len(segments) - 1 else ""),
underline="none",
href=current_path,
)
)
# If it's not the last segment, add a separator
|
from pcweb.components.hosting_banner import HostingBannerState
# Return the list of breadcrumb items with separators
return rx.box(
docs_sidebar_drawer(
nav_sidebar,
trigger=rx.box(
class_name="absolute inset-0 bg-transparent z-[1] lg:hidden flex",
),
),
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="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]",
" lg:mt-[119px]",
),
)
def get_headings( | if i < len(segments) - 1:
breadcrumbs.append(
rx.icon(
tag="chevron-right",
size=14,
class_name="lg:flex hidden !text-slate-8",
),
)
breadcrumbs.append(
rx.text(
"/",
class_name="font-sm text-slate-8 lg:hidden flex",
)
) |
for i, segment in enumerate(segments):
current_path += f"/{segment.lower()}"
# Add the breadcrumb item to the list
breadcrumbs.append(
rx.link(
to_title_case(to_snake_case(segment), sep=" "),
class_name="font-small text-slate-9 hover:!text-slate-11 transition-color"
+ (" truncate" if i == len(segments) - 1 else ""),
underline="none",
href=current_path,
)
)
# If it's not the last segment, add a separator
if i < len(segments) - 1:
breadcrumbs.append(
rx.icon(
tag="chevron-right",
size=14,
class_name="lg:flex hidden !text-slate-8",
),
)
breadcrumbs.append(
rx.text(
"/",
class_name="font-sm text-slate-8 lg:hidden flex",
)
)
|
# Return the list of breadcrumb items with separators
return rx.box(
docs_sidebar_drawer(
nav_sidebar,
trigger=rx.box(
class_name="absolute inset-0 bg-transparent z-[1] lg:hidden flex",
),
),
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="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]",
" lg:mt-[119px]",
),
)
def get_headings(comp):
"""Get the strings from markdown component."""
if is | from pcweb.components.hosting_banner import HostingBannerState |
)
)
from pcweb.components.hosting_banner import HostingBannerState
# Return the list of breadcrumb items with separators
return rx.box(
docs_sidebar_drawer(
nav_sidebar,
trigger=rx.box(
class_name="absolute inset-0 bg-transparent z-[1] lg:hidden flex",
),
),
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="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]",
" lg:mt-[119px]",
),
)
|
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 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 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.append(content)
content = "\n".join(content_pieces)
| 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.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.extend(get_headings(child))
return headings |
State
# Return the list of breadcrumb items with separators
return rx.box(
docs_sidebar_drawer(
nav_sidebar,
trigger=rx.box(
class_name="absolute inset-0 bg-transparent z-[1] lg:hidden flex",
),
),
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="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]",
" lg:mt-[119px]",
),
)
def get_headings(comp):
"""Get the strings from markdown component."""
|
# 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.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 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 block types (like DemoBlock)
blocks = xd.get_blocks(source, href)
content_pieces = []
for block in blocks:
if (
not isinstance(block, flexdown.blocks.MarkdownBlock)
or len(block.lines) == 0
| if isinstance(comp, mistletoe.block_token.Heading):
heading_text = "".join(
token.content for token in comp.children if hasattr(token, "content")
)
return [(comp.level, heading_text)] |
tors
return rx.box(
docs_sidebar_drawer(
nav_sidebar,
trigger=rx.box(
class_name="absolute inset-0 bg-transparent z-[1] lg:hidden flex",
),
),
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="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]",
" lg:mt-[119px]",
),
)
def get_headings(comp):
"""Get the strings from markdown component."""
if isinstance(comp, mistletoe.block_token.Heading):
|
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.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 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 block types (like DemoBlock)
blocks = xd.get_blocks(source, href)
content_pieces = []
for block in blocks:
if (
not isinstance(block, flexdown.blocks.MarkdownBlock)
| heading_text = "".join(
token.content for token in comp.children if hasattr(token, "content")
) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.