Skip to content

Commit

Permalink
refactor: Uniting API, Docs, and Examples under Documentation on sola…
Browse files Browse the repository at this point in the history
…ra.dev (#421)

refactor: United API, Examples, and Docs under Documentation page
  • Loading branch information
iisakkirotko committed Mar 21, 2024
1 parent e625f83 commit fd2aff9
Show file tree
Hide file tree
Showing 271 changed files with 1,332 additions and 757 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

This is the old changelog, check the [Solara website](https://solara.dev/docs/changelog) for the up to date changelog.
This is the old changelog, check the [Solara website](https://solara.dev/changelog) for the up to date changelog.

## Changelog for solara v1.22

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Please go to https://solara.dev/docs/howto/contribute for more information.
Please go to https://solara.dev/documentation/advanced/development/contribute for more information.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Run:
pip install solara
```

Or follow the [Installation instructions](https://solara.dev/docs/installing) for more detailed instructions.
Or follow the [Installation instructions](https://solara.dev/documentation/getting_started/installing) for more detailed instructions.

## First script

Expand Down Expand Up @@ -73,7 +73,7 @@ Solara server is starting at http://localhost:8765
Or copy-paste this to a Jupyter notebook cell and execute it (the `Page()` expression at the end
will cause it to automatically render the component in the notebook).

See this snippet run live at https://solara.dev/docs/quickstart
See this snippet run live at https://solara.dev/documentation/getting_started

## Demo

Expand All @@ -100,7 +100,7 @@ By building on top of ipywidgets, we automatically leverage an existing ecosyste

Visit our main website or jump directly to the introduction

[![Introduction](https://dabuttonfactory.com/button.png?t=Introduction&f=Open+Sans-Bold&ts=20&tc=fff&hp=45&vp=12&c=8&bgt=unicolored&bgc=f19f41)](https://solara.dev/docs)
[![Quickstart](https://dabuttonfactory.com/button.png?t=Quickstart&f=Open+Sans-Bold&ts=20&tc=fff&hp=45&vp=12&c=8&bgt=unicolored&bgc=f19f41)](https://solara.dev/docs/quickstart)
[![Introduction](https://dabuttonfactory.com/button.png?t=Introduction&f=Open+Sans-Bold&ts=20&tc=fff&hp=45&vp=12&c=8&bgt=unicolored&bgc=f19f41)](https://solara.dev/documentation)
[![Quickstart](https://dabuttonfactory.com/button.png?t=Quickstart&f=Open+Sans-Bold&ts=20&tc=fff&hp=45&vp=12&c=8&bgt=unicolored&bgc=f19f41)](https://solara.dev/documentation/getting_started)

*Note that the solara.dev website is created using Solara*
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def Page():
solara.Button("Logout", icon_name="mdi-logout", href=auth.get_logout_url())
```
Note that a common use case is to put the avatar in the [AppBar](/api/app_bar).
Note that a common use case is to put the avatar in the [AppBar](/documentation/components/layout/app_bar).
```solara
import solara
from solara_enterprise import auth
Expand Down
8 changes: 4 additions & 4 deletions solara/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ def display(*objs, **kwargs):
However, if you require callback functions, use the specific Solara components, e.g.:
* [Plotly](/api/plotly)
* [Altair](/api/altair)
* [Matplotlib](/api/matplotlib)
* [Dataframe](/api/dataframe)
* [Plotly](/documentation/components/viz/plotly)
* [Altair](/documentation/components/viz/altair)
* [Matplotlib](/documentation/components/viz/matplotlib)
* [Dataframe](/documentation/components/data/dataframe)
```solara
import solara
Expand Down
2 changes: 1 addition & 1 deletion solara/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def deploy():

time.sleep(1)
rprint("Want your app to run instantly on awesomeapp-mystartup-gh.solara.run?")
rprint("\tCheck out https://solara.dev/docs/deploying/cloud-hosted")
rprint("\tCheck out https://solara.dev/documentation/getting_started/deploying/cloud-hosted")


@cli.command()
Expand Down
4 changes: 2 additions & 2 deletions solara/autorouting.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def generate_routes(module: ModuleType) -> List[solara.Route]:
files are not Python modules.
See [our multipage guide](/docs/howto/multipage#as-a-package) for more details.
See [our multipage guide](/documentation/advanced/howto/multipage#as-a-package) for more details.
"""
Expand Down Expand Up @@ -474,7 +474,7 @@ def generate_routes_directory(path: Path) -> List[solara.Route]:
Python files ending in .py, or Jupyter notebooks ending in .ipynb
will be executed and its `Page` component will be rendered.
Automatic titles will be [generated as explained in the multipage guide](/docs/howto/multipage).
Automatic titles will be [generated as explained in the multipage guide](/documentation/advanced/howto/multipage).
"""

Expand Down
4 changes: 2 additions & 2 deletions solara/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,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](/docs/reference/caching)
a cachetools.LRUCache. Or a new instance of `solara.cache.Memory`, see [caching](/documentation/getting_started/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 @@ -233,7 +233,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](/docs/reference/caching) for more caching details.
See also the [reference on caching](/documentation/getting_started/reference/caching) for more caching details.
"""

Expand Down
2 changes: 1 addition & 1 deletion solara/checks.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
const div = document.createElement("div")
const div2 = document.createElement("div")
div.innerHTML = `Run <code>${jupyter_python_executable} -m pip install ${needsInstall.join(" ")}</code>. Refresh the page after installation.`
div2.innerHTML = `Visit <a href="https://solara.dev/docs/troubleshoot" target="_blank">https://solara/dev/docs/troubleshoot</a> for more information.`
div2.innerHTML = `Visit <a href="https://solara.dev/documentation/getting_started/troubleshoot" target="_blank">https://solara/dev/documentation/getting_started/troubleshoot</a> for more information.`
rootEl.appendChild(div)
rootEl.appendChild(div2)
}
Expand Down
10 changes: 5 additions & 5 deletions solara/components/applayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def AppBar(children=[]):
This component does not need to be a direct child of the AppLayout, it can be at any level in your component tree.
If a [Tabs](/api/tabs) component is used as direct child of the app bar, it will be shown under the app bar.
If a [Tabs](/documentation/components/lab/tabs) component is used as direct child of the app bar, it will be shown under the app bar.
## Example showing an app bar
```solara
Expand Down Expand Up @@ -204,11 +204,11 @@ def AppLayout(
):
"""The default layout for Solara apps. It consists of an toolbar bar, a sidebar and a main content area.
* The title of the app is set using the [Title](/api/title) component.
* The sidebar content is set using the [Sidebar](/api/sidebar) component.
* The title of the app is set using the [Title](/documentation/components/page/title) component.
* The sidebar content is set using the [Sidebar](/documentation/components/layout/sidebar) component.
* The content is set by the `Page` component provided by the user.
This component is usually not used directly, but rather through via the [Layout system](/docs/howto/layout).
This component is usually not used directly, but rather through via the [Layout system](/documentation/advanced/howto/layout).
The sidebar is only added when the AppLayout has more than one child.
Expand All @@ -224,7 +224,7 @@ def AppLayout(
* `children`: The children of the AppLayout. The first child is used as the sidebar content, the rest as the main content.
* `sidebar_open`: Whether the sidebar is open or not.
* `title`: The title of the app shown in the app bar, can also be set using the [Title](/api/title) component.
* `title`: The title of the app shown in the app bar, can also be set using the [Title](/documentation/components/page/title) component.
* `toolbar_dark`: Whether the toolbar should be dark or not.
* `navigation`: Whether the navigation tabs based on routing should be shown.
* `color`: The color of the toolbar.
Expand Down
8 changes: 4 additions & 4 deletions solara/components/button.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from typing import Callable, Dict, List, Optional, Union

from reacton import ipyvue
from reacton import ipyvuetify as v

import solara
import solara.util
from reacton import ipyvue
from reacton import ipyvuetify as v


@solara.component
Expand Down Expand Up @@ -51,7 +50,8 @@ def Page():
- `disabled`: Whether the button is disabled.
- `text`: Whether the button should be displayed as text, it has no shadow and no background.
- `outlined`: Whether the button should be displayed as outlined, it has no background.
- `value`: (Optional) When used as a child of a ToggleButtons component, the value of the selected button, see [ToggleButtons](/api/togglebuttons).
- `value`: (Optional) When used as a child of a ToggleButtons component, the value of the selected button, see
[ToggleButtons](/documentation/components/input/togglebuttons).
- `classes`: Additional CSS classes to apply.
- `style`: CSS style to apply.
Expand Down
3 changes: 1 addition & 2 deletions solara/components/card.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Dict, List, Optional, Union

import reacton.ipyvuetify as v

import solara
from solara.util import _combine_classes

Expand Down Expand Up @@ -79,7 +78,7 @@ def Page():
def CardActions(children: List[solara.Element] = []):
"""Container for actions in a card.
See [Card](/api/card) for an example.
See [Card](/documentation/components/layout/card) for an example.
# Arguments
Expand Down
2 changes: 1 addition & 1 deletion solara/components/component_vue.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def component_vue(vue_path: str, vuetify=True) -> Callable[[Callable[P, None]],
[See the vue v2 api](https://v2.vuejs.org/v2/api/) for more information on how to use Vue, like `watch`,
`methods` and lifecycle hooks such as `mounted` and `destroyed`.
See the [Vue component example](/examples/general/vue_component) for an example of how to use this decorator.
See the [Vue component example](/documentation/examples/general/vue_component) for an example of how to use this decorator.
## Arguments
Expand Down
13 changes: 6 additions & 7 deletions solara/components/cross_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

import ipyvuetify
import reacton.ipyvuetify as v
import traitlets

import solara
import traitlets
from solara import CellAction, ColumnAction

from ..lab.hooks.dataframe import use_df_column_names
Expand Down Expand Up @@ -55,7 +54,7 @@ def CrossFilterSelect(
):
"""A Select widget that will cross filter a DataFrame.
See [use_cross_filter](/api/use_cross_filter) for more information about how to use cross filtering.
See [use_cross_filter](/documentation/api/hooks/use_cross_filter) for more information about how to use cross filtering.
## Arguments
Expand Down Expand Up @@ -170,7 +169,7 @@ def CrossFilterReport(df, classes: List[str] = []):
Shows number of rows filtered, and the total number of rows.
See [use_cross_filter](/api/use_cross_filter) for more information about how to use cross filtering.
See [use_cross_filter](/documentation/api/hooks/use_cross_filter) for more information about how to use cross filtering.
## Arguments
Expand Down Expand Up @@ -214,7 +213,7 @@ def CrossFilterSlider(
):
"""A Slider widget that will cross filter a DataFrame.
See [use_cross_filter](/api/use_cross_filter) for more information about how to use cross filtering.
See [use_cross_filter](/documentation/api/hooks/use_cross_filter) for more information about how to use cross filtering.
## Arguments
Expand Down Expand Up @@ -318,9 +317,9 @@ def update_filter():
def CrossFilterDataFrame(df, items_per_page=20, column_actions: List[ColumnAction] = [], cell_actions: List[CellAction] = [], scrollable=False):
"""Display a DataFrame with filters applied from the cross filter.
This component wraps [DataFrame](/api/dataframe).
This component wraps [DataFrame](/documentation/components/data/dataframe).
See [use_cross_filter](/api/use_cross_filter) for more information about how to use cross filtering.
See [use_cross_filter](/documentation/api/hooks/use_cross_filter) for more information about how to use cross filtering.
# Arguments
Expand Down
5 changes: 2 additions & 3 deletions solara/components/datatable.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@

import ipyvuetify as v
import ipywidgets
import traitlets

import solara
import solara.hooks.dataframe
import solara.lab
import traitlets
from solara.lab.hooks.dataframe import use_df_column_names
from solara.lab.utils.dataframe import df_type

Expand Down Expand Up @@ -208,7 +207,7 @@ def Page():
* `cell_actions` - Triggered via clicking on the triple dot icon in the cell (visible when hovering).
* `on_column_header_hover` - Optional callback when the user hovers over the triple dot icon on a header.
* `column_header_info` - Element to display in the column menu popup (visible when hovering), provide an
empty container element (like [Column](/api/column)) to force showing the trigle dot icon (see example).
empty container element (like [Column](/documentation/components/layout/column)) to force showing the trigle dot icon (see example).
"""
return DataTable(
Expand Down
2 changes: 1 addition & 1 deletion solara/components/figure_altair.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def FigureAltair(
):
"""Renders an Altair chart using VegaLite.
See also [our altair example](/examples/libraries/altair).
See also [our altair example](/documentation/examples/libraries/altair).
## Arguments
Expand Down
4 changes: 2 additions & 2 deletions solara/components/file_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ def get_data():
## Note on file size
Note that the data will be kept in memory when downloading.
If the file is large (>10 MB), and when using [Solara server](/docs/understanding), we recommend using the
[static files directory](/docs/reference/static-files) instead.
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.
"""
request_download, set_request_download = solara.use_state(False)
Expand Down
3 changes: 1 addition & 2 deletions solara/components/head.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from typing import List

import reacton

import solara


@reacton.component
def Head(children: List[reacton.core.Element] = []):
"""A component that manager the "head" tag of the page to avoid duplicate tags, such as titles.
Currently only supports the [title](/api/title) tag as child, e.g.:
Currently only supports the [title](/documentation/components/page/title) tag as child, e.g.:
```python
import solara
Expand Down
5 changes: 2 additions & 3 deletions solara/components/head_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import ipyvuetify as vy
import reacton.core
import traitlets

import solara
import traitlets


class HeadTagWidget(vy.VuetifyTemplate):
Expand All @@ -19,7 +18,7 @@ class HeadTagWidget(vy.VuetifyTemplate):
def HeadTag(tagname: str, key=None, attributes: Optional[dict] = None):
"""Add a child element to head element, or replace a meta tag with the same tagname and key.
This component should be used inside a [Head](/api/head) component, e.g.:
This component should be used inside a [Head](/documentation/components/page/head) component, e.g.:
```python
import solara
Expand Down
7 changes: 3 additions & 4 deletions solara/components/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import ipyvue as vue
import reacton.ipyvue as vuer

import solara


Expand All @@ -18,8 +17,8 @@ def Link(
See also:
* [Multipage](/docs/howto/multipage).
* [Understanding Routing](/docs/understanding/routing).
* [Multipage](/documentation/advanced/howto/multipage).
* [Understanding Routing](/documentation/advanced/understanding/routing).
Most common usage is in combination with a button, e.g.:
Expand All @@ -32,7 +31,7 @@ def Link(
## Arguments
* path_or_route: the path or route to navigate to. Paths should be absolute, e.g. '/fruit/banana'.
If a route is given, [`resolve_path`](/api/resolve_path)] will be used to resolve to the absolute path.
If a route is given, [`resolve_path`](/documentation/api/routing/resolve_path)] will be used to resolve to the absolute path.
* children: the children of the link. If a child is clicked, the link will be followed.
* nofollow: If True, the link will not be followed by web crawlers (such as google).
* style: CSS styles to apply to the HTML link element. Either a string or a dictionary.
Expand Down
2 changes: 1 addition & 1 deletion solara/components/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
def Meta(name: Optional[str] = None, property: Optional[str] = None, content: Optional[str] = None):
"""Add a meta tag to the head element, or replace a meta tag with the same name and or property.
This component should be used inside a [Head](/api/head) component, e.g.:
This component should be used inside a [Head](/documentation/components/page/head) component, e.g.:
```python
import solara
Expand Down

0 comments on commit fd2aff9

Please sign in to comment.