Skip to content

Commit

Permalink
docs: move reference from getting_started to advanced
Browse files Browse the repository at this point in the history
  • Loading branch information
iisakkirotko committed Apr 5, 2024
1 parent af4da18 commit c2951b9
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 23 deletions.
4 changes: 2 additions & 2 deletions solara/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def mean(df, column):
memory content.
The storage can be any object that implements the MutableMapping interface, for instance a dict or
a cachetools.LRUCache. Or a new instance of `solara.cache.Memory`, see [caching](/documentation/getting_started/reference/caching)
a cachetools.LRUCache. Or a new instance of `solara.cache.Memory`, see [caching](/documentation/advanced/reference/caching)
for cache storage options.
The return value of the decorator behaves like the original function, but also has a few attributes:
Expand All @@ -230,7 +230,7 @@ def mean(df, column):
If the value is already cached, the function will not be executed in a thread.
See also the [reference on caching](/documentation/getting_started/reference/caching) for more caching details.
See also the [reference on caching](/documentation/advanced/reference/caching) for more caching details.
"""

Expand Down
2 changes: 1 addition & 1 deletion solara/components/file_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def get_data():
Note that the data will be kept in memory when downloading.
If the file is large (>10 MB), and when using [Solara server](/documentation/advanced/understanding/solara-server), we recommend using the
[static files directory](/documentation/getting_started/reference/static-files) instead.
[static files directory](/documentation/advanced/reference/static-files) instead.
"""
request_download, set_request_download = solara.use_state(False)
Expand Down
2 changes: 1 addition & 1 deletion solara/lab/components/confirmation_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def ConfirmationDialog(
):
"""A dialog used to confirm a user action.
(*Note: [This component is experimental and its API may change in the future](/documentation/getting_started/lab).*)
(*Note: [This component is experimental and its API may change in the future](/documentation/getting_started/what-is-lab).*)
By default, has a title, a text explaining the
decision to be made, and two buttons "OK" and "Cancel".
Expand Down
4 changes: 2 additions & 2 deletions solara/lab/components/tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def Tab(
):
"""An item in a Tabs component.
(*Note: [This component is experimental and its API may change in the future](/documentation/getting_started/lab).*)
(*Note: [This component is experimental and its API may change in the future](/documentation/getting_started/what-is-lab).*)
Should be a direct child of a [Tabs](/documentation/components/lab/tabs).
Expand Down Expand Up @@ -62,7 +62,7 @@ def Tabs(
):
"""A tabbed container showing one tab at a time.
(*Note: [This component is experimental and its API may change in the future](/documentation/getting_started/lab).*)
(*Note: [This component is experimental and its API may change in the future](/documentation/getting_started/what-is-lab).*)
Note that if Tabs are used as a child of the [AppBar](/documentation/components/layout/app_bar) component, the tabs
will be placed under the app bar. See our [authorization app](/apps/authorization) for an example.
Expand Down
18 changes: 9 additions & 9 deletions solara/website/pages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
"/docs/howto/debugging": "/documentation/advanced/howto/debugging",
"/docs/howto/embed": "/documentation/advanced/howto/embed",
"/docs/howto/ipywidget-libraries": "/documentation/advanced/howto/ipywidget-libraries",
"/docs/reference": "/documentation/getting_started/reference",
"/docs/reference/static-files": "/documentation/getting_started/reference/static-files",
"/docs/reference/asset-files": "/documentation/getting_started/reference/asset-files",
"/docs/reference/static-site-generation": "/documentation/getting_started/reference/static-site-generation",
"/docs/reference/search": "/documentation/getting_started/reference/search",
"/docs/reference/reloading": "/documentation/getting_started/reference/reloading",
"/docs/reference/notebook-support": "/documentation/getting_started/reference/notebook-support",
"/docs/reference/caching": "/documentation/getting_started/reference/caching",
"/docs/reference": "/documentation/advanced/reference",
"/docs/reference/static-files": "/documentation/advanced/reference/static-files",
"/docs/reference/asset-files": "/documentation/advanced/reference/asset-files",
"/docs/reference/static-site-generation": "/documentation/advanced/reference/static-site-generation",
"/docs/reference/search": "/documentation/advanced/reference/search",
"/docs/reference/reloading": "/documentation/advanced/reference/reloading",
"/docs/reference/notebook-support": "/documentation/advanced/reference/notebook-support",
"/docs/reference/caching": "/documentation/advanced/reference/caching",
"/docs/understanding": "/documentation/advanced/understanding",
"/docs/understanding/ipywidgets": "/documentation/advanced/understanding/ipywidgets",
"/docs/understanding/ipyvuetify": "/documentation/advanced/understanding/ipyvuetify",
Expand All @@ -66,7 +66,7 @@
"/docs/changelog": "/changelog",
"/docs/contact": "/contact",
"/docs/faq": "/documentation/faq",
"/docs/lab": "/documentation/getting_started/lab",
"/docs/lab": "/documentation/getting_started/what-is-lab",
"/api": "/documentation/api",
"/api/altair": "/documentation/components/viz/altair",
"/api/app_bar": "/documentation/components/layout/app_bar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ All assets files are served under `/static/assets/<filename>`, but how the asset
Putting the `assets` directory 1 level higher than the `pages` directory avoids name collision with pages.


Although the `assets` directory can be used for serving arbitrary files, we recommend using the [static files](/documentation/getting_started/reference/static-files) directory instead, to avoid name collisions.
Although the `assets` directory can be used for serving arbitrary files, we recommend using the [static files](/documentation/advanced/reference/static-files) directory instead, to avoid name collisions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: If you are using static site generation (SSG) in your Solara applic
---
# Search

Solara can provide search, if [SSG](/documentation/getting_started/reference/static-site-generation) is enabled. This allows you to add a search box to you website, which performs a full-text search to provide quick access to pages. The solara website itself uses the
Solara can provide search, if [SSG](/documentation/advanced/reference/static-site-generation) is enabled. This allows you to add a search box to you website, which performs a full-text search to provide quick access to pages. The solara website itself uses the
search feature as well in the toolbar.

## Using Solara's Search feature.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The JSON format may be subject to change.

By default, solara runs in development mode. This means, it will:

* Automatically [reload your project files](/documentation/getting_started/reference/reloading) by watching files on the filesystemn
* Automatically [reload your project files](/documentation/advanced/reference/reloading) by watching files on the filesystemn
* Load debug version of the CSS files and JavaScript files for improved error messages (which leads to larger asset files).

To disabled all of these option, pass the `--production` flag, or set the environment variable `SOLARA_MODE=production`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""Demonstrates very basic usage of Solara."""

