From 0d00c75142204d0c8a306abda8591dddc9e3ca85 Mon Sep 17 00:00:00 2001 From: Iisakki Rotko Date: Mon, 25 Mar 2024 14:53:55 +0100 Subject: [PATCH] fix: make sure custom markdown renderer is always used, remove extra files --- solara/autorouting.py | 2 +- .../pages/documentation/advanced/__init__.py | 28 ------------------- .../advanced/content/__init__.py | 0 .../documentation/getting_started/__init__.py | 7 ----- .../content/08-lab/00-what-is-lab.md | 7 ----- .../getting_started/content/__init__.py | 0 6 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 solara/website/pages/documentation/advanced/content/__init__.py delete mode 100644 solara/website/pages/documentation/getting_started/content/08-lab/00-what-is-lab.md delete mode 100644 solara/website/pages/documentation/getting_started/content/__init__.py diff --git a/solara/autorouting.py b/solara/autorouting.py index 5fdb0be96..4028d01c9 100644 --- a/solara/autorouting.py +++ b/solara/autorouting.py @@ -509,7 +509,7 @@ def _generate_route_path(subpath: Path, layout=None, first=False, has_index=Fals component = markdown_renderer reload.reloader.watcher.add_file(subpath) elif subpath.is_dir(): - children = generate_routes_directory(subpath) + children = generate_routes_directory(subpath, markdown_renderer=markdown_renderer) else: reload.reloader.watcher.add_file(subpath) module = source_to_module(subpath, initial_namespace=initial_namespace) diff --git a/solara/website/pages/documentation/advanced/__init__.py b/solara/website/pages/documentation/advanced/__init__.py index ad2d74b70..5dad3db4b 100644 --- a/solara/website/pages/documentation/advanced/__init__.py +++ b/solara/website/pages/documentation/advanced/__init__.py @@ -1,37 +1,9 @@ from pathlib import Path -import solara from solara.autorouting import generate_routes_directory from solara.website.components.markdown import MarkdownWithMetadata -title = "Advanced" HERE = Path(__file__) # if we didn't put the content in the subdirectory, but pointed to the current file # we would include the current file recursively, causing an infinite loop routes = generate_routes_directory(HERE.parent / "content", MarkdownWithMetadata) - - -@solara.component -def Page(route_external=None): - MarkdownWithMetadata(Path(HERE.parent / "content" / "10-howto" / "00-overview.md").read_text()) - - with solara.Row(justify="center", style={"flex-wrap": "wrap", "align-items": "start"}): - for child in route_external.children: - if child.path == "/": - continue - - card_title = solara.Link("/documentation/advanced/" + child.path, children=[child.label]) - - with solara.Card(title=card_title, style={"min-width": "300px"}): - with solara.v.List(): - with solara.v.ListItemGroup(): - for grandchild in child.children: - if grandchild.path == "/": - continue - with solara.Link( - "/documentation/advanced/" + child.path + "/" + grandchild.path - if child.path != "/" - else "/documentation/advanced/" + grandchild.path - ): - with solara.v.ListItem(): - solara.v.ListItemTitle(children=[grandchild.label]) diff --git a/solara/website/pages/documentation/advanced/content/__init__.py b/solara/website/pages/documentation/advanced/content/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/solara/website/pages/documentation/getting_started/__init__.py b/solara/website/pages/documentation/getting_started/__init__.py index 4ac007ee4..5dad3db4b 100644 --- a/solara/website/pages/documentation/getting_started/__init__.py +++ b/solara/website/pages/documentation/getting_started/__init__.py @@ -1,16 +1,9 @@ from pathlib import Path -import solara from solara.autorouting import generate_routes_directory from solara.website.components.markdown import MarkdownWithMetadata -title = "Getting Started" HERE = Path(__file__) # if we didn't put the content in the subdirectory, but pointed to the current file # we would include the current file recursively, causing an infinite loop routes = generate_routes_directory(HERE.parent / "content", MarkdownWithMetadata) - - -@solara.component -def Page(route_external=None): - MarkdownWithMetadata(Path(HERE.parent / "content" / "01-introduction.md").read_text()) diff --git a/solara/website/pages/documentation/getting_started/content/08-lab/00-what-is-lab.md b/solara/website/pages/documentation/getting_started/content/08-lab/00-what-is-lab.md deleted file mode 100644 index af4890009..000000000 --- a/solara/website/pages/documentation/getting_started/content/08-lab/00-what-is-lab.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: What is Solara.lab? -description: Solara lab is a subpackage in solara containing Components, hooks and parts of Solara that are slightly experimental. ---- -# What is Solara lab? - -Solara lab is a subpackage in solara containing Components, hooks and parts of Solara that are slightly experimental. diff --git a/solara/website/pages/documentation/getting_started/content/__init__.py b/solara/website/pages/documentation/getting_started/content/__init__.py deleted file mode 100644 index e69de29bb..000000000