Skip to content

Commit 0415051

Browse files
committed
improve appearance
1 parent 183f3b8 commit 0415051

File tree

11 files changed

+114
-26
lines changed

11 files changed

+114
-26
lines changed
File renamed without changes.

_static/PyMC.png

68 KB
Loading

_static/binder.svg

Lines changed: 1 addition & 0 deletions
Loading

_static/colab.svg

Lines changed: 1 addition & 0 deletions
Loading

_static/github.svg

Lines changed: 1 addition & 0 deletions
Loading

_templates/page.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{%- extends "layout.html" %}
2+
{% block body %}
3+
<!-- Add github/binder/colab badges here? or on the sidebar better? -->
4+
{% if pagename in ablog %}
5+
6+
{% set gh_basepath = github_user + '/' + github_repo + '/blob/' + github_version + '/' %}
7+
{% set gh_binder = github_user + '/' + github_repo + '/' + github_version %}
8+
{% set doc_path_aux = doc_path | trim('/') %}
9+
{% set file_path = doc_path_aux + '/' + pagename + page_source_suffix %}
10+
11+
<div class="sd-text-right">
12+
<p>
13+
<a href="{{ github_url + '/' + gh_basepath + file_path }}", role="button" target="_blank">
14+
<img src="{{ pathto('_static/github.svg', 1) }}" alt="View On GitHub">
15+
</a>
16+
17+
<a href="{{ 'https://mybinder.org/v2/gh/' + gh_binder + '?filepath=' + file_path }}" target="_blank">
18+
<img src="{{ pathto('_static/binder.svg', 1) }}" alt="Open In Binder">
19+
</a>
20+
21+
<a href="{{ 'https://colab.research.google.com/github/' + gh_basepath + file_path }}" target="_blank">
22+
<img src="{{ pathto('_static/colab.svg', 1) }}" alt="Open In Colab"/>
23+
</a>
24+
</p>
25+
</div>
26+
{% endif %}
27+
28+
{{ body }}
29+
{% endblock %}

_templates/postcard.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{% if pagename in ablog %}
2+
{% set fa = ablog.fontawesome %}
3+
{% set post = ablog[pagename] %}
4+
<nav class="bd-links" id="bd-docs-nav" aria-label="{{ _('Main navigation') }}">
5+
<div class="bd-toc-item active">
6+
<h3>Notebook metadata</h3>
7+
8+
<ul>
9+
{% if post.author %}
10+
<li id="author">
11+
<span><i class="fa-fw fa fa-user"></i></span>
12+
<a href="#authors">{% for coll in post.author %} {% if coll|length %}
13+
{{ coll }}{% if loop.index <
14+
post.author|length %},{% endif %} {% else %}{{ coll }}{% if loop.index <
15+
post.author|length %},{% endif %}{% endif %} {% endfor %}
16+
</a>
17+
</li>
18+
{% endif %}
19+
{% if post.category %}
20+
<li id="category">
21+
<span><i class="fa-fw fa fa-folder-open"></i></span>
22+
{% for coll in post.category %} {% if coll|length %}
23+
<a href="{{ pathto(coll.docname) }}">{{ coll }}</a>{% if loop.index <
24+
post.category|length %},{% endif %} {% else %}{{ coll }}{% if loop.index <
25+
post.category|length %},{% endif %}{% endif %} {% endfor %}
26+
</li>
27+
{% endif %}
28+
{% if post.tags %}
29+
<li id="tags">
30+
<span>
31+
{% if post.tags|length > 1 %}<i class="fa-fw fa fa-tags"></i>
32+
{% else %}<i class="fa-fw fa fa-tag"></i>
33+
{% endif %}
34+
</span>
35+
{% for coll in post.tags %} {% if coll|length %}
36+
<a href="{{ pathto(coll.docname) }}">{{ coll }}</a>{% if loop.index <
37+
post.tags|length %}{% endif %} {% else %}{{ coll }}{% if loop.index <
38+
post.tags|length %}{% endif %}{% endif %} {% endfor %}
39+
</li>
40+
{% endif %}
41+
</ul>
42+
43+
<!-- Workaround to make the whole sidebar scrollable. See https://github.com/pydata/pydata-sphinx-theme/issues/500 -->
44+
{% include "tagcloud.html" %}
45+
{% include "categories.html" %}
46+
{% include "sidebar-ethical-ads.html" %}
47+
48+
</div>
49+
</nav>
50+
{% endif %}

examples/bibliography.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/conf.py

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
# -- Project information -----------------------------------------------------
1919