import solara

redirect = None


@solara.component
def Page():
return solara.Markdown("Should not see me")
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Solara is actually two things.

### Solara server
[Solara server](/documentation/advanced/understanding/solara-server) renders ipywidgets in the browser in a very efficient manner and takes care of many other things
such as [routing](/documentation/advanced/understanding/routing) and [Static Site Generation](/documentation/getting_started/reference/static-site-generation).
such as [routing](/documentation/advanced/understanding/routing) and [Static Site Generation](/documentation/advanced/reference/static-site-generation).

### Solara UI

Expand All @@ -110,7 +110,7 @@ We recommend going through the documentation linearly following the arrows on th
If you want to know more about specific parts, you can go through the [How-to section](/documentation/advanced/howto) to learn more. Feel free to skip chapters, and go back to topics when you need to.


If you want to know what components or hooks are available, or want to know more about a specific component, check out the [Documentation](/documentation) which includes live code examples. Other reference documentation can be found at the [reference section](/documentation/getting_started/reference)
If you want to know what components or hooks are available, or want to know more about a specific component, check out the [Documentation](/documentation) which includes live code examples. Other reference documentation can be found at the [reference section](/documentation/advanced/reference)

If you feel like you miss some basic understanding and want to give a bit deeper into the what and why feel free to explore the [Understanding section](/documentation/advanced/understanding).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Lets modify the script a little bit, possibly in this way:
```

If we save the script, Solara will automatically reload your script and update
your browser (we call this feature [hot reloading](/documentation/getting_started/reference/reloading)).
your browser (we call this feature [hot reloading](/documentation/advanced/reference/reloading)).

Note that Solara will remember your state (e.g., the number of buttons clicked) when the app reloads.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ If you are using [Solara server](/documentation/advanced/understanding/solara-se

### Execution model
As the introduction says, Solara does not re-execute your whole script after user interactions.
The main script is executed only once. With Solara you can use your main script to read large dataframes, or do some pre-calculations without the need for [caching](/documentation/getting_started/reference/caching).
The main script is executed only once. With Solara you can use your main script to read large dataframes, or do some pre-calculations without the need for [caching](/documentation/advanced/reference/caching).

When a user navigates to a Solara server, the `Page` component (basically a function) will get executed. The `Page` component will call (lazily) new components like [solara.Markdown](/documentation/components/output/markdown) to build up the page. If state changes due to user input, Solara will trigger a cascade of re-excecutions of components which inputs or state changed, but never your whole script, nor every component.

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/autorouting_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_routes_examples_api_button():
def test_routes_examples_getting_started():
routes = solara.autorouting.generate_routes(solara.website.pages.documentation.getting_started)

assert len(routes) == 9
assert len(routes) == 8
assert routes[0].path == "/"
assert routes[0].label == "Quickstart"

Expand Down

0 comments on commit c2951b9

Please sign in to comment.