Skip to content
Open

091dev #6349

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 42 additions & 45 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,53 +1,50 @@
fail_fast: true
repos:
- hooks:
- args:
- reflex
- tests
- docs/app
- packages
id: ruff-format
- args:
- --fix
- --exit-non-zero-on-fix
exclude: ^integration/benchmarks/
id: ruff-check
repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.6
- hooks:
- additional_dependencies:
- tomli
args:
- reflex
id: codespell
repo: https://github.com/codespell-project/codespell
rev: v2.4.1
- hooks:
- always_run: true
- repo: local
hooks:
- id: ruff-format
name: ruff-format
entry: ruff format --preview
language: system
types_or: [python, markdown]
require_serial: true
- id: ruff-check
name: ruff-check
entry: ruff check
language: system
args: [--fix, --exit-non-zero-on-fix]
types_or: [python, pyi]
require_serial: true
- repo: local
hooks:
- id: codespell
name: codespell
entry: codespell
language: system
types: [text]
require_serial: true
- repo: local
hooks:
- id: update-pyi-files
name: update-pyi-files
description: Update pyi files as needed
entry: python3 scripts/make_pyi.py
id: update-pyi-files
language: system
name: update-pyi-files
always_run: true
require_serial: true
repo: local
- hooks:
- args:
- reflex
- tests
id: pyright
- repo: local
hooks:
- id: pyright
name: pyright
entry: pyright
language: system
Comment thread
adhami3310 marked this conversation as resolved.
repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.408
- hooks:
- additional_dependencies:
- '@biomejs/biome@2.4.8'
args:
- --indent-width
- '2'
- --indent-style
- space
types: [python]
require_serial: true
- repo: https://github.com/biomejs/pre-commit
rev: 19865851e014cbe6138e295365f95ca51bf953f8 # v0.6.1
hooks:
- id: biome-format
additional_dependencies: ['@biomejs/biome@2.4.8']
args: [--indent-width, '2', --indent-style, space]
exclude: (\.css$|docs/app/)
id: biome-format
repo: https://github.com/biomejs/pre-commit
rev: v0.6.1
require_serial: true
12 changes: 5 additions & 7 deletions docs/app/agent_files/_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
def generate_markdown_files() -> tuple[tuple[Path, str | bytes], ...]:
from reflex_docs.pages.docs import doc_markdown_sources

return tuple(
[
(PosixPath(route.strip("/") + ".md"), resolved.read_bytes())
for route, source_path in doc_markdown_sources.items()
if (resolved := Path(source_path)).is_file()
]
)
return tuple([
(PosixPath(route.strip("/") + ".md"), resolved.read_bytes())
for route, source_path in doc_markdown_sources.items()
if (resolved := Path(source_path)).is_file()
])


