Skip to content

Commit

Permalink
Migrate from Jupyter Book to Sphinx (#5)
Browse files Browse the repository at this point in the history
* Update content

* Fix dependencies

* Migrate to Sphinx
  • Loading branch information
g4brielvs authored Sep 17, 2024
1 parent e260d47 commit ffd9eec
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 15 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to GitHub Pages
name: docs
on:
push:
branches:
Expand All @@ -12,18 +12,17 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.9
cache: "pip"
- name: Install Dependencies
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then pip install ".[docs]"; fi
- name: Build Juputer Book Documentation
- name: Build Sphinx Documentation
run: |
jupyter-book build . --config docs/_config.yml --toc docs/_toc.yml
sphinx-build docs _build/html -b html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
if: github.ref == 'refs/heads/main' && job.status == 'success'
if: job.status == 'success'
with:
path: "_build/html"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Mobilyze: Mobility Analysis
# Mobilyze: Mobility Data Analysis

![Development Status](https://img.shields.io/badge/status-in%20development-orange)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/datapartnership/mobilyze/main.svg)](https://results.pre-commit.ci/latest/github/datapartnership/mobilyze/main)
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
4 changes: 2 additions & 2 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ format: jb-book
root: README

parts:
- caption: Literature Review & Methodology
- caption: API Reference
chapters:
- file: docs/methodology
- file: api/mobilyze
- caption: Tutorials
chapters:
- file: notebooks/tessellate.ipynb
Expand Down
78 changes: 78 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
###############################################################################
# Auto-generated by `jupyter-book config`
# If you wish to continue using _config.yml, make edits to that file and
# re-generate this one.
###############################################################################
apidoc_module_dir = "../src"
author = "Development Data Group"
bibtex_bibfiles = ["bibliography.bib"]
comments_config = {"hypothesis": False, "utterances": False}
copyright = "2024"
exclude_patterns = ["**.ipynb_checkpoints", ".DS_Store", "Thumbs.db", "_build"]
extensions = [
"sphinx_togglebutton",
"sphinx_copybutton",
"myst_nb",
"jupyter_book",
"sphinx_thebe",
"sphinx_comments",
"sphinx_external_toc",
"sphinx.ext.intersphinx",
"sphinx_design",
"sphinx_book_theme",
"sphinxcontrib.bibtex",
"sphinx_jupyterbook_latex",
"sphinx.ext.napoleon",
"sphinxcontrib.apidoc",
]
external_toc_exclude_missing = False
external_toc_path = "_toc.yml"
extra_extensions = ["sphinxcontrib.apidoc"]
html_baseurl = "https://datapartnership.github.io/mobilyze"
html_favicon = "images/favicon.ico"
html_last_updated_fmt = "%b %d, %Y"
html_logo = "images/logo.png"
html_show_copyright = False
html_sourcelink_suffix = ""
html_theme = "sphinx_book_theme"
html_theme_options = {
"search_bar_text": "Search this book...",
"launch_buttons": {
"notebook_interface": "classic",
"binderhub_url": "",
"jupyterhub_url": "",
"thebe": False,
"colab_url": "",
},
"path_to_docs": "",
"repository_url": "https://github.com/datapartnership/mobilyze",
"repository_branch": "main",
"extra_footer": "",
"home_page_in_toc": False,
"announcement": "",
"use_repository_button": True,
"use_edit_page_button": True,
"use_issues_button": True,
}
html_title = ""
latex_engine = "pdflatex"
myst_enable_extensions = [
"colon_fence",
"dollarmath",
"linkify",
"substitution",
"tasklist",
]
myst_url_schemes = ["mailto", "http", "https"]
nb_execution_allow_errors = False
nb_execution_cache_path = ""
nb_execution_excludepatterns = []
nb_execution_in_temp = False
nb_execution_mode = "off"
nb_execution_timeout = 30
nb_output_stderr = "show"
numfig = True
pygments_style = "sphinx"
suppress_warnings = ["myst.domains"]
use_jupyterbook_latex = True
use_multitoc_numbering = True
1 change: 1 addition & 0 deletions docs/notebooks
6 changes: 1 addition & 5 deletions notebooks/tessellate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@
"import geopandas as gpd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"from mobilyze.tessellation import tessellate\n",
"\n",
"%load_ext autoreload\n",
"%autoreload 2\n",
"%matplotlib inline"
"from mobilyze.tessellation import tessellate"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ dynamic = ["version"]
requires-python = ">=3.8,<3.10"
dependencies = [
"bokeh",
"dask_geopandas",
"dask",
"datashader",
"h3>=3,<4",
"holoviews",
"humanize",
"mobilkit>=0.2.8",
"numpy<2",
"palettable>=3.3.3",
Expand All @@ -37,6 +37,7 @@ dependencies = [
docs = [
"docutils==0.17.1", # https://jupyterbook.org/en/stable/content/citations.html?highlight=docutils#citations-and-bibliographies
"jupyter-book>=1,<2",
"sphinxcontrib-apidoc>=0.4.0,<1",
]

[project.urls]
Expand Down

0 comments on commit ffd9eec

Please sign in to comment.