20-
project = "PyMC3"
20+
project = "PyMC"
2121
copyright = "2021, PyMC Community"
2222
author = "PyMC Community"
2323

@@ -78,26 +78,44 @@
7878
"search_bar_text": "Search...",
7979
"navbar_end": ["search-field.html", "navbar-icon-links.html"],
8080
"external_links": [
81-
{"name": "Learning", "url": "https://pymc3.readthedocs.io/en/latest/learn.html"},
82-
{"name": "API", "url": "https://pymc3.readthedocs.io/en/latest/api.html"},
81+
{"name": "Learning", "url": "https://docs.pymc.io/en/stable/learn.html"},
82+
{"name": "API", "url": "https://docs.pymc.io/en/stable/api.html"},
8383
],
8484
}
85+
html_context = {
86+
"github_url": "https://github.com",
87+
"github_user": "pymc-devs",
88+
"github_repo": "pymc-examples",
89+
"github_version": "main",
90+
"doc_path": "examples/",
91+
}
92+
8593

86-
html_favicon = "../_static/PyMC3.ico"
94+
html_favicon = "../_static/PyMC.ico"
95+
html_logo = "../_static/PyMC.png"
8796

8897
# Add any paths that contain custom static files (such as style sheets) here,
8998
# relative to this directory. They are copied after the builtin static files,
9099
# so a file named "default.css" will overwrite the builtin "default.css".
91100
html_static_path = ["../_static"]
101+
templates_path = ["../_templates"]
102+
# Workaround to make the whole sidebar scrollable. See https://github.com/pydata/pydata-sphinx-theme/issues/500
103+
# ideally the tagcloud, categories and ads would be added from here in conf.py
92104
html_sidebars = {
93-
"**": ["sidebar-nav-bs.html", "tagcloud.html", "categories.html"],
105+
"**": [
106+
# "sidebar-nav-bs.html",
107+
"postcard.html",
108+
# "tagcloud.html",
109+
# "categories.html",
110+
# "sidebar-ethical-ads.html",
111+
],
94112
}
95113

96114
# ablog config
97-
# blog_baseurl = "https://predictablynoisy.com"
115+
blog_baseurl = "https://examples.pymc.io"
98116
blog_title = "PyMC Examples"
99117
blog_path = "blog"
100-
# fontawesome_included = True
118+
fontawesome_included = True
101119
# post_redirect_refresh = 1
102120
# post_auto_image = 1
103121
# post_auto_excerpt = 2
@@ -124,7 +142,7 @@
124142
# "mpl": ("https://matplotlib.org/", None),
125143
# "numpy": ("https://numpy.org/doc/stable/", None),
126144
# "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
127-
"pymc3": ("https://docs.pymc.io/", None),
145+
"pymc": ("https://docs.pymc.io/en/stable/", None),
128146
# "scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
129147
# "xarray": ("http://xarray.pydata.org/en/stable/", None),
130148
}

examples/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ via the search bar.
1111
:::{toctree}
1212
:maxdepth: 2
1313
blog
14-
bibliography
1514
:::

examples/splines/spline.ipynb

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Splines in PyMC3"
8-
]
9-
},
10-
{
11-
"cell_type": "markdown",
12-
"metadata": {},
13-
"source": [
7+
"# Splines in PyMC3\n",
8+
"\n",
149
":::{post} Oct 8, 2021 \n",
1510
":tags: patsy, pymc3.Deterministic, pymc3.Exponential, pymc3.Model, pymc3.Normal, regression, spline\n",
1611
":category: beginner\n",
12+
":author: Joshua Cook, Tyler James Burch\n",
1713
":::"
1814
]
1915
},
@@ -1538,11 +1534,10 @@
15381534
}
15391535
],
15401536
"metadata": {
1541-
"celltoolbar": "Tags",
15421537
"kernelspec": {
1543-
"display_name": "pymc_1010",
1538+
"display_name": "Python 3 (ipykernel)",
15441539
"language": "python",
1545-
"name": "pymc_1010"
1540+
"name": "python3"
15461541
},
15471542
"language_info": {
15481543
"codemirror_mode": {
@@ -1554,7 +1549,7 @@
15541549
"name": "python",
15551550
"nbconvert_exporter": "python",
15561551
"pygments_lexer": "ipython3",
1557-
"version": "3.9.7"
1552+
"version": "3.8.6"
15581553
}
15591554
},
15601555
"nbformat": 4,

0 commit comments

Comments
 (0)