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

Api docs #700

Merged
merged 3 commits into from
Dec 1, 2023
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ venv.bak/
docs/jupyterlite/.cache/
docs/jupyterlite/.jupyterlite.doit.db
docs/jupyterlite/_output/

# autodoc2 generated
docs/apidocs
Binary file added docs/_static/favicon/android-chrome-192x192.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 added docs/_static/favicon/android-chrome-512x512.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 added docs/_static/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/_static/favicon/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>
Binary file added docs/_static/favicon/favicon-16x16.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 added docs/_static/favicon/favicon-32x32.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 added docs/_static/favicon/favicon.ico
Binary file not shown.
Binary file added docs/_static/favicon/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions docs/_static/favicon/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
Binary file added docs/_static/itkwidgets_logo.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 added docs/_static/itkwidgets_logo_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion docs/advanced.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Advanced
----------

## Returning Values

Expand Down
50 changes: 47 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
import subprocess
import os
import re
from datetime import date

# -- Project information -----------------------------------------------------

project = 'itkwidgets'
copyright = '2023, NumFOCUS'
author = 'Matthew McCormick'
copyright = f'{date.today().year}, NumFOCUS'
author = 'Insight Software Consortium'

# The full version, including alpha/beta/rc tags.
release = re.sub('^v', '', os.popen('git tag --list "v1.0*" --sort=creatordate').readlines()[-1].strip())
Expand All @@ -36,7 +38,37 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['myst_parser',]
extensions = [
'sphinx.ext.autosummary',
'autodoc2',
'myst_parser',
'sphinx_copybutton',
'sphinx.ext.intersphinx',
'sphinxext.opengraph',
'sphinx_design',
]

autodoc2_packages = [
{
"path": "../itkwidgets",
"exclude_files": [],
},
]
autodoc2_render_plugin = "myst"

myst_enable_extensions = [
"colon_fence",
"dollarmath", # Support syntax for inline and block math using `$...$` and `$$...$$`
# (see https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#dollar-delimited-math)
"fieldlist",
"linkify", # convert bare links to hyperlinks
]

intersphinx_mapping = {
"itkwasm": ("https://wasm.itk.org/en/latest/", None),
"python": ("https://docs.python.org/3/", None),
"numpy": ("https://numpy.org/doc/stable", None),
}

html_theme_options = dict(
github_url='https://github.com/InsightSoftwareConsortium/itkwidgets',
Expand All @@ -59,7 +91,19 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'pydata_sphinx_theme'
html_theme = 'furo'
html_logo = "_static/itkwidgets_logo_small.png"
html_favicon = "_static/favicon/favicon.ico"
html_title = f"{project}'s documentation"

# Furo options
html_theme_options = {
"top_of_page_button": "edit",
"source_repository": "https://github.com/InsightSoftwareConsortium/itkwidgets/",
"source_branch": "main",
"source_directory": "docs",
}


# 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,
Expand Down
27 changes: 22 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,26 @@ Try it with JupyterLite!
</a>

```{toctree}
quick_start_guide.rst
deployments.rst
integrations.rst
development.rst
advanced.rst
:maxdepth: 4
:caption: 📖 Learn

quick_start_guide
deployments
integrations
advanced
```

```{toctree}
:maxdepth: 3
:caption: 📖 Reference

apidocs/index.rst
```

```{toctree}
:maxdepth: 2
:caption: 🔨 Contribute

development
Code of Conduct <https://docs.itk.org/en/latest/contributing/code_of_conduct.html>
```
6 changes: 3 additions & 3 deletions docs/quick_start_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ cd itkwidgets/examples

### Notebook

In Jupyter, import the view function:
In Jupyter, import the {py:obj}`view <itkwidgets.viewer.view>` function:

```python
from itkwidgets import view
```

Then, call the view function at the end of a cell, passing in the image to examine:
Then, call the {py:obj}`view <itkwidgets.viewer.view>` function at the end of a cell, passing in the image to examine:

```python
view(image)
```

For information on additional options, see the view function docstring:
For information on additional options, see the {py:obj}`view <itkwidgets.viewer.view>` function docstring:

```python
view?
Expand Down
9 changes: 7 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
furo
imjoy_jupyterlab_extension
pydata-sphinx-theme
myst-parser
jupyterlite[all]==0.1.0b17
myst-parser[linkify]
pydata-sphinx-theme
sphinx-autodoc2>=0.5.0
sphinx-copybutton
sphinx-design
sphinxext-opengraph
Loading