def generate_llms_txt(
Expand Down
135 changes: 63 additions & 72 deletions docs/app/reflex_docs/pages/docs/cloud_cliref.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,83 +177,74 @@ def process(
"""Convert a Click command to a Markdown element."""
actual_name = override_name or command["name"]
full_name = prefix + " " + actual_name if prefix and actual_name else actual_name
cli_to_doc[full_name] = Section(
(
Paragraph(InlineText(command["help"])) if command["help"] else Empty(),
Section(
(
Header(3, InlineText("Usage")),
CodeBlock(
"$"
+ (" " + prefix.strip() if prefix else "")
+ " "
+ actual_name.strip()
+ (
" [OPTIONS]"
if command["params"]
and any(
param.get("param_type_name") != "argument"
for param in command["params"]
)
else ""
)
+ (
" " + " ".join(arguments)
if (
arguments := [
param["name"].upper()
for param in command["params"]
if param.get("param_type_name") == "argument"
and param["name"]
]
)
else ""
),
language="console",
),
cli_to_doc[full_name] = Section((
Paragraph(InlineText(command["help"])) if command["help"] else Empty(),
Section((
Header(3, InlineText("Usage")),
CodeBlock(
"$"
+ (" " + prefix.strip() if prefix else "")
+ " "
+ actual_name.strip()
+ (
" [OPTIONS]"
if command["params"]
and any(
param.get("param_type_name") != "argument"
for param in command["params"]
)
else ""
)
)
if actual_name
else Empty(),
Section(
(
Header(3, InlineText("Options")),
List(
tuple(
InlineTextCollection(
+ (
" " + " ".join(arguments)
if (
arguments := [
param["name"].upper()
for param in command["params"]
if param.get("param_type_name") == "argument"
and param["name"]
]
)
else ""
),
language="console",
),
))
if actual_name
else Empty(),
Section((
Header(3, InlineText("Options")),
List(
tuple(
InlineTextCollection((
InlineCode(
", ".join(param["opts"])
+ (
" / " + ", ".join(param["secondary_opts"])
if param["secondary_opts"]
else ""
)
+ (
(
InlineCode(
", ".join(param["opts"])
+ (
" / " + ", ".join(param["secondary_opts"])
if param["secondary_opts"]
else ""
)
+ (
(
" " + param["type"]["name"].upper()
if param["type"]["name"] != "boolean"
else ""
)
if (choices := param["type"].get("choices"))
is None
else " [" + "|".join(choices) + "]"
)
),
InlineText(": " + option_help),
" " + param["type"]["name"].upper()
if param["type"]["name"] != "boolean"
else ""
)
if (choices := param["type"].get("choices")) is None
else " [" + "|".join(choices) + "]"
)
for param in command["params"]
if (option_help := param.get("help")) is not None
),
ordered=False,
),
)
)
if command["params"]
else Empty(),
)
).into_text()
InlineText(": " + option_help),
))
for param in command["params"]
if (option_help := param.get("help")) is not None
),
ordered=False,
),
))
if command["params"]
else Empty(),
)).into_text()
for name, sub_command in sort_subcommands(command.get("commands", {})).items():
process(
sub_command,
Expand Down
40 changes: 18 additions & 22 deletions docs/app/reflex_docs/pages/docs/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,10 @@ def render_select(prop: PropDocumentation, component: type[Component], prop_dict
return rx.select.root(
rx.select.trigger(class_name="w-32 font-small text-slate-11"),
rx.select.content(
rx.select.group(
*[
rx.select.item(item, value=item, class_name="font-small")
for item in literal_values
]
)
rx.select.group(*[
rx.select.item(item, value=item, class_name="font-small")
for item in literal_values
])
),
value=var,
on_change=setter,
Expand Down Expand Up @@ -204,22 +202,20 @@ def render_select(prop: PropDocumentation, component: type[Component], prop_dict
return rx.select.root(
rx.select.trigger(class_name="font-small w-32 text-slate-11"),
rx.select.content(
rx.select.group(
*[
rx.select.item(
item,
value=item,
class_name="font-small",
_hover=(
{"background": f"var(--{item}-9)"}
if prop.name == "color_scheme"
else None
),
)
for item in list(map(str, type_.__args__))
if item != ""
]
),
rx.select.group(*[
rx.select.item(
item,
value=item,
class_name="font-small",
_hover=(
{"background": f"var(--{item}-9)"}
if prop.name == "color_scheme"
else None
),
)
for item in list(map(str, type_.__args__))
if item != ""
]),
),
value=var,
on_change=setter,
Expand Down
14 changes: 6 additions & 8 deletions docs/app/reflex_docs/pages/docs/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ def format_fields(
rx.scroll_area(
rx.table.root(
rx.table.header(
rx.table.row(
*[
rx.table.column_header_cell(
header, class_name=table_header_class_name
)
for header in headers
]
)
rx.table.row(*[
rx.table.column_header_cell(
header, class_name=table_header_class_name
)
for header in headers
])
),
rx.table.body(
*[
Expand Down
18 changes: 8 additions & 10 deletions docs/app/reflex_docs/pages/docs_landing/views/ai_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,15 @@ def get_integration_path() -> list:
if title == "Open Ai":
title = "Open AI"

result.append(
{
key: {
"path": f"{web_path_prefix}/{slug}",
"tags": tag,
"description": description,
"name": key,
"title": title,
}
result.append({
key: {
"path": f"{web_path_prefix}/{slug}",
"tags": tag,
"description": description,
"name": key,
"title": title,
}
)
})

return result

Expand Down
18 changes: 8 additions & 10 deletions docs/app/reflex_docs/pages/integrations/integration_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,14 @@ def get_integration_path() -> list:
if title == "Open Ai":
title = "Open AI"

result.append(
{
key: {
"path": f"{web_path_prefix}/{slug}",
"tags": tag,
"description": description,
"name": key,
"title": title,
}
result.append({
key: {
"path": f"{web_path_prefix}/{slug}",
"tags": tag,
"description": description,
"name": key,
"title": title,
}
)
})

return result
1 change: 1 addition & 0 deletions docs/app/templates/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Additionally you will want to change the `Item` class to match the data in your
```python
import dataclasses


@dataclasses.dataclass
class Item:
"""The item class."""
Expand Down
Loading
Loading