Skip to content

Commit 6705788

Browse files
authored
docs: Use all files within example folders for quartodoc (#1137)
1 parent 17370fd commit 6705788

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

shiny/_docstring.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import os
44
import sys
5+
from pathlib import Path
56
from typing import TYPE_CHECKING, Any, Callable, Literal, Optional, TypeVar
67

78

@@ -152,17 +153,19 @@ def _(func: F) -> F:
152153
return func
153154

154155
other_files: list[str] = []
155-
for f in os.listdir(example_dir):
156-
abs_f = os.path.join(example_dir, f)
156+
for abs_f in Path(example_dir).glob("**/*"):
157+
rel_f = abs_f.relative_to(example_dir)
158+
f = os.path.basename(abs_f)
157159
is_support_file = (
158160
os.path.isfile(abs_f)
159161
and f != app_file_name
160162
and f != "app.py"
163+
and f != ".DS_Store"
161164
and not f.startswith("app-")
162-
and not f.startswith("__")
165+
and not str(rel_f).startswith("__")
163166
)
164167
if is_support_file:
165-
other_files.append(abs_f)
168+
other_files.append(str(abs_f))
166169

167170
if func.__doc__ is None:
168171
func.__doc__ = ""

0 commit comments

Comments
 (0)