-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: new look for documentation pages (#768)
- Loading branch information
1 parent
d718e4f
commit 8928edc
Showing
20 changed files
with
193 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from .docs import CategoryLayout, Gallery, NoPage, SubCategoryLayout, WithCode # noqa | ||
from .header import Header | ||
from .markdown import MarkdownWithMetadata | ||
|
||
__all__ = ["Header"] | ||
__all__ = ["Header", "MarkdownWithMetadata", "CategoryLayout", "Gallery", "NoPage", "SubCategoryLayout", "WithCode"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from typing import List | ||
import solara | ||
|
||
|
||
@solara.component | ||
def BreadCrumbs(): | ||
router = solara.use_router() | ||
routes = router.path_routes | ||
|
||
with solara.Row(style={"align-items": "center", "flex-wrap": "wrap"}) as main: | ||
for i, route in enumerate(routes): | ||
if i == len(routes) - 1: | ||
solara.Text(route.label or route.path, style={"color": "var(--color-text-fade)"}) | ||
else: | ||
with solara.Link(solara.resolve_path(route), style={"color": "var(--color-text-fade)"}): | ||
solara.Text(route.label or route.path) | ||
if i != len(routes) - 1: | ||
solara.Text("/", style={"font-size": "1.5rem", "color": "var(--color-text-fade)"}) | ||
return main | ||
|
||
|
||
def _resolve_path_to_route(path_to_find: List[str], all_routes: List[solara.Route], routes: List[solara.Route] = []): | ||
if len(path_to_find) == 0: | ||
return routes | ||
for route in all_routes: | ||
if path_to_find[0] == route.path: | ||
routes += [route] | ||
return _resolve_path_to_route(path_to_find[1:], route.children, routes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<template> | ||
<v-list dense :style="`margin: 40px 24px 0 24px; position: sticky; top: 88px; align-self: flex-start;`" class="d-none d-lg-inline-block"> | ||
<v-list-item | ||
v-for="(element, index) in this.sections" | ||
:key="index" | ||
:href="'#' + element.id" | ||
:style="'padding-left: ' + (16 + (element.nodeName[1] - 1) * 20) + 'px;'" | ||
> | ||
<v-list-item-content> | ||
<v-list-item-title> | ||
{{ element.innerText }} | ||
</v-list-item-title> | ||
</v-list-item-content> | ||
</v-list-item> | ||
</v-list> | ||
</template> | ||
<script> | ||
module.exports = { | ||
mounted() { | ||
this.getSections(); | ||
}, | ||
methods: { | ||
getSections() { | ||
const parentToSearch = document.getElementById(this.id); | ||
this.sections = parentToSearch.querySelectorAll('h1, h2, h3, h4'); | ||
}, | ||
}, | ||
data() { | ||
return { | ||
sections: [] | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
from pathlib import Path | ||
|
||
import solara | ||
from solara.website.components.sidebar import Sidebar | ||
from solara.website.components import MarkdownWithMetadata | ||
|
||
title = "Changelog" | ||
HERE = Path(__file__) | ||
|
||
Page = solara.Markdown(Path(HERE.parent / "changelog.md").read_text()) | ||
Page = MarkdownWithMetadata(Path(HERE.parent / "changelog.md").read_text()) | ||
Sidebar = Sidebar |
Oops, something went wrong.