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

DOC Add versions and use pydata theme #173

Merged
merged 18 commits into from
Jun 2, 2022
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
16 changes: 16 additions & 0 deletions doc/_static/version_switcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"name": "dev",
"version": "0.11.0.dev0",
"url": "https://jni.github.io/skan/dev"
},
{
"name": "0.10.x (stable)",
"version": "0.10.x",
"url": "https://jni.github.io/skan/stable"
},
{
"version": "0.9.x",
"url": "https://jni.github.io/skan/0.9.x"
}
]
35 changes: 17 additions & 18 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# Add the local code to the Python path, so docs are generated for
# current working copy
import os
import re
import sys

rundir = os.path.dirname(__file__)
Expand Down Expand Up @@ -104,20 +105,33 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

html_theme = 'sphinx_material'
html_theme = 'pydata_sphinx_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#

html_theme = 'sphinx_material'
# Version match must match the 'version' key in version_swticher.json
pattern = re.compile(r'^[0-9]+\.[0-9]+')
version_match = pattern.search(version)
if version_match:
version_match = version_match.group() + ".x"
elif 'dev' in version:
version_match = "dev"
else:
version_match = version

# Material theme options (see theme.conf for more information)
html_theme_options = {
# Set the name of the project to appear in the navigation.
'nav_title': 'Skan 🦴📏',

# pydata theme version switcher config
'navbar_end': ['version-switcher', 'navbar-icon-links'],
'switcher': {
'json_url': 'https://jni.github.io/skan/dev/_static/version_switcher.json',
'version_match': version_match,
},
# Set you GA account ID to enable tracking
# 'google_analytics_account': 'UA-XXXXX',

Expand All @@ -133,28 +147,13 @@
'repo_url': 'https://github.com/jni/skan/',
'repo_name': 'Skan',

# Visible levels of the global TOC; -1 means unlimited
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may be from alabaster theme

'globaltoc_depth': 1,
# If False, expand all TOC entries
'globaltoc_collapse': False,
# If True, show hidden TOC entries
'globaltoc_includehidden': False,
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
"**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
}

# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions doc/examples/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
========
Examples
========

skan examples.


.. toctree::
:maxdepth: 1

complete_analysis
sholl_analysis
visualizing_3d_skeletons
2 changes: 1 addition & 1 deletion doc/sholl_analysis.md → doc/examples/sholl_analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import matplotlib.pyplot as plt
import numpy as np
import zarr

neuron = np.asarray(zarr.open('example-data/neuron.zarr.zip'))
neuron = np.asarray(zarr.open('../example-data/neuron.zarr.zip'))

fig, ax = plt.subplots()
ax.imshow(neuron, cmap='gray')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ First, we load the images. These images were produced by an FEI scanning electro
from glob import glob
import imageio as iio

files = glob('example-data/*.tif')
files = glob('../example-data/*.tif')
image0 = iio.imread(files[0], format='fei')
```

Expand Down
12 changes: 12 additions & 0 deletions doc/getting_started/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
===============
Getting started
===============

Getting started with skan.


.. toctree::
:maxdepth: 1

install
getting_started
File renamed without changes.
15 changes: 5 additions & 10 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,13 @@ Skeleton analysis with Skan 🦴📏
Skan is a pure Python library to analyse skeleton images.

.. toctree::
:maxdepth: 1
:maxdepth: 3

install
getting_started
gui
complete_analysis
visualizing_3d_skeletons
sholl_analysis
faq
citing
getting_started/index
examples/index
api/api
release-notes/index
gui
Miscellaneous <misc/index>


Indices and tables
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions doc/misc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
=============
Miscellaneous
=============

FAQ, release notes and how to cite skan.

.. toctree::
:maxdepth: 3

faq
release-notes/index
citing
File renamed without changes.
2 changes: 1 addition & 1 deletion requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ tqdm>=4.11
nb2plots>=0.5
sphinxcontrib-bibtex
sphinx<2
sphinx_rtd_theme
pydata-sphinx-theme>=0.8.1
lucyleeow marked this conversation as resolved.
Show resolved Hide resolved
seaborn>=0.9
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@ docs =
sphinxcontrib-bibtex
myst-nb
zarr
pydata-sphinx-theme>=0.8.1