instruction stringlengths 0 1k | input stringlengths 1 1k | output stringlengths 10 6.51k |
|---|---|---|
import reflex as rx
from reflex.style import toggle_color_mode
from pcweb.components.icons.icons import get_icon
from pcweb.constants import DISCORD_URL, GITHUB_URL, TWITTER_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started
from pcweb.pages.docs.library import library
|
from pcweb.pages.gallery import gallery
from pcweb.pages.hosting.hosting import hosting_landing
def social_menu_item(
icon: str,
url="/",
border: bool = False,
) -> rx.Component:
return rx.link(
get_icon(icon=icon, class_name="!text-slate-9"),
class_name="flex justify-center items-cen... | from pcweb.pages.framework.framework import framework |
import reflex as rx
from reflex.style import toggle_color_mode
from pcweb.components.icons.icons import get_icon
from pcweb.constants import DISCORD_URL, GITHUB_URL, TWITTER_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started
from pcweb.pages.docs.library import library
from pcweb.pages... |
from pcweb.pages.hosting.hosting import hosting_landing
def social_menu_item(
icon: str,
url="/",
border: bool = False,
) -> rx.Component:
return rx.link(
get_icon(icon=icon, class_name="!text-slate-9"),
class_name="flex justify-center items-center gap-2 hover:bg-slate-3 px-4 py-[0.87... | from pcweb.pages.gallery import gallery |
import reflex as rx
from reflex.style import toggle_color_mode
from pcweb.components.icons.icons import get_icon
from pcweb.constants import DISCORD_URL, GITHUB_URL, TWITTER_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started
from pcweb.pages.docs.library import library
from pcweb.pages... |
def social_menu_item(
icon: str,
url="/",
border: bool = False,
) -> rx.Component:
return rx.link(
get_icon(icon=icon, class_name="!text-slate-9"),
class_name="flex justify-center items-center gap-2 hover:bg-slate-3 px-4 py-[0.875rem] w-full h-[47px] transition-bg overflow-hidden"
... | from pcweb.pages.hosting.hosting import hosting_landing |
import reflex as rx
from reflex.style import toggle_color_mode
from pcweb.components.icons.icons import get_icon
from pcweb.constants import DISCORD_URL, GITHUB_URL, TWITTER_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started
from pcweb.pages.docs.library import library
from pcweb.pages... |
def drawer_socials() -> rx.Component:
return rx.box(
social_menu_item("github", GITHUB_URL),
social_menu_item(
"twitter",
TWITTER_URL,
border=True,
),
social_menu_item("discord", DISCORD_URL),
class_name="flex flex-row items-center borde... | def social_menu_item(
icon: str,
url="/",
border: bool = False,
) -> rx.Component:
return rx.link(
get_icon(icon=icon, class_name="!text-slate-9"),
class_name="flex justify-center items-center gap-2 hover:bg-slate-3 px-4 py-[0.875rem] w-full h-[47px] transition-bg overflow-hidden"
... |
import reflex as rx
from reflex.style import toggle_color_mode
from pcweb.components.icons.icons import get_icon
from pcweb.constants import DISCORD_URL, GITHUB_URL, TWITTER_URL
from pcweb.pages.blog import blogs
from pcweb.pages.docs import getting_started
from pcweb.pages.docs.library import library
from pcweb.pages... |
def drawer_item(text: str, url: str, active_str: str = "") -> rx.Component:
router_path = rx.State.router.page.path
if not url.endswith("/"):
url += "/"
active = router_path.contains(active_str)
if active_str == "docs":
active = rx.cond(
router_path.contains("hosting")
... | def drawer_socials() -> rx.Component:
return rx.box(
social_menu_item("github", GITHUB_URL),
social_menu_item(
"twitter",
TWITTER_URL,
border=True,
),
social_menu_item("discord", DISCORD_URL),
class_name="flex flex-row items-center border-s... |
ramework
from pcweb.pages.gallery import gallery
from pcweb.pages.hosting.hosting import hosting_landing
def social_menu_item(
icon: str,
url="/",
border: bool = False,
) -> rx.Component:
return rx.link(
get_icon(icon=icon, class_name="!text-slate-9"),
class_name="flex justify-center i... |
if not url.endswith("/"):
url += "/"
active = router_path.contains(active_str)
if active_str == "docs":
active = rx.cond(
router_path.contains("hosting")
| router_path.contains("library")
| router_path.contains("gallery"),
False,
a... | router_path = rx.State.router.page.path |
lery
from pcweb.pages.hosting.hosting import hosting_landing
def social_menu_item(
icon: str,
url="/",
border: bool = False,
) -> rx.Component:
return rx.link(
get_icon(icon=icon, class_name="!text-slate-9"),
class_name="flex justify-center items-center gap-2 hover:bg-slate-3 px-4 py-[... |
active = router_path.contains(active_str)
if active_str == "docs":
active = rx.cond(
router_path.contains("hosting")
| router_path.contains("library")
| router_path.contains("gallery"),
False,
active,
)
if active_str == "":
... | if not url.endswith("/"):
url += "/" |
ing_landing
def social_menu_item(
icon: str,
url="/",
border: bool = False,
) -> rx.Component:
return rx.link(
get_icon(icon=icon, class_name="!text-slate-9"),
class_name="flex justify-center items-center gap-2 hover:bg-slate-3 px-4 py-[0.875rem] w-full h-[47px] transition-bg overflow-... |
if active_str == "docs":
active = rx.cond(
router_path.contains("hosting")
| router_path.contains("library")
| router_path.contains("gallery"),
False,
active,
)
if active_str == "":
active = False
return rx.link(
te... | active = router_path.contains(active_str) |
str,
url="/",
border: bool = False,
) -> rx.Component:
return rx.link(
get_icon(icon=icon, class_name="!text-slate-9"),
class_name="flex justify-center items-center gap-2 hover:bg-slate-3 px-4 py-[0.875rem] w-full h-[47px] transition-bg overflow-hidden"
+ (" border-slate-4 border-x b... |
if active_str == "":
active = False
return rx.link(
text,
href=url,
underline="none",
color=rx.cond(active, "var(--c-violet-9)", "var(--c-slate-9)"),
class_name="flex justify-center items-center border-slate-4 px-4 py-[0.875rem] border-t-0 border-b border-solid w... | if active_str == "docs":
active = rx.cond(
router_path.contains("hosting")
| router_path.contains("library")
| router_path.contains("gallery"),
False,
active,
) |
l = False,
) -> rx.Component:
return rx.link(
get_icon(icon=icon, class_name="!text-slate-9"),
class_name="flex justify-center items-center gap-2 hover:bg-slate-3 px-4 py-[0.875rem] w-full h-[47px] transition-bg overflow-hidden"
+ (" border-slate-4 border-x border-solid border-y-0" if border... |
if active_str == "":
active = False
return rx.link(
text,
href=url,
underline="none",
color=rx.cond(active, "var(--c-violet-9)", "var(--c-slate-9)"),
class_name="flex justify-center items-center border-slate-4 px-4 py-[0.875rem] border-t-0 border-b border-solid w... | active = rx.cond(
router_path.contains("hosting")
| router_path.contains("library")
| router_path.contains("gallery"),
False,
active,
) |
h-[47px] transition-bg overflow-hidden"
+ (" border-slate-4 border-x border-solid border-y-0" if border else ""),
href=url,
is_external=True,
)
def drawer_socials() -> rx.Component:
return rx.box(
social_menu_item("github", GITHUB_URL),
social_menu_item(
"t... |
return rx.link(
text,
href=url,
underline="none",
color=rx.cond(active, "var(--c-violet-9)", "var(--c-slate-9)"),
class_name="flex justify-center items-center border-slate-4 px-4 py-[0.875rem] border-t-0 border-b border-solid w-full font-small hover:!text-violet-9 border-x-0... | if active_str == "":
active = False |
low-hidden"
+ (" border-slate-4 border-x border-solid border-y-0" if border else ""),
href=url,
is_external=True,
)
def drawer_socials() -> rx.Component:
return rx.box(
social_menu_item("github", GITHUB_URL),
social_menu_item(
"twitter",
TWITTER_... |
return rx.link(
text,
href=url,
underline="none",
color=rx.cond(active, "var(--c-violet-9)", "var(--c-slate-9)"),
class_name="flex justify-center items-center border-slate-4 px-4 py-[0.875rem] border-t-0 border-b border-solid w-full font-small hover:!text-violet-9 border-x-0... | active = False |
"""Logic for the sidebar component."""
|
import reflex as rx
from pcweb.components.docpage.navbar.state import NavbarState
from pcweb.styles.colors import c_color
from .sidebar_items.ai import (
ai_builder_integrations,
ai_builder_overview_items,
mcp_items,
)
from .sidebar_items.component_lib import component_lib, graphing_libs
from .sidebar_i... | from __future__ import annotations |
"""Logic for the sidebar component."""
from __future__ import annotations
|
from pcweb.components.docpage.navbar.state import NavbarState
from pcweb.styles.colors import c_color
from .sidebar_items.ai import (
ai_builder_integrations,
ai_builder_overview_items,
mcp_items,
)
from .sidebar_items.component_lib import component_lib, graphing_libs
from .sidebar_items.enterprise impor... | import reflex as rx |
"""Logic for the sidebar component."""
from __future__ import annotations
import reflex as rx
|
from pcweb.styles.colors import c_color
from .sidebar_items.ai import (
ai_builder_integrations,
ai_builder_overview_items,
mcp_items,
)
from .sidebar_items.component_lib import component_lib, graphing_libs
from .sidebar_items.enterprise import (
enterprise_component_items,
enterprise_items,
e... | from pcweb.components.docpage.navbar.state import NavbarState |
"""Logic for the sidebar component."""
from __future__ import annotations
import reflex as rx
from pcweb.components.docpage.navbar.state import NavbarState
|
from .sidebar_items.ai import (
ai_builder_integrations,
ai_builder_overview_items,
mcp_items,
)
from .sidebar_items.component_lib import component_lib, graphing_libs
from .sidebar_items.enterprise import (
enterprise_component_items,
enterprise_items,
enterprise_usage_items,
)
from .sidebar_i... | from pcweb.styles.colors import c_color |
"""Logic for the sidebar component."""
from __future__ import annotations
import reflex as rx
from pcweb.components.docpage.navbar.state import NavbarState
from pcweb.styles.colors import c_color
|
from .sidebar_items.component_lib import component_lib, graphing_libs
from .sidebar_items.enterprise import (
enterprise_component_items,
enterprise_items,
enterprise_usage_items,
)
from .sidebar_items.learn import backend, cli_ref, frontend, hosting, learn
from .sidebar_items.recipes import recipes
from .... | from .sidebar_items.ai import (
ai_builder_integrations,
ai_builder_overview_items,
mcp_items,
) |
"""Logic for the sidebar component."""
from __future__ import annotations
import reflex as rx
from pcweb.components.docpage.navbar.state import NavbarState
from pcweb.styles.colors import c_color
from .sidebar_items.ai import (
ai_builder_integrations,
ai_builder_overview_items,
mcp_items,
)
|
from .sidebar_items.enterprise import (
enterprise_component_items,
enterprise_items,
enterprise_usage_items,
)
from .sidebar_items.learn import backend, cli_ref, frontend, hosting, learn
from .sidebar_items.recipes import recipes
from .sidebar_items.reference import api_reference
from .state import SideBa... | from .sidebar_items.component_lib import component_lib, graphing_libs |
"""Logic for the sidebar component."""
from __future__ import annotations
import reflex as rx
from pcweb.components.docpage.navbar.state import NavbarState
from pcweb.styles.colors import c_color
from .sidebar_items.ai import (
ai_builder_integrations,
ai_builder_overview_items,
mcp_items,
)
from .sideb... |
from .sidebar_items.learn import backend, cli_ref, frontend, hosting, learn
from .sidebar_items.recipes import recipes
from .sidebar_items.reference import api_reference
from .state import SideBarBase, SideBarItem, SidebarState
Scrollable_SideBar = """
function scrollToActiveSidebarLink() {
const currentPath = wind... | from .sidebar_items.enterprise import (
enterprise_component_items,
enterprise_items,
enterprise_usage_items,
) |
"""Logic for the sidebar component."""
from __future__ import annotations
import reflex as rx
from pcweb.components.docpage.navbar.state import NavbarState
from pcweb.styles.colors import c_color
from .sidebar_items.ai import (
ai_builder_integrations,
ai_builder_overview_items,
mcp_items,
)
from .sideb... |
from .sidebar_items.recipes import recipes
from .sidebar_items.reference import api_reference
from .state import SideBarBase, SideBarItem, SidebarState
Scrollable_SideBar = """
function scrollToActiveSidebarLink() {
const currentPath = window.location.pathname.replace(/\\/+$|\\/$/g, "") + "/";
const activeLink =... | from .sidebar_items.learn import backend, cli_ref, frontend, hosting, learn |
"""Logic for the sidebar component."""
from __future__ import annotations
import reflex as rx
from pcweb.components.docpage.navbar.state import NavbarState
from pcweb.styles.colors import c_color
from .sidebar_items.ai import (
ai_builder_integrations,
ai_builder_overview_items,
mcp_items,
)
from .sideb... |
from .sidebar_items.reference import api_reference
from .state import SideBarBase, SideBarItem, SidebarState
Scrollable_SideBar = """
function scrollToActiveSidebarLink() {
const currentPath = window.location.pathname.replace(/\\/+$|\\/$/g, "") + "/";
const activeLink = document.querySelector(`#sidebar-container... | from .sidebar_items.recipes import recipes |
"""Logic for the sidebar component."""
from __future__ import annotations
import reflex as rx
from pcweb.components.docpage.navbar.state import NavbarState
from pcweb.styles.colors import c_color
from .sidebar_items.ai import (
ai_builder_integrations,
ai_builder_overview_items,
mcp_items,
)
from .sideb... |
from .state import SideBarBase, SideBarItem, SidebarState
Scrollable_SideBar = """
function scrollToActiveSidebarLink() {
const currentPath = window.location.pathname.replace(/\\/+$|\\/$/g, "") + "/";
const activeLink = document.querySelector(`#sidebar-container a[href="${currentPath}"]`) ||
... | from .sidebar_items.reference import api_reference |
"""Logic for the sidebar component."""
from __future__ import annotations
import reflex as rx
from pcweb.components.docpage.navbar.state import NavbarState
from pcweb.styles.colors import c_color
from .sidebar_items.ai import (
ai_builder_integrations,
ai_builder_overview_items,
mcp_items,
)
from .sideb... |
Scrollable_SideBar = """
function scrollToActiveSidebarLink() {
const currentPath = window.location.pathname.replace(/\\/+$|\\/$/g, "") + "/";
const activeLink = document.querySelector(`#sidebar-container a[href="${currentPath}"]`) ||
document.querySelector(`#sidebar-container a[href="${curre... | from .state import SideBarBase, SideBarItem, SidebarState |
"""Logic for the sidebar component."""
from __future__ import annotations
import reflex as rx
from pcweb.components.docpage.navbar.state import NavbarState
from pcweb.styles.colors import c_color
from .sidebar_items.ai import (
ai_builder_integrations,
ai_builder_overview_items,
mcp_items,
)
from .sideb... |
def sidebar_link(*children, **props):
"""Create a sidebar link that closes the sidebar when clicked."""
return rx.link(
*children,
on_click=props.pop("on_click", NavbarState.set_sidebar_open(False)),
underline="none",
**props,
)
def sidebar_leaf(
item_index: str,
... | Scrollable_SideBar = """
function scrollToActiveSidebarLink() {
const currentPath = window.location.pathname.replace(/\\/+$|\\/$/g, "") + "/";
const activeLink = document.querySelector(`#sidebar-container a[href="${currentPath}"]`) ||
document.querySelector(`#sidebar-container a[href="${current... |
erprise_usage_items,
)
from .sidebar_items.learn import backend, cli_ref, frontend, hosting, learn
from .sidebar_items.recipes import recipes
from .sidebar_items.reference import api_reference
from .state import SideBarBase, SideBarItem, SidebarState
Scrollable_SideBar = """
function scrollToActiveSidebarLink() {
co... |
def sidebar_leaf(
item_index: str,
item: SideBarItem,
url: str,
) -> rx.Component:
"""Get the leaf node of the sidebar."""
item.link = item.link.replace("_", "-").rstrip("/") + "/"
return (
rx.accordion.item(
rx.accordion.header(
sidebar_link(
... | def sidebar_link(*children, **props):
"""Create a sidebar link that closes the sidebar when clicked."""
return rx.link(
*children,
on_click=props.pop("on_click", NavbarState.set_sidebar_open(False)),
underline="none",
**props,
) |
"
function scrollToActiveSidebarLink() {
const currentPath = window.location.pathname.replace(/\\/+$|\\/$/g, "") + "/";
const activeLink = document.querySelector(`#sidebar-container a[href="${currentPath}"]`) ||
document.querySelector(`#sidebar-container a[href="${currentPath.slice(0, -1)}"]`);... |
def sidebar_icon(name):
icon_map = {
"Getting Started": "rocket",
"Advanced Onboarding": "newspaper",
"Components": "layers",
"Pages": "sticky-note",
"Styling": "palette",
"Assets": "folder-open-dot",
"Wrapping React": "atom",
"Vars": "variable",
... | def sidebar_leaf(
item_index: str,
item: SideBarItem,
url: str,
) -> rx.Component:
"""Get the leaf node of the sidebar."""
item.link = item.link.replace("_", "-").rstrip("/") + "/"
return (
rx.accordion.item(
rx.accordion.header(
sidebar_link(
... |
document.querySelector(`#sidebar-container a[href="${currentPath}"]`) ||
document.querySelector(`#sidebar-container a[href="${currentPath.slice(0, -1)}"]`);
if (activeLink) {
activeLink.scrollIntoView({
block: "center",
});
}
}
setTimeout(scrollToActiveSidebarLink, 100);
window... |
return (
rx.accordion.item(
rx.accordion.header(
sidebar_link(
rx.flex(
rx.text(
item.names,
color=rx.cond(
item.link == url,
... | item.link = item.link.replace("_", "-").rstrip("/") + "/" |
l text-violet-9 transition-color",
),
padding="0px 8px 0px 28px",
class_name="border-l-[1.5px] border-violet-9",
),
href=item.link,
),
sidebar_link(... |
def sidebar_item_comp(
item_index: str,
item: SideBarItem,
index: list[int],
url: str,
):
index = rx.Var.create(index)
return (
sidebar_leaf(item_index=item_index, item=item, url=url)
if not item.children
else rx.accordion.item(
rx.accordion.header(
... | def sidebar_icon(name):
icon_map = {
"Getting Started": "rocket",
"Advanced Onboarding": "newspaper",
"Components": "layers",
"Pages": "sticky-note",
"Styling": "palette",
"Assets": "folder-open-dot",
"Wrapping React": "atom",
"Vars": "variable",
... |
olor",
),
padding="0px 8px 0px 28px",
class_name="border-l-[1.5px] border-violet-9",
),
href=item.link,
),
sidebar_link(
rx.... |
return (
rx.icon(tag=icon_map.get(name), size=16, class_name="mr-5")
if name in icon_map
else rx.fragment()
)
def sidebar_item_comp(
item_index: str,
item: SideBarItem,
index: list[int],
url: str,
):
index = rx.Var.create(index)
return (
sidebar_leaf(i... | icon_map = {
"Getting Started": "rocket",
"Advanced Onboarding": "newspaper",
"Components": "layers",
"Pages": "sticky-note",
"Styling": "palette",
"Assets": "folder-open-dot",
"Wrapping React": "atom",
"Vars": "variable",
"Events": "arrow-left-rig... |
verflow-visible",
)
)
def sidebar_icon(name):
icon_map = {
"Getting Started": "rocket",
"Advanced Onboarding": "newspaper",
"Components": "layers",
"Pages": "sticky-note",
"Styling": "palette",
"Assets": "folder-open-dot",
"Wrapping React": "atom... |
def calculate_index(sidebar_items, url: str) -> list[int]:
sidebar_items = (
sidebar_items if isinstance(sidebar_items, list) else [sidebar_items]
)
index_list = []
if not url:
return index_list
url = url.rstrip("/") + "/"
for item in sidebar_items:
item.link = item.... | def sidebar_item_comp(
item_index: str,
item: SideBarItem,
index: list[int],
url: str,
):
index = rx.Var.create(index)
return (
sidebar_leaf(item_index=item_index, item=item, url=url)
if not item.children
else rx.accordion.item(
rx.accordion.header(
... |
t",
"Advanced Onboarding": "newspaper",
"Components": "layers",
"Pages": "sticky-note",
"Styling": "palette",
"Assets": "folder-open-dot",
"Wrapping React": "atom",
"Vars": "variable",
"Events": "arrow-left-right",
"State Structure": "boxes",
... |
return (
sidebar_leaf(item_index=item_index, item=item, url=url)
if not item.children
else rx.accordion.item(
rx.accordion.header(
rx.accordion.trigger(
sidebar_icon(item.names),
rx.text(
item.names,... | index = rx.Var.create(index) |
ordion.content(
rx.accordion.root(
*[
sidebar_item_comp(
item_index="index" + str(child_index),
item=child,
index=index[1:],
url=url,
... |
def append_to_items(items, flat_items):
for item in items:
if not item.children:
flat_items.append(item)
append_to_items(item.children, flat_items)
flat_items = []
append_to_items(
learn
+ frontend
+ backend
+ hosting
+ component_lib
+ graphing_libs
+ rec... | def calculate_index(sidebar_items, url: str) -> list[int]:
sidebar_items = (
sidebar_items if isinstance(sidebar_items, list) else [sidebar_items]
)
index_list = []
if not url:
return index_list
url = url.rstrip("/") + "/"
for item in sidebar_items:
item.link = item.lin... |
*[
sidebar_item_comp(
item_index="index" + str(child_index),
item=child,
index=index[1:],
url=url,
)
for child_index, child in e... |
index_list = []
if not url:
return index_list
url = url.rstrip("/") + "/"
for item in sidebar_items:
item.link = item.link.rstrip("/") + "/"
sub = 0
for i, item in enumerate(sidebar_items):
if not item.children:
sub += 1
if item.link == url:
... | sidebar_items = (
sidebar_items if isinstance(sidebar_items, list) else [sidebar_items]
) |
(child_index),
item=child,
index=index[1:],
url=url,
)
for child_index, child in enumerate(item.children)
],
type="multiple",
co... |
if not url:
return index_list
url = url.rstrip("/") + "/"
for item in sidebar_items:
item.link = item.link.rstrip("/") + "/"
sub = 0
for i, item in enumerate(sidebar_items):
if not item.children:
sub += 1
if item.link == url:
return [i - sub... | index_list = [] |
item=child,
index=index[1:],
url=url,
)
for child_index, child in enumerate(item.children)
],
type="multiple",
collapsible=True,
... |
url = url.rstrip("/") + "/"
for item in sidebar_items:
item.link = item.link.rstrip("/") + "/"
sub = 0
for i, item in enumerate(sidebar_items):
if not item.children:
sub += 1
if item.link == url:
return [i - sub]
index = calculate_index(item.chil... | if not url:
return index_list |
index=index[1:],
url=url,
)
for child_index, child in enumerate(item.children)
],
type="multiple",
collapsible=True,
default_value=index[:1].fore... |
for item in sidebar_items:
item.link = item.link.rstrip("/") + "/"
sub = 0
for i, item in enumerate(sidebar_items):
if not item.children:
sub += 1
if item.link == url:
return [i - sub]
index = calculate_index(item.children, url)
if index:
... | url = url.rstrip("/") + "/" |
:],
url=url,
)
for child_index, child in enumerate(item.children)
],
type="multiple",
collapsible=True,
default_value=index[:1].foreach(lambda x: "index" + x.to_str... |
sub = 0
for i, item in enumerate(sidebar_items):
if not item.children:
sub += 1
if item.link == url:
return [i - sub]
index = calculate_index(item.children, url)
if index:
return [i - sub, *index]
return index_list
def append_to_items(i... | for item in sidebar_items:
item.link = item.link.rstrip("/") + "/" |
=url,
)
for child_index, child in enumerate(item.children)
],
type="multiple",
collapsible=True,
default_value=index[:1].foreach(lambda x: "index" + x.to_string()),
class_n... |
sub = 0
for i, item in enumerate(sidebar_items):
if not item.children:
sub += 1
if item.link == url:
return [i - sub]
index = calculate_index(item.children, url)
if index:
return [i - sub, *index]
return index_list
def append_to_items(i... | item.link = item.link.rstrip("/") + "/" |
for child_index, child in enumerate(item.children)
],
type="multiple",
collapsible=True,
default_value=index[:1].foreach(lambda x: "index" + x.to_string()),
class_name="!my-2 flex flex-col items-start gap-4 !ml-[10px] li... |
return index_list
def append_to_items(items, flat_items):
for item in items:
if not item.children:
flat_items.append(item)
append_to_items(item.children, flat_items)
flat_items = []
append_to_items(
learn
+ frontend
+ backend
+ hosting
+ component_lib
+ ... | for i, item in enumerate(sidebar_items):
if not item.children:
sub += 1
if item.link == url:
return [i - sub]
index = calculate_index(item.children, url)
if index:
return [i - sub, *index] |
)
],
type="multiple",
collapsible=True,
default_value=index[:1].foreach(lambda x: "index" + x.to_string()),
class_name="!my-2 flex flex-col items-start gap-4 !ml-[10px] list-none [box-shadow:inset_1.25px_0_0_0_var(--c-sl... |
if item.link == url:
return [i - sub]
index = calculate_index(item.children, url)
if index:
return [i - sub, *index]
return index_list
def append_to_items(items, flat_items):
for item in items:
if not item.children:
flat_items.append(item)
... | if not item.children:
sub += 1 |
multiple",
collapsible=True,
default_value=index[:1].foreach(lambda x: "index" + x.to_string()),
class_name="!my-2 flex flex-col items-start gap-4 !ml-[10px] list-none [box-shadow:inset_1.25px_0_0_0_var(--c-slate-4)_!important] !bg-transparent !rounded-none",
... |
index = calculate_index(item.children, url)
if index:
return [i - sub, *index]
return index_list
def append_to_items(items, flat_items):
for item in items:
if not item.children:
flat_items.append(item)
append_to_items(item.children, flat_items)
flat_... | if item.link == url:
return [i - sub] |
default_value=index[:1].foreach(lambda x: "index" + x.to_string()),
class_name="!my-2 flex flex-col items-start gap-4 !ml-[10px] list-none [box-shadow:inset_1.25px_0_0_0_var(--c-slate-4)_!important] !bg-transparent !rounded-none",
),
class_name="!p-0 w-full... |
if index:
return [i - sub, *index]
return index_list
def append_to_items(items, flat_items):
for item in items:
if not item.children:
flat_items.append(item)
append_to_items(item.children, flat_items)
flat_items = []
append_to_items(
learn
+ frontend... | index = calculate_index(item.children, url) |
"index" + x.to_string()),
class_name="!my-2 flex flex-col items-start gap-4 !ml-[10px] list-none [box-shadow:inset_1.25px_0_0_0_var(--c-slate-4)_!important] !bg-transparent !rounded-none",
),
class_name="!p-0 w-full !bg-transparent before:!h-0 after:!h-0",
... |
return index_list
def append_to_items(items, flat_items):
for item in items:
if not item.children:
flat_items.append(item)
append_to_items(item.children, flat_items)
flat_items = []
append_to_items(
learn
+ frontend
+ backend
+ hosting
+ component_lib
+ ... | if index:
return [i - sub, *index] |
ex-col items-start gap-4 !ml-[10px] list-none [box-shadow:inset_1.25px_0_0_0_var(--c-slate-4)_!important] !bg-transparent !rounded-none",
),
class_name="!p-0 w-full !bg-transparent before:!h-0 after:!h-0",
),
value=item_index,
class_name="border-none w... |
flat_items = []
append_to_items(
learn
+ frontend
+ backend
+ hosting
+ component_lib
+ graphing_libs
+ recipes
+ ai_builder_overview_items
+ ai_builder_integrations
+ api_reference
+ enterprise_items,
flat_items,
)
def get_prev_next(url):
"""Get the previous and... | def append_to_items(items, flat_items):
for item in items:
if not item.children:
flat_items.append(item)
append_to_items(item.children, flat_items) |
e [box-shadow:inset_1.25px_0_0_0_var(--c-slate-4)_!important] !bg-transparent !rounded-none",
),
class_name="!p-0 w-full !bg-transparent before:!h-0 after:!h-0",
),
value=item_index,
class_name="border-none w-full !bg-transparent",
)
)
de... |
flat_items = []
append_to_items(
learn
+ frontend
+ backend
+ hosting
+ component_lib
+ graphing_libs
+ recipes
+ ai_builder_overview_items
+ ai_builder_integrations
+ api_reference
+ enterprise_items,
flat_items,
)
def get_prev_next(url):
"""Get the previous and... | for item in items:
if not item.children:
flat_items.append(item)
append_to_items(item.children, flat_items) |
0_0_0_var(--c-slate-4)_!important] !bg-transparent !rounded-none",
),
class_name="!p-0 w-full !bg-transparent before:!h-0 after:!h-0",
),
value=item_index,
class_name="border-none w-full !bg-transparent",
)
)
def calculate_index(sidebar_i... |
append_to_items(item.children, flat_items)
flat_items = []
append_to_items(
learn
+ frontend
+ backend
+ hosting
+ component_lib
+ graphing_libs
+ recipes
+ ai_builder_overview_items
+ ai_builder_integrations
+ api_reference
+ enterprise_items,
flat_items,
)
... | if not item.children:
flat_items.append(item) |
e="!p-0 w-full !bg-transparent before:!h-0 after:!h-0",
),
value=item_index,
class_name="border-none w-full !bg-transparent",
)
)
def calculate_index(sidebar_items, url: str) -> list[int]:
sidebar_items = (
sidebar_items if isinstance(sidebar_items, list) el... |
append_to_items(
learn
+ frontend
+ backend
+ hosting
+ component_lib
+ graphing_libs
+ recipes
+ ai_builder_overview_items
+ ai_builder_integrations
+ api_reference
+ enterprise_items,
flat_items,
)
def get_prev_next(url):
"""Get the previous and next links in the... | flat_items = [] |
sidebar_items if isinstance(sidebar_items, list) else [sidebar_items]
)
index_list = []
if not url:
return index_list
url = url.rstrip("/") + "/"
for item in sidebar_items:
item.link = item.link.rstrip("/") + "/"
sub = 0
for i, item in enumerate(sidebar_items):
i... |
def filter_out_non_sidebar_items(items: list[SideBarBase]) -> list[SideBarItem]:
"""Filter out non-sidebar items making sure only SideBarItems are present.
Args:
items: The items to filter.
Return:
The filtered side bar items.
"""
return [item for item in items if isinstance(ite... | def get_prev_next(url):
"""Get the previous and next links in the sidebar."""
url = url.strip("/")
for i, item in enumerate(flat_items):
if item.link.strip("/") == url:
prev_link = flat_items[i - 1] if i > 0 else None
next_link = flat_items[i + 1] if i < len(flat_items) - 1 e... |
ex_list = []
if not url:
return index_list
url = url.rstrip("/") + "/"
for item in sidebar_items:
item.link = item.link.rstrip("/") + "/"
sub = 0
for i, item in enumerate(sidebar_items):
if not item.children:
sub += 1
if item.link == url:
ret... |
for i, item in enumerate(flat_items):
if item.link.strip("/") == url:
prev_link = flat_items[i - 1] if i > 0 else None
next_link = flat_items[i + 1] if i < len(flat_items) - 1 else None
return prev_link, next_link
return None, None
def filter_out_non_sidebar_items(... | url = url.strip("/") |
url:
return index_list
url = url.rstrip("/") + "/"
for item in sidebar_items:
item.link = item.link.rstrip("/") + "/"
sub = 0
for i, item in enumerate(sidebar_items):
if not item.children:
sub += 1
if item.link == url:
return [i - sub]
ind... |
return None, None
def filter_out_non_sidebar_items(items: list[SideBarBase]) -> list[SideBarItem]:
"""Filter out non-sidebar items making sure only SideBarItems are present.
Args:
items: The items to filter.
Return:
The filtered side bar items.
"""
return [item for item in i... | for i, item in enumerate(flat_items):
if item.link.strip("/") == url:
prev_link = flat_items[i - 1] if i > 0 else None
next_link = flat_items[i + 1] if i < len(flat_items) - 1 else None
return prev_link, next_link |
rstrip("/") + "/"
for item in sidebar_items:
item.link = item.link.rstrip("/") + "/"
sub = 0
for i, item in enumerate(sidebar_items):
if not item.children:
sub += 1
if item.link == url:
return [i - sub]
index = calculate_index(item.children, url)
... |
return None, None
def filter_out_non_sidebar_items(items: list[SideBarBase]) -> list[SideBarItem]:
"""Filter out non-sidebar items making sure only SideBarItems are present.
Args:
items: The items to filter.
Return:
The filtered side bar items.
"""
return [item for item in i... | if item.link.strip("/") == url:
prev_link = flat_items[i - 1] if i > 0 else None
next_link = flat_items[i + 1] if i < len(flat_items) - 1 else None
return prev_link, next_link |
ems:
item.link = item.link.rstrip("/") + "/"
sub = 0
for i, item in enumerate(sidebar_items):
if not item.children:
sub += 1
if item.link == url:
return [i - sub]
index = calculate_index(item.children, url)
if index:
return [i - sub, *i... |
next_link = flat_items[i + 1] if i < len(flat_items) - 1 else None
return prev_link, next_link
return None, None
def filter_out_non_sidebar_items(items: list[SideBarBase]) -> list[SideBarItem]:
"""Filter out non-sidebar items making sure only SideBarItems are present.
Args:
... | prev_link = flat_items[i - 1] if i > 0 else None |
= 0
for i, item in enumerate(sidebar_items):
if not item.children:
sub += 1
if item.link == url:
return [i - sub]
index = calculate_index(item.children, url)
if index:
return [i - sub, *index]
return index_list
def append_to_items(items, fla... |
return prev_link, next_link
return None, None
def filter_out_non_sidebar_items(items: list[SideBarBase]) -> list[SideBarItem]:
"""Filter out non-sidebar items making sure only SideBarItems are present.
Args:
items: The items to filter.
Return:
The filtered side bar items... | next_link = flat_items[i + 1] if i < len(flat_items) - 1 else None |
return [i - sub]
index = calculate_index(item.children, url)
if index:
return [i - sub, *index]
return index_list
def append_to_items(items, flat_items):
for item in items:
if not item.children:
flat_items.append(item)
append_to_items(item.chi... |
def sidebar_category(name: str, url: str, icon: str, index: int):
return rx.el.li(
rx.el.div(
rx.box(
rx.box(
rx.box(
rx.icon(
tag=icon,
size=16,
cla... | def filter_out_non_sidebar_items(items: list[SideBarBase]) -> list[SideBarItem]:
"""Filter out non-sidebar items making sure only SideBarItems are present.
Args:
items: The items to filter.
Return:
The filtered side bar items.
"""
return [item for item in items if isinstance(item, ... |
s)
flat_items = []
append_to_items(
learn
+ frontend
+ backend
+ hosting
+ component_lib
+ graphing_libs
+ recipes
+ ai_builder_overview_items
+ ai_builder_integrations
+ api_reference
+ enterprise_items,
flat_items,
)
def get_prev_next(url):
"""Get the previous a... |
def create_sidebar_section(
section_title: str,
section_url: str,
items: list[SideBarItem],
index: rx.Var[list[str]] | list[str],
url: rx.Var[str] | str,
) -> rx.Component:
# Check if the section has any nested sections (Like the Other Libraries Section)
nested = any(len(child.children) >... | def sidebar_category(name: str, url: str, icon: str, index: int):
return rx.el.li(
rx.el.div(
rx.box(
rx.box(
rx.box(
rx.icon(
tag=icon,
size=16,
class_... |
),
rx.box(
class_name="bg-violet-9 rounded-full shrink-0 size-[7px]"
+ rx.cond(
SidebarState.sidebar_index == index, " visible", " hidden"
),
),
class_name="cursor-pointer flex flex-r... |
@rx.memo
def sidebar_comp(
url: str,
learn_index: list[int],
component_lib_index: list[int],
frontend_index: list[int],
backend_index: list[int],
hosting_index: list[int],
graphing_libs_index: list[int],
api_reference_index: list[int],
recipes_index: list[int],
enterprise_usag... | def create_sidebar_section(
section_title: str,
section_url: str,
items: list[SideBarItem],
index: rx.Var[list[str]] | list[str],
url: rx.Var[str] | str,
) -> rx.Component:
# Check if the section has any nested sections (Like the Other Libraries Section)
nested = any(len(child.children) > 0 ... |
lass_name="cursor-pointer flex flex-row justify-between items-center hover:bg-slate-3 p-[0.5rem_1rem_0.5rem_0.5rem] rounded-2xl w-full transition-bg self-stretch"
+ rx.cond(
SidebarState.sidebar_index == index,
" bg-slate-3",
" bg-transparent",... |
# Make sure the index is a list
index = index.to(list)
return rx.el.li(
rx.link(
rx.el.h5(
section_title,
class_name="font-smbold text-[0.875rem] text-slate-12 hover:text-violet-9 leading-5 tracking-[-0.01313rem] transition-color",
),
... | nested = any(len(child.children) > 0 for item in items for child in item.children) |
-2xl w-full transition-bg self-stretch"
+ rx.cond(
SidebarState.sidebar_index == index,
" bg-slate-3",
" bg-transparent",
),
),
rx.el.a(
to=url,
on_click=rx.prevent_default... |
return rx.el.li(
rx.link(
rx.el.h5(
section_title,
class_name="font-smbold text-[0.875rem] text-slate-12 hover:text-violet-9 leading-5 tracking-[-0.01313rem] transition-color",
),
underline="none",
href=section_url,
... | index = index.to(list) |
url=url,
)
for item_index, item in enumerate(items)
],
type="multiple",
collapsible=True,
default_value=index[:1].foreach(lambda x: "index" + x.to_string()),
class_name="ml-0 pl-0 w-full !bg-transparent !shadow-none rounded-[... |
from pcweb.pages.docs import enterprise, getting_started, state, ui
from pcweb.pages.docs import hosting as hosting_page
from pcweb.pages.docs.apiref import pages
from pcweb.pages.docs.custom_components import custom_components
from pcweb.pages.docs.library import library
from pcweb.pages.docs.... | from pcweb.pages.docs import ai_builder as ai_builder_pages |
em in enumerate(items)
],
type="multiple",
collapsible=True,
default_value=index[:1].foreach(lambda x: "index" + x.to_string()),
class_name="ml-0 pl-0 w-full !bg-transparent !shadow-none rounded-[0px]",
),
class_name="flex flex-col items-start ... |
from pcweb.pages.docs import hosting as hosting_page
from pcweb.pages.docs.apiref import pages
from pcweb.pages.docs.custom_components import custom_components
from pcweb.pages.docs.library import library
from pcweb.pages.docs.recipes_overview import overview
return rx.box( # pyright: ignore ... | from pcweb.pages.docs import enterprise, getting_started, state, ui |
collapsible=True,
default_value=index[:1].foreach(lambda x: "index" + x.to_string()),
class_name="ml-0 pl-0 w-full !bg-transparent !shadow-none rounded-[0px]",
),
class_name="flex flex-col items-start ml-0 w-full",
)
@rx.memo
def sidebar_comp(
url: str,
learn... |
from pcweb.pages.docs.apiref import pages
from pcweb.pages.docs.custom_components import custom_components
from pcweb.pages.docs.library import library
from pcweb.pages.docs.recipes_overview import overview
return rx.box( # pyright: ignore [reportCallIssue]
# Handle sidebar categories for... | from pcweb.pages.docs import hosting as hosting_page |
:1].foreach(lambda x: "index" + x.to_string()),
class_name="ml-0 pl-0 w-full !bg-transparent !shadow-none rounded-[0px]",
),
class_name="flex flex-col items-start ml-0 w-full",
)
@rx.memo
def sidebar_comp(
url: str,
learn_index: list[int],
component_lib_index: list[int],
... |
from pcweb.pages.docs.custom_components import custom_components
from pcweb.pages.docs.library import library
from pcweb.pages.docs.recipes_overview import overview
return rx.box( # pyright: ignore [reportCallIssue]
# Handle sidebar categories for docs/cloud first
rx.cond( # pyright:... | from pcweb.pages.docs.apiref import pages |
,
class_name="ml-0 pl-0 w-full !bg-transparent !shadow-none rounded-[0px]",
),
class_name="flex flex-col items-start ml-0 w-full",
)
@rx.memo
def sidebar_comp(
url: str,
learn_index: list[int],
component_lib_index: list[int],
frontend_index: list[int],
backend_index... |
from pcweb.pages.docs.library import library
from pcweb.pages.docs.recipes_overview import overview
return rx.box( # pyright: ignore [reportCallIssue]
# Handle sidebar categories for docs/cloud first
rx.cond( # pyright: ignore [reportCallIssue]
rx.State.router.page.path.start... | from pcweb.pages.docs.custom_components import custom_components |
ne rounded-[0px]",
),
class_name="flex flex-col items-start ml-0 w-full",
)
@rx.memo
def sidebar_comp(
url: str,
learn_index: list[int],
component_lib_index: list[int],
frontend_index: list[int],
backend_index: list[int],
hosting_index: list[int],
graphing_libs_index: l... |
from pcweb.pages.docs.recipes_overview import overview
return rx.box( # pyright: ignore [reportCallIssue]
# Handle sidebar categories for docs/cloud first
rx.cond( # pyright: ignore [reportCallIssue]
rx.State.router.page.path.startswith("/docs/hosting/"),
rx.el.ul(
... | from pcweb.pages.docs.library import library |
"flex flex-col items-start ml-0 w-full",
)
@rx.memo
def sidebar_comp(
url: str,
learn_index: list[int],
component_lib_index: list[int],
frontend_index: list[int],
backend_index: list[int],
hosting_index: list[int],
graphing_libs_index: list[int],
api_reference_index: list[int],
... |
return rx.box( # pyright: ignore [reportCallIssue]
# Handle sidebar categories for docs/cloud first
rx.cond( # pyright: ignore [reportCallIssue]
rx.State.router.page.path.startswith("/docs/hosting/"),
rx.el.ul(
sidebar_category(
"Cloud"... | from pcweb.pages.docs.recipes_overview import overview |
s",
enterprise.components.path,
enterprise_component_items,
enterprise_component_index,
url,
),
class_name="flex... |
sb = sidebar(width="100%")
| def sidebar(url=None, width: str = "100%") -> rx.Component:
"""Render the sidebar."""
learn_index = calculate_index(learn, url)
component_lib_index = calculate_index(component_lib, url)
frontend_index = calculate_index(frontend, url)
backend_index = calculate_index(backend, url)
hosting_index = ... |
enterprise_component_items,
enterprise_component_index,
url,
),
class_name="flex flex-col items-start gap-6 p-[0px_1rem_0px_0.5rem] w-full list-none list-style-none",
... |
component_lib_index = calculate_index(component_lib, url)
frontend_index = calculate_index(frontend, url)
backend_index = calculate_index(backend, url)
hosting_index = calculate_index(hosting, url)
graphing_libs_index = calculate_index(graphing_libs, url)
api_reference_index = calculate_index(a... | learn_index = calculate_index(learn, url) |
enterprise_component_index,
url,
),
class_name="flex flex-col items-start gap-6 p-[0px_1rem_0px_0.5rem] w-full list-none list-style-none",
),
... |
frontend_index = calculate_index(frontend, url)
backend_index = calculate_index(backend, url)
hosting_index = calculate_index(hosting, url)
graphing_libs_index = calculate_index(graphing_libs, url)
api_reference_index = calculate_index(api_reference, url)
recipes_index = calculate_index(recipes... | component_lib_index = calculate_index(component_lib, url) |
url,
),
class_name="flex flex-col items-start gap-6 p-[0px_1rem_0px_0.5rem] w-full list-none list-style-none",
),
),
),
),
),
... |
backend_index = calculate_index(backend, url)
hosting_index = calculate_index(hosting, url)
graphing_libs_index = calculate_index(graphing_libs, url)
api_reference_index = calculate_index(api_reference, url)
recipes_index = calculate_index(recipes, url)
enterprise_usage_index = calculate_index(... | frontend_index = calculate_index(frontend, url) |
),
class_name="flex flex-col items-start gap-6 p-[0px_1rem_0px_0.5rem] w-full list-none list-style-none",
),
),
),
),
),
),
# Handle general docs sections
... |
hosting_index = calculate_index(hosting, url)
graphing_libs_index = calculate_index(graphing_libs, url)
api_reference_index = calculate_index(api_reference, url)
recipes_index = calculate_index(recipes, url)
enterprise_usage_index = calculate_index(enterprise_usage_items, url)
enterprise_compon... | backend_index = calculate_index(backend, url) |
class_name="flex flex-col items-start gap-6 p-[0px_1rem_0px_0.5rem] w-full list-none list-style-none",
),
),
),
),
),
),
# Handle general docs sections
style={
"&::-webkit-scrollbar-th... |
graphing_libs_index = calculate_index(graphing_libs, url)
api_reference_index = calculate_index(api_reference, url)
recipes_index = calculate_index(recipes, url)
enterprise_usage_index = calculate_index(enterprise_usage_items, url)
enterprise_component_index = calculate_index(enterprise_component_i... | hosting_index = calculate_index(hosting, url) |
_1rem_0px_0.5rem] w-full list-none list-style-none",
),
),
),
),
),
),
# Handle general docs sections
style={
"&::-webkit-scrollbar-thumb": {
"background_color": "trans... |
api_reference_index = calculate_index(api_reference, url)
recipes_index = calculate_index(recipes, url)
enterprise_usage_index = calculate_index(enterprise_usage_items, url)
enterprise_component_index = calculate_index(enterprise_component_items, url)
cli_ref_index = calculate_index(cli_ref, url)
... | graphing_libs_index = calculate_index(graphing_libs, url) |
),
),
),
),
),
),
# Handle general docs sections
style={
"&::-webkit-scrollbar-thumb": {
"background_color": "transparent",
},
"&::-webkit-scrollbar": {
... |
recipes_index = calculate_index(recipes, url)
enterprise_usage_index = calculate_index(enterprise_usage_items, url)
enterprise_component_index = calculate_index(enterprise_component_items, url)
cli_ref_index = calculate_index(cli_ref, url)
ai_builder_overview_index = calculate_index(ai_builder_ove... | api_reference_index = calculate_index(api_reference, url) |
),
),
),
),
# Handle general docs sections
style={
"&::-webkit-scrollbar-thumb": {
"background_color": "transparent",
},
"&::-webkit-scrollbar": {
"background_color": "transparent",
... |
enterprise_usage_index = calculate_index(enterprise_usage_items, url)
enterprise_component_index = calculate_index(enterprise_component_items, url)
cli_ref_index = calculate_index(cli_ref, url)
ai_builder_overview_index = calculate_index(ai_builder_overview_items, url)
ai_builder_integrations_inde... | recipes_index = calculate_index(recipes, url) |
),
# Handle general docs sections
style={
"&::-webkit-scrollbar-thumb": {
"background_color": "transparent",
},
"&::-webkit-scrollbar": {
"background_color": "transparent",
},
},
class_name="flex flex-col !... |
enterprise_component_index = calculate_index(enterprise_component_items, url)
cli_ref_index = calculate_index(cli_ref, url)
ai_builder_overview_index = calculate_index(ai_builder_overview_items, url)
ai_builder_integrations_index = calculate_index(ai_builder_integrations, url)
mcp_index = calculat... | enterprise_usage_index = calculate_index(enterprise_usage_items, url) |
::-webkit-scrollbar-thumb": {
"background_color": "transparent",
},
"&::-webkit-scrollbar": {
"background_color": "transparent",
},
},
class_name="flex flex-col !pb-24 gap-6 items-start max-h-[90%] p-[1rem_0rem_1rem_1rem] lg-p2 scroll-p... |
cli_ref_index = calculate_index(cli_ref, url)
ai_builder_overview_index = calculate_index(ai_builder_overview_items, url)
ai_builder_integrations_index = calculate_index(ai_builder_integrations, url)
mcp_index = calculate_index(mcp_items, url)
return rx.box(
sidebar_comp(
url=... | enterprise_component_index = calculate_index(enterprise_component_items, url) |
},
"&::-webkit-scrollbar": {
"background_color": "transparent",
},
},
class_name="flex flex-col !pb-24 gap-6 items-start max-h-[90%] p-[1rem_0rem_1rem_1rem] lg-p2 scroll-p-4 fixed w-full overflow-y-scroll hidden-scrollbar lg:max-w-[300px]",
)
def s... |
ai_builder_overview_index = calculate_index(ai_builder_overview_items, url)
ai_builder_integrations_index = calculate_index(ai_builder_integrations, url)
mcp_index = calculate_index(mcp_items, url)
return rx.box(
sidebar_comp(
url=url,
learn_index=learn_index,
... | cli_ref_index = calculate_index(cli_ref, url) |
"background_color": "transparent",
},
},
class_name="flex flex-col !pb-24 gap-6 items-start max-h-[90%] p-[1rem_0rem_1rem_1rem] lg-p2 scroll-p-4 fixed w-full overflow-y-scroll hidden-scrollbar lg:max-w-[300px]",
)
def sidebar(url=None, width: str = "100%") -> rx.Compon... |
ai_builder_integrations_index = calculate_index(ai_builder_integrations, url)
mcp_index = calculate_index(mcp_items, url)
return rx.box(
sidebar_comp(
url=url,
learn_index=learn_index,
component_lib_index=component_lib_index,
frontend_index=frontend_... | ai_builder_overview_index = calculate_index(ai_builder_overview_items, url) |
class_name="flex flex-col !pb-24 gap-6 items-start max-h-[90%] p-[1rem_0rem_1rem_1rem] lg-p2 scroll-p-4 fixed w-full overflow-y-scroll hidden-scrollbar lg:max-w-[300px]",
)
def sidebar(url=None, width: str = "100%") -> rx.Component:
"""Render the sidebar."""
learn_index = calculate_index(learn, url)... |
mcp_index = calculate_index(mcp_items, url)
return rx.box(
sidebar_comp(
url=url,
learn_index=learn_index,
component_lib_index=component_lib_index,
frontend_index=frontend_index,
backend_index=backend_index,
hosting_index=hosting_... | ai_builder_integrations_index = calculate_index(ai_builder_integrations, url) |
1rem_1rem] lg-p2 scroll-p-4 fixed w-full overflow-y-scroll hidden-scrollbar lg:max-w-[300px]",
)
def sidebar(url=None, width: str = "100%") -> rx.Component:
"""Render the sidebar."""
learn_index = calculate_index(learn, url)
component_lib_index = calculate_index(component_lib, url)
frontend_index ... |
return rx.box(
sidebar_comp(
url=url,
learn_index=learn_index,
component_lib_index=component_lib_index,
frontend_index=frontend_index,
backend_index=backend_index,
hosting_index=hosting_index,
graphing_libs_index=graphing_... | mcp_index = calculate_index(mcp_items, url) |
index = calculate_index(mcp_items, url)
return rx.box(
sidebar_comp(
url=url,
learn_index=learn_index,
component_lib_index=component_lib_index,
frontend_index=frontend_index,
backend_index=backend_index,
hosting_index=hosting_index,
... | sb = sidebar(width="100%") | |
"""The state of the sidebar component."""
|
import reflex as rx
from reflex.base import Base
class SideBarBase(Base):
"""Base class for the Side bar."""
# The name to display in the sidebar.
names: str = ""
alt_name_for_next_prev: str = ""
# The link to navigate to when the item is clicked.
link: str = ""
# The children items.... | from __future__ import annotations |
"""The state of the sidebar component."""
from __future__ import annotations
|
from reflex.base import Base
class SideBarBase(Base):
"""Base class for the Side bar."""
# The name to display in the sidebar.
names: str = ""
alt_name_for_next_prev: str = ""
# The link to navigate to when the item is clicked.
link: str = ""
# The children items.
children: list[S... | import reflex as rx |
"""The state of the sidebar component."""
from __future__ import annotations
import reflex as rx
|
class SideBarBase(Base):
"""Base class for the Side bar."""
# The name to display in the sidebar.
names: str = ""
alt_name_for_next_prev: str = ""
# The link to navigate to when the item is clicked.
link: str = ""
# The children items.
children: list[SideBarItem] = []
# Wheth... | from reflex.base import Base |
"""The state of the sidebar component."""
from __future__ import annotations
import reflex as rx
from reflex.base import Base
class SideBarBase(Base):
"""Base class for the Side bar."""
# The name to display in the sidebar.
names: str = ""
alt_name_for_next_prev: str = ""
# The link to naviga... |
class SideBarItem(SideBarBase):
"""A single item in the sidebar."""
...
class SideBarSection(SideBarBase):
"""A section in the sidebar."""
...
class SidebarState(rx.State):
_sidebar_index: int = -1
@rx.event(temporal=True)
def set_sidebar_index(self, num) -> int:
self._side... | outer = False |
"""The state of the sidebar component."""
from __future__ import annotations
import reflex as rx
from reflex.base import Base
class SideBarBase(Base):
"""Base class for the Side bar."""
# The name to display in the sidebar.
names: str = ""
alt_name_for_next_prev: str = ""
# The link to naviga... |
class SideBarSection(SideBarBase):
"""A section in the sidebar."""
...
class SidebarState(rx.State):
_sidebar_index: int = -1
@rx.event(temporal=True)
def set_sidebar_index(self, num) -> int:
self._sidebar_index = num
@rx.var(initial_value=-1)
def sidebar_index(self) -> int:
... | class SideBarItem(SideBarBase):
"""A single item in the sidebar."""
... |
"""The state of the sidebar component."""
from __future__ import annotations
import reflex as rx
from reflex.base import Base
class SideBarBase(Base):
"""Base class for the Side bar."""
# The name to display in the sidebar.
names: str = ""
alt_name_for_next_prev: str = ""
# The link to naviga... |
class SidebarState(rx.State):
_sidebar_index: int = -1
@rx.event(temporal=True)
def set_sidebar_index(self, num) -> int:
self._sidebar_index = num
@rx.var(initial_value=-1)
def sidebar_index(self) -> int:
route = self.router.url.path
if self._sidebar_index < 0:
... | class SideBarSection(SideBarBase):
"""A section in the sidebar."""
... |
"""The state of the sidebar component."""
from __future__ import annotations
import reflex as rx
from reflex.base import Base
class SideBarBase(Base):
"""Base class for the Side bar."""
# The name to display in the sidebar.
names: str = ""
alt_name_for_next_prev: str = ""
# The link to naviga... |
@rx.var(initial_value=-1)
def sidebar_index(self) -> int:
route = self.router.url.path
if self._sidebar_index < 0:
if "library" in route:
return 1
elif "hosting" in route:
return 0
elif "api-reference" in route:
... | def set_sidebar_index(self, num) -> int:
self._sidebar_index = num |
"""The state of the sidebar component."""
from __future__ import annotations
import reflex as rx
from reflex.base import Base
class SideBarBase(Base):
"""Base class for the Side bar."""
# The name to display in the sidebar.
names: str = ""
alt_name_for_next_prev: str = ""
# The link to naviga... |
@rx.var(initial_value=-1)
def sidebar_index(self) -> int:
route = self.router.url.path
if self._sidebar_index < 0:
if "library" in route:
return 1
elif "hosting" in route:
return 0
elif "api-reference" in route:
... | self._sidebar_index = num |
"""The state of the sidebar component."""
from __future__ import annotations
import reflex as rx
from reflex.base import Base
class SideBarBase(Base):
"""Base class for the Side bar."""
# The name to display in the sidebar.
names: str = ""
alt_name_for_next_prev: str = ""
# The link to naviga... |
if self._sidebar_index < 0:
if "library" in route:
return 1
elif "hosting" in route:
return 0
elif "api-reference" in route:
return 2
elif "enterprise" in route:
return 3
else:
... | route = self.router.url.path |
es: str = ""
alt_name_for_next_prev: str = ""
# The link to navigate to when the item is clicked.
link: str = ""
# The children items.
children: list[SideBarItem] = []
# Whether the item is a category. Occurs if a single item is at the top level of the sidebar for aesthetics.
outer = Fal... |
if "hosting" in route:
return 0
return self._sidebar_index
| elif "enterprise" in route:
return 3
else:
return 0 |
ed.
link: str = ""
# The children items.
children: list[SideBarItem] = []
# Whether the item is a category. Occurs if a single item is at the top level of the sidebar for aesthetics.
outer = False
class SideBarItem(SideBarBase):
"""A single item in the sidebar."""
...
class SideBarSec... |
return self._sidebar_index
| if "hosting" in route:
return 0 |
def get_sidebar_items_ai_builder_overview():
from pcweb.pages.docs import ai_builder
return [
create_item(
"Overview",
children=[
ai_builder.overview.best_practices,
ai_builder.overview.what_is_reflex_build,
ai_builder.overview.... | from .item import create_item | |
from .item import create_item
def get_sidebar_items_ai_builder_overview():
|
return [
create_item(
"Overview",
children=[
ai_builder.overview.best_practices,
ai_builder.overview.what_is_reflex_build,
ai_builder.overview.tutorial,
ai_builder.overview.templates,
],
),
... | from pcweb.pages.docs import ai_builder |
,
),
create_item(
"App Lifecycle",
children=[
ai_builder.app_lifecycle.general,
ai_builder.app_lifecycle.fork_app,
ai_builder.app_lifecycle.deploy_app,
ai_builder.app_lifecycle.download_app,
ai_builde... |
return [
create_item(
"First Class Integrations",
children=[
ai_builder.integrations.overview,
# ai_builder.integrations.airtable,
ai_builder.integrations.anthropic,
ai_builder.integrations.azure_auth,
... | from pcweb.pages.docs import ai_builder |
children=[
ai_builder.python_libraries,
],
),
create_item(
"APIs",
children=[
ai_builder.apis,
],
),
create_item(
"Webhooks",
children=[
ai_builder.webhooks,... |
ai_builder_overview_items = get_sidebar_items_ai_builder_overview()
ai_builder_integrations = get_ai_builder_integrations()
mcp_items = get_sidebar_items_mcp()
| def get_sidebar_items_mcp():
from pcweb.pages.docs import ai_builder
return [
create_item(
"MCP Integration",
children=[
ai_builder.integrations.mcp_overview,
ai_builder.integrations.mcp_installation,
],
),
] |
ai_builder.python_libraries,
],
),
create_item(
"APIs",
children=[
ai_builder.apis,
],
),
create_item(
"Webhooks",
children=[
ai_builder.webhooks,
],
),
... |
return [
create_item(
"MCP Integration",
children=[
ai_builder.integrations.mcp_overview,
ai_builder.integrations.mcp_installation,
],
),
]
ai_builder_overview_items = get_sidebar_items_ai_builder_overview()
ai_builder_integ... | from pcweb.pages.docs import ai_builder |
er.webhooks,
],
),
create_item(
"URLs",
children=[
ai_builder.urls,
],
),
create_item(
"Databases",
children=[
ai_builder.integrations.database,
],
),
creat... |
ai_builder_integrations = get_ai_builder_integrations()
mcp_items = get_sidebar_items_mcp()
| ai_builder_overview_items = get_sidebar_items_ai_builder_overview() |
"URLs",
children=[
ai_builder.urls,
],
),
create_item(
"Databases",
children=[
ai_builder.integrations.database,
],
),
create_item(
"Files",
children=[
... |
mcp_items = get_sidebar_items_mcp()
| ai_builder_integrations = get_ai_builder_integrations() |
ilder.urls,
],
),
create_item(
"Databases",
children=[
ai_builder.integrations.database,
],
),
create_item(
"Files",
children=[
ai_builder.files,
],
),
crea... | mcp_items = get_sidebar_items_mcp() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.