Source for napari.org website.
The documentation is built using jupyter-book
and various other Python dependencies. You'll need to run the following:
# it is recommended you do this within a virtual environment
pip install -r requirements.txt
The napari theme is built with React and bundled with Next.js using the Static HTML Export. feature.
You will need to setup Node.js and Yarn to work with the theme and run the dev server:
# Install and use Node.js version defined in .nvmrc
nvm install && nvm use
# Install yarn for installing dependencies
npm install -g yarn
# Install dependencies
yarn
Running the book in dev mode runs a custom development server that is a thin
wrapper over next
and jupyter-book
. To run the docs in development mode,
run:
yarn dev
After the build is complete, you should be able to access the documentation at http://localhost:8080.
To build the book for production, run:
yarn build
A fully-rendered HTML version of the book will be built in dist/
.
- Make a copy of the
template-page.ipynb
notebook and add your new tutorial content. - Add a line to the table of contents
_toc.yml
to point to your new tutorial. - Run
yarn dev
to view your changes locally. - Open a pull request to the napari/napari.github.io repository
The html version of the book is hosted on the gh-pages
branch of this repo. A GitHub actions workflow has been created that automatically builds and pushes the book to this branch on a push or pull request to main.
If you wish to disable this automation, you may remove the GitHub actions workflow and build the book manually by:
- Navigating to your local build; and running,
ghp-import -n -p -f dist/ --cname="napari.org"
This will automatically push your build to the gh-pages
branch. More information on this hosting process can be found here.
We welcome and recognize all contributions. You can see a list of current contributors in the contributors tab.
This project is created using the excellent open source Jupyter Book project and the executablebooks/cookiecutter-jupyter-book template.