diff --git a/conda-envs/environment-dev-py37.yml b/conda-envs/environment-dev-py37.yml
index 2c6bf43a78..a8d67c9fd2 100644
--- a/conda-envs/environment-dev-py37.yml
+++ b/conda-envs/environment-dev-py37.yml
@@ -12,11 +12,13 @@ dependencies:
- numpydoc>=0.9
- pandas=0.24
- pre-commit>=2.8.0
+- pydata-sphinx-theme
- pytest-cov>=2.5
- pytest>=3.0
- python-graphviz
- python=3.7
- scipy=1.2
- sphinx-autobuild>=0.7
+- sphinx-panels
- sphinx>=1.5
- watermark
diff --git a/conda-envs/environment-dev-py38.yml b/conda-envs/environment-dev-py38.yml
index d01e58a530..ab4a774eed 100644
--- a/conda-envs/environment-dev-py38.yml
+++ b/conda-envs/environment-dev-py38.yml
@@ -10,10 +10,12 @@ dependencies:
- myst-nb
- numpydoc>=0.9
- pre-commit>=2.8.0
+- pydata-sphinx-theme
- pytest-cov>=2.5
- pytest>=3.0
- python-graphviz
- python=3.8
- sphinx-autobuild>=0.7
+- sphinx-panels
- sphinx>=1.5
- watermark
diff --git a/conda-envs/environment-dev-py39.yml b/conda-envs/environment-dev-py39.yml
index 59d093edc5..94dfb2c045 100644
--- a/conda-envs/environment-dev-py39.yml
+++ b/conda-envs/environment-dev-py39.yml
@@ -10,10 +10,12 @@ dependencies:
- myst-nb
- numpydoc>=0.9
- pre-commit>=2.8.0
+- pydata-sphinx-theme
- pytest-cov>=2.5
- pytest>=3.0
- python-graphviz
- python=3.9
- sphinx-autobuild>=0.7
+- sphinx-panels
- sphinx>=1.5
- watermark
diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html
new file mode 100644
index 0000000000..fbcc5b278e
--- /dev/null
+++ b/docs/source/_templates/layout.html
@@ -0,0 +1,26 @@
+{% extends "!layout.html" %}
+
+
+{% block docs_sidebar %}
+ {% if pagename != 'index' %}
+ {{ super() }}
+ {% endif %}
+{% endblock %}
+
+
+{% block docs_toc %}
+ {% if pagename != 'index' %}
+ {{ super() }}
+ {% endif %}
+{% endblock %}
+
+
+{% block docs_main %}
+ {% if pagename == 'index' %}
+
+ {% block body %} {% endblock %}
+
+ {% else %}
+ {{ super() }}
+ {% endif %}
+{% endblock %}
diff --git a/docs/source/_templates/navbar-version.html b/docs/source/_templates/navbar-version.html
new file mode 100644
index 0000000000..697e7527e0
--- /dev/null
+++ b/docs/source/_templates/navbar-version.html
@@ -0,0 +1 @@
+{{ version }}
diff --git a/docs/source/conf.py b/docs/source/conf.py
index be3ece6758..a65f129f19 100755
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -39,6 +39,7 @@
"matplotlib.sphinxext.plot_directive",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
+ "sphinx.ext.viewcode",
"sphinx.ext.mathjax",
"sphinx.ext.intersphinx",
"numpydoc",
@@ -48,6 +49,7 @@
"sphinx.ext.napoleon",
"gallery_generator",
"myst_nb",
+ "sphinx_panels",
]
# Don't auto-generate summary for class members.
@@ -104,7 +106,13 @@
# directories to ignore when looking for source files.
exclude_patterns = ["_build", "**.ipynb_checkpoints"]
+# myst and panels config
jupyter_execute_notebooks = "off"
+myst_heading_anchors = 3
+myst_enable_extensions = [
+ "colon_fence",
+]
+panels_add_bootstrap_css = False
# The reST default role (used for this markup: `text`) to use for all
# documents.
@@ -143,8 +151,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
-html_theme_path = ["."]
-html_theme = "semantic_sphinx"
+html_theme = "pydata_sphinx_theme"
# Theme options are theme-specific and customize the look and feel of a theme
@@ -152,17 +159,32 @@
# documentation.
html_theme_options = {
- "navbar_links": [
- ("Tutorials", "nb_tutorials/index"),
- ("Examples", "nb_examples/index"),
- ("Books + Videos", "learn"),
- ("API", "api"),
- ("Developer Guide", "developer_guide"),
- ("About PyMC3", "about"),
+ "icon_links": [
+ {
+ "name": "GitHub",
+ "url": "https://github.com/pymc-devs/pymc3",
+ "icon": "fab fa-github-square",
+ },
+ {
+ "name": "Twitter",
+ "url": "https://twitter.com/pymc_devs",
+ "icon": "fab fa-twitter-square",
+ },
],
- # "fixed_sidebar": "false",
- # "description": "Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Aesara"
+ "show_prev_next": False,
+ "navbar_start": ["navbar-logo", "navbar-version"],
+ "navbar_end": ["search-field.html", "navbar-icon-links.html"],
+ "search_bar_text": "Search...",
+ "use_edit_page_button": False, # TODO: see how to skip of fix for generated pages
+ "google_analytics_id": "UA-176578023-1",
+}
+html_context = {
+ "github_user": "pymc-devs",
+ "github_repo": "pymc3",
+ "github_version": "main",
+ "doc_path": "docs/source/",
}
+html_sidebars = {"learn": [], "**": ["sidebar-nav-bs.html", "sidebar-ethical-ads.html"]}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
@@ -202,7 +224,7 @@
# html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
-html_sidebars = {"**": ["about.html", "navigation.html", "searchbox.html"]}
+# html_sidebars = {"**": ["about.html", "navigation.html", "searchbox.html"]}
# Additional templates that should be rendered to pages, maps page names to
# template names.
@@ -330,6 +352,6 @@
# texinfo_no_detailmenu = False
-def setup(app):
- app.add_css_file("https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css")
- app.add_css_file("default.css")
+# def setup(app):
+# app.add_css_file("https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css")
+# app.add_css_file("default.css")
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 13cd1d3f05..7d74c19385 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -17,6 +17,17 @@
+.. toctree::
+ :maxdepth: 1
+ :hidden:
+
+ Tutorials
+ Examples
+ Books + Videos
+ API
+ Developer Guide
+ About PyMC3
+
.. code-block:: python
import pymc3 as pm
diff --git a/docs/source/learn.md b/docs/source/learn.md
new file mode 100644
index 0000000000..2213f81b2b
--- /dev/null
+++ b/docs/source/learn.md
@@ -0,0 +1,182 @@
+# Learn Bayesian statistics
+
+## ...with others!
+
+:::{list-table}
+:header-rows: 0
+:widths: 10 150
+
+* - {fa}`discourse,fa-2x,style=fab`
+ - [Discourse Forum](https://discourse.pymc.io/)
+
+ The PyMC3 discourse forum is a great place to ask general questions about Bayesian statistics, or more specific ones about PyMC3 usage.
+* - {fa}`meetup,fa-2x,style=fab`
+ - Conferences
+
+ PyMC3 talks have been given at a number of conferences, including [PyCon](https://us.pycon.org/),
+ [PyData](https://pydata.org/events/), and [ODSC](https://odsc.com/) events.
+* - {fa}`python,fa-2x,style=fab`
+ - [Meetup Groups](https://www.meetup.com/)
+
+ Many areas have an local Bayesian, PyData, or Stan meetup.
+:::
+
+## ...with a video!
+
+:::{list-table}
+:header-rows: 0
+:widths: 10 150
+
+* - {fa}`youtube,fa-2x,style=fab`
+ - [YouTube Playlist](https://www.youtube.com/playlist?list=PL1Ma_1DBbE82OVW8Fz_6Ts1oOeyOAiovy)
+
+ There is an actively curated playlist of PyMC3 talks on YouTube.
+* - {fa}`youtube,fa-2x,style=fab`
+ - [Advance Bayesian Modelling with PyMC3](https://github.com/junpenglao/advance-bayesian-modelling-with-PyMC3)
+
+ A two days advance workshop in May 2018 @CEAi in the Czech Republic.
+:::
+
+## ...with a book!
+
+::::{panels}
+:column: col-lg-4 col-md-4
+
+---
+:img-top: https://camo.githubusercontent.com/4a0aca82ca82efab71747d00db30f3a68de98e82/687474703a2f2f692e696d6775722e636f6d2f36444b596250622e706e673f31
+
+Bayesian Methods for Hackers
+
+*Cameron Davidson-Pilon*
+^^^^^^^^
+
+Fantastic book with many applied code examples.
+
+:::{list-table}
+:header-rows: 0
+:widths: 4 60
+
+* - [{fa}`link`][hackers source]
+ - [Github Repo][hackers source]
+* - [{fa}`link`][hackers homepage]
+ - [Project Homepage][hackers homepage]
+:::
+
+---
+:img-top: https://lh3.googleusercontent.com/qU5yWpiVSkujyCnRZhQo8cBUrW_3e_7Cx4jEs5yfpmMbEEuDnxTGOELhy2x7F7qkwFwQJ4pFYNszZhNpN1jCSdrdHsVUHtf1Mg6F8qwb3SQe1TDE=w1280
+
+Doing Bayesian Data Analysis
+
+*John Kruschke*
+^^^^^^^^
+
+Principled introduction to Bayesian data analysis.
+
+:::{list-table}
+:header-rows: 0
+:widths: 4 60
+
+* - [{fa}`link`][dbda website]
+ - [Book Website][dbda website]
+* - [{fa}`link`][dbda 1st ed nb]
+ - [PyMC3 notebooks for *first edition*][dbda 1st ed nb]
+* - [{fa}`link`][dbda 2nd ed nb]
+ - [PyMC3 notebooks for *second edition*][dbda 2nd ed nb]
+:::
+
+---
+:img-top: http://xcelab.net/rm/wp-content/uploads/2012/01/9781482253443-191x300.jpg
+
+Statistical Rethingking
+
+*Richard McElreath*
+^^^^^^^^
+
+A Bayesian Course with Examples in R and Stan.
+
+:::{list-table}
+:header-rows: 0
+:widths: 4 60
+
+* - [{fa}`link`][rethinking website]
+ - [Book Website][rethinking website]
+* - [{fa}`link`][rethinking port]
+ - [PyMC3 port of the code][rethinking port]
+:::
+
+---
+:img-top: https://raw.githubusercontent.com/aloctavodia/BAP/master/Cover.png
+
+Bayesian Analysis with Python
+
+*Osvaldo Martin*
+^^^^^^^^
+
+A great introductory book written by a maintainer of PyMC3.
+
+:::{list-table}
+:header-rows: 0
+:widths: 4 60
+
+* - [{fa}`link`][bap website]
+ - [Book Website][bap website]
+* - [{fa}`link`][bap code]
+ - [Code and errata in PyMC3][bap code]
+:::
+
+---
+:img-top: https://images-na.ssl-images-amazon.com/images/I/51K33XI2I8L._SX330_BO1,204,203,200_.jpg
+
+Bayesian Cognitive Modeling: A Practical Course
+
+*Michael Lee and Eric-Jan Wagenmakers*
+^^^^^^^^
+
+Focused on using Bayesian statistics in cognitive modeling.
+
+:::{list-table}
+:header-rows: 0
+:widths: 4 60
+
+* - [{fa}`link`][bcm website]
+ - [Book Website][bcm website]
+* - [{fa}`link`][bcm code]
+ - [PyMC3 implementation][bcm code]
+:::
+
+---
+:img-top: http://www.stat.columbia.edu/~gelman/book/bda_cover.png
+
+Bayesian Data Analysis
+
+*Andrew Gelman, John Carlin, Hal Stern, David Dunson, Aki Vehtari, and Donald Rubin*
+^^^^^^^^
+
+A comprehensive, standard, and wonderful textbook on Bayesian methods.
+
+:::{list-table}
+:header-rows: 0
+:widths: 4 60
+
+* - [{fa}`link`][bda3 website]
+ - [Book Website][bda3 website]
+* - [{fa}`link`][bda3 port]
+ - [Examples and exercises implemented in PyMC3][bda3 port]
+:::
+
+::::
+
+
+[hackers source]: https://github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
+[hackers homepage]: http://camdavidsonpilon.github.io/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/
+[dbda website]: https://sites.google.com/site/doingbayesiandataanalysis/home
+[dbda 1st ed nb]: https://github.com/aloctavodia/Doing_bayesian_data_analysis
+[dbda 2nd ed nb]: https://github.com/JWarmenhoven/DBDA-python
+[rethinking website]: http://xcelab.net/rm/statistical-rethinking/
+[rethinking port]: https://github.com/pymc-devs/resources/tree/master/Rethinking
+[bap website]: https://www.packtpub.com/big-data-and-business-intelligence/bayesian-analysis-python-second-edition
+[bap code]: https://github.com/aloctavodia/BAP
+[bcm website]: https://bayesmodels.com/
+[bcm code]: https://github.com/pymc-devs/resources/tree/master/BCM
+[bda3 website]: https://www.stat.columbia.edu/~gelman/book/
+[bda3 port]: https://github.com/pymc-devs/resources/tree/master/BDA3
diff --git a/docs/source/learn.rst b/docs/source/learn.rst
deleted file mode 100644
index 9d0d60d8bc..0000000000
--- a/docs/source/learn.rst
+++ /dev/null
@@ -1,267 +0,0 @@
-:orphan:
-
-..
- _"learn" is referenced in html_theme_options docs/source/conf.py
-
-.. title:: Learning Resources
-
-.. raw:: html
-
-
-
-
-
-
-
-
-
-
-
- The PyMC3 discourse forum is a great place to ask general questions about Bayesian statistics, or more specific ones about PyMC3 usage.
-
-
-
-
-
-
-
-
-
- PyMC3 talks have been given at a number of conferences, including
PyCon,
PyData, and
ODSC events.
-
-
-
-
-
-
-
-
-
- Many areas have an local Bayesian, PyData, or Stan meetup.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- There is an actively curated playlist of PyMC3 talks on YouTube.
-
-
-
-
-
-
-
-
-
- A two days advance workshop in May 2018 @CEAi in the Czech Republic.
-
-
-
-
-
-
-
-
-
-
-

-
-
-
-
Cameron Davidson-Pilon
-
- Fantastic book with many applied code examples.
-
-
-
-
-
-
-
-

-
-
-
-
John Kruschke
-
- Principled introduction to Bayesian data analysis.
-
-
-
-
-
-
-
-

-
-
-
-
Richard McElreath
-
- A Bayesian Course with Examples in R and Stan.
-
-
-
-
-
-
-
-

-
-
-
-
Osvaldo Martin
-
- A great introductory book written by a maintainer of PyMC3.
-
-
-
-
-
-
-
-

-
-
-
-
Michael Lee and Eric-Jan Wagenmakers
-
- Focused on using Bayesian statistics in cognitive modeling.
-
-
-
-
-
-
-
-

-
-
-
-
Andrew Gelman, John Carlin, Hal Stern, David Dunson, Aki Vehtari, and Donald Rubin
-
- A comprehensive, standard, and wonderful textbook on Bayesian methods.
-
-
-
-
-
-
diff --git a/docs/source/sphinxext/gallery_generator.py b/docs/source/sphinxext/gallery_generator.py
index caf4beb450..0112ba8e93 100644
--- a/docs/source/sphinxext/gallery_generator.py
+++ b/docs/source/sphinxext/gallery_generator.py
@@ -30,11 +30,12 @@
.. _{sphinx_tag}:
-.. title:: {gallery}_notebooks
+#################################
+{Gallery} Notebooks
+#################################
.. raw:: html
-
"""
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 483625d741..cd4e4fd9fe 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -6,8 +6,10 @@ ipython>=7.16
myst-nb
numpydoc>=0.9
pre-commit>=2.8.0
+pydata-sphinx-theme
pytest-cov>=2.5
pytest>=3.0
sphinx-autobuild>=0.7
+sphinx-panels
sphinx>=1.5
watermark