Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated docs for improved css #196

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions doc_src/docs/0.2.x to 0.3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,40 @@ This made it challenging to distinguish when a Tier did or did not have a Notebo
In version `0.3.x` `TierBase` has been split into `NotebookTierBase` and `FolderTierBase`. Depending if your Tier has a Notebook or just a folder
associated with it, you should use the new baseclass.

## Home has no Notebook

In versions prior to `0.3.x` the `Home` tier had a notebook associated with it. This was in part because these used the `ipygui` and the `Home` header acted a bit like the Cassini Browser. If you require a `Home` notebook, you should create a custom subclass of the existing `Home` class.

For example:

```python
from cassini import Project, NotebookTierBase, WorkPackage, Experiment, Sample, DataSet

class MyHome(NotebookTierBase):
pretty_type = "Home"

@property
def name(self):
return self.pretty_type

@property
def folder(self):
return self.project.project_folder / (self.child_cls.pretty_type + "s")

@property
def file(self):
return self.project.project_folder / 'Home.ipynb'

@property
def meta_file(self): # notebook tiers _have_ to have meta and highlights now.
return self.project.project_folder / 'home-meta.json'

@property
def highlights_file(self):
return self.project.project_folder / 'home-hlts.json'

project = Project(hierarchy=[MyHome, WorkPackage, Experiment, Sample, DataSet], project_folder=__file__)

if __name__ == '__main__':
project.launch()
```
6 changes: 6 additions & 0 deletions doc_src/docs/contributing/jupyter_cassini.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,9 @@ React components can be used. Ideally these should be function components. React
Generally React components should not take models as props.

React components will need to be wrapped in Lumino ReactWidgets. These should act as a go-between for the model and the React Component. They should provide handlers that can update the model, and render() should provide the appropriate properties of the model to pass to the React Component as props.

## Open API Spec

To ensure the `jupyter_cassini_server` API is synchronised with the frontend, we use an [Open API specification](https://learn.openapis.org/introduction.html), found in `openapi.yaml`, to define the requests and responses the server uses. We then use [Data Model Code Generator](https://koxudaxi.github.io/datamodel-code-generator/) and [Open API Typescript](https://openapi-ts.dev/introduction) to automatically generate both pydantic models (server-side) and typescript types (browser-side) to strictly check the contents of requests and responses against this schema.

When making changes to the API, make these first to the `openapi.yaml` file, then you can re-build the schema using `jlpm build-schema`.
4 changes: 3 additions & 1 deletion doc_src/docs/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,6 @@ You will notice that all meta values are optional, this is a requirement of Cass

## Extensions

If you've come up with a great set of customizations, you might want to turn them into [an extension](./extensions/development.md).
If you've come up with a great set of customizations, you might want to turn them into [an extension](./extensions/development.md).

[Next](./extensions/development.md){ .md-button }
9 changes: 7 additions & 2 deletions doc_src/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ This will setup Cassini and launch Jupyter Lab, with your new project configured

In Jupyter Lab, open the launcher, scroll to the Cassini section and open the browser.

Create your first WorkPackage by clicking the little plus button in the empty table.
![browser button](./static/cassini-launcher.png){ width="100px" }

Create your first WorkPackage by clicking the little plus (<svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24" data-icon="ui-components:add" class=""><g xmlns="http://www.w3.org/2000/svg" class="jp-icon3" fill="#616161"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path></g></svg>
) button in the empty table.

## What Next

Expand All @@ -55,7 +58,9 @@ A walkthrough of Cassini's features can be found here:
<i> - Note these binder notebooks can take a while to launch, so maybe click then go grab a cup off tea/ coffee!</i>
</div>

Don't want to wait/ prefer reading? - head to the [User Guide](./user-guide/installation-setup.md).
Don't want to wait/ prefer reading? - head to the [Tutorial](./user-guide/installation-setup.md).

[Next](./user-guide/installation-setup.md){ .md-button align=right }



Binary file modified doc_src/docs/static/WP1-content.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc_src/docs/static/browser-panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc_src/docs/static/new-child-custom-template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc_src/docs/static/new-child-dialogue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions doc_src/docs/user-guide/creating-tiers.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To add a new `WorkPackage` to `Home`, click the plus button in the Tier Table:

This will open the New Child Dialogue:

![]("../static/new-child-dialogue.png"){ width="300px" }
![](../static/new-child-dialogue.png){ width="300px" }

### New Child Dialogue Fields

Expand Down Expand Up @@ -101,6 +101,6 @@ The navigator is there to help you look around your project, but the hard work o
!!!Note
`DataSets` don't have notebooks, they're just folders for you to put data in. Clicking open will open your file explorer at the `DataSet`'s directory - this is incredibly useful for pasting in data!

Next learn how to use cassini within a notebook
Next learn how to use cassini within a notebook.

[Next](within-the-notebook.md){ .md-button align=right }
2 changes: 1 addition & 1 deletion doc_src/docs/user-guide/meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ When values have been set, you can access them python-side with:
'value'
```

Validation of meta-values is provided by Pydantic. More advanced serialisation and deserialisation can be achieved using `MetaAttr`.
Validation of meta-values is provided by Pydantic. More advanced serialisation and deserialisation can be achieved using [`MetaAttr`](../customization.md#meta-attributes-metaattr).

## In the Cassini Browser

Expand Down
Loading