From 7e00681cb7b19bbe3ce769bd1d48bdf0d3caa07f Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Fri, 16 Feb 2024 16:21:36 -0500 Subject: [PATCH] Use all files within example folders for quartodoc --- shiny/_docstring.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/shiny/_docstring.py b/shiny/_docstring.py index 08ea1344b..8505f96b0 100644 --- a/shiny/_docstring.py +++ b/shiny/_docstring.py @@ -2,6 +2,7 @@ import os import sys +from pathlib import Path from typing import TYPE_CHECKING, Any, Callable, Literal, Optional, TypeVar @@ -152,17 +153,19 @@ def _(func: F) -> F: return func other_files: list[str] = [] - for f in os.listdir(example_dir): - abs_f = os.path.join(example_dir, f) + for abs_f in Path(example_dir).glob("**/*"): + rel_f = abs_f.relative_to(example_dir) + f = os.path.basename(abs_f) is_support_file = ( os.path.isfile(abs_f) and f != app_file_name and f != "app.py" + and f != ".DS_Store" and not f.startswith("app-") - and not f.startswith("__") + and not str(rel_f).startswith("__") ) if is_support_file: - other_files.append(abs_f) + other_files.append(str(abs_f)) if func.__doc__ is None: func.__doc__ = ""