-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation with Jupyterlite demo (#8)
* Add a first documentation * prettier * Add nodejs dependency for rtd installation * Typo * update documentation and jupyterlite-sphinx directive options * Update jupyterlite-sphinx * use mamba for readthedoc installation, to be able to use xeus-python-kernel * Fix environment file * Remove sphinx makefile, and adds hatch script for docs * Update jupyterlite-sphinx dependency
- Loading branch information
Showing
6 changed files
with
108 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: 2 | ||
|
||
build: | ||
os: "ubuntu-22.04" | ||
tools: | ||
python: "mambaforge-4.10" | ||
nodejs: "18" | ||
|
||
sphinx: | ||
builder: html | ||
configuration: docs/conf.py | ||
|
||
conda: | ||
environment: docs-environment.yml |
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,8 @@ | ||
name: litegitpuller-docs | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- pip | ||
- jupyterlite-xeus-python >=0.9.0,<0.10.0 | ||
- pip: | ||
- .[docs] |
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,25 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
|
||
project = 'litegitpuller' | ||
copyright = '2023, Jupyter Development Team' | ||
author = 'Jupyter Development Team' | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
extensions = [ | ||
'jupyterlite_sphinx', | ||
'myst_parser', | ||
] | ||
|
||
templates_path = ['_templates'] | ||
exclude_patterns = [] | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = 'pydata_sphinx_theme' | ||
html_static_path = ['_static'] | ||
|
||
jupyterlite_bind_ipynb_suffix = False |
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,39 @@ | ||
# litegitpuller | ||
|
||
A Jupyterlab/jupyterlite extension to fetch github repositories. | ||
|
||
As for [nbgitpuller](https://github.com/jupyterhub/nbgitpuller), information about the repository to fetch has to be set in the URL. | ||
|
||
```{eval-rst} | ||
.. jupyterlite:: | ||
:width: 100% | ||
:height: 600px | ||
:prompt: Try JupyterLite! | ||
:prompt_color: #00aa42 | ||
:search_params: ["branch", "repo", "urlpath"] | ||
``` | ||
|
||
## Parameters | ||
|
||
The parameters to provide must be formatted as in `nbgitpuller`.\ | ||
They can be generated with [nbgitpuller link generator](https://nbgitpuller.readthedocs.io/en/latest/link.html). | ||
|
||
Currently the allowed parameters are: | ||
|
||
- `repo`: the github repository to fetch | ||
- `branch`: the branch of the repository to fetch | ||
- `urlpath`: the path to a notebook file to open (relative to the root of the repository). | ||
|
||
## Limitations | ||
|
||
Fetching a repository uses the unauthenticated Github API to fetch each file, with a capacity of 60 files per hour | ||
see [github API](https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limits-for-requests-from-personal-accounts). | ||
|
||
Do not expect to fetch a large repository with it. | ||
|
||
## Try it | ||
|
||
It can be tried with the current documentation, by providing parameters in the current URL of the documentation. | ||
|
||
As an example the following URL will reload the current page with some repo parameters:\ | ||
<https://litegitpuller.readthedocs.io/en/latest/index.html?repo=https%3A%2F%2Fgithub.com%2Fbrichet%2Ftesting-repo&urlpath=tree%2Ftesting-repo%2Fnotebooks%2Fsimple.ipynb&branch=main> |
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