Skip to content

Commit

Permalink
fix: make sure custom markdown renderer is always used, remove extra …
Browse files Browse the repository at this point in the history
…files
  • Loading branch information
iisakkirotko committed Mar 28, 2024
1 parent b802556 commit 0d00c75
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 43 deletions.
2 changes: 1 addition & 1 deletion solara/autorouting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
28 changes: 0 additions & 28 deletions solara/website/pages/documentation/advanced/__init__.py
Original file line number Diff line number Diff line change
@@ -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])
Empty file.
Original file line number Diff line number Diff line change
@@ -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())

This file was deleted.

Empty file.

0 comments on commit 0d00c75

Please sign in to comment.