Skip to content

Commit

Permalink
Merge pull request #131 from bashtage/fix-extlinks
Browse files Browse the repository at this point in the history
DOC: Fix issues in docs
  • Loading branch information
bashtage authored Jan 17, 2023
2 parents 49868b5 + ee4c7dc commit ac74442
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 15 deletions.
14 changes: 9 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# -- Path setup --------------------------------------------------------------

import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand All @@ -14,11 +15,11 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))
from distutils.version import LooseVersion
import os

import sphinx_material
from recommonmark.transform import AutoStructify

import sphinx_material

FORCE_CLASSIC = os.environ.get("SPHINX_MATERIAL_FORCE_CLASSIC", False)
FORCE_CLASSIC = FORCE_CLASSIC in ("1", "true")

Expand Down Expand Up @@ -149,10 +150,13 @@
extlinks = {
"duref": (
"http://docutils.sourceforge.net/docs/ref/rst/" "restructuredtext.html#%s",
"",
None,
),
"durole": ("http://docutils.sourceforge.net/docs/ref/rst/" "roles.html#%s", None),
"dudir": (
"http://docutils.sourceforge.net/docs/ref/rst/" "directives.html#%s",
None,
),
"durole": ("http://docutils.sourceforge.net/docs/ref/rst/" "roles.html#%s", ""),
"dudir": ("http://docutils.sourceforge.net/docs/ref/rst/" "directives.html#%s", ""),
}

# Enable eval_rst in markdown
Expand Down
18 changes: 11 additions & 7 deletions docs/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@
"import numpy as np\n",
"import pandas as pd\n",
"\n",
"df = pd.DataFrame({'ints': [1, 2, 3], \n",
" 'floats': [np.pi, np.exp(1), (1+np.sqrt(5))/2],\n",
" 'strings': ['aardvark', 'bananarama', 'charcuterie' ]})\n",
"df = pd.DataFrame(\n",
" {\n",
" \"ints\": [1, 2, 3],\n",
" \"floats\": [np.pi, np.exp(1), (1 + np.sqrt(5)) / 2],\n",
" \"strings\": [\"aardvark\", \"bananarama\", \"charcuterie\"],\n",
" }\n",
")\n",
"\n",
"df"
]
Expand Down Expand Up @@ -99,17 +103,17 @@
"import matplotlib.pyplot as plt\n",
"from matplotlib import cm\n",
"\n",
"fig, ax = plt.subplots(figsize=(12,8))\n",
"fig, ax = plt.subplots(figsize=(12, 8))\n",
"\n",
"data = np.clip(np.random.randn(250, 250), -1, 1)\n",
"\n",
"cax = ax.imshow(data, interpolation='nearest', cmap=cm.coolwarm)\n",
"ax.set_title('Gaussian noise with vertical colorbar', fontsize=16)\n",
"cax = ax.imshow(data, interpolation=\"nearest\", cmap=cm.coolwarm)\n",
"ax.set_title(\"Gaussian noise with vertical colorbar\", fontsize=16)\n",
"plt.tick_params(labelsize=16)\n",
"\n",
"# Add colorbar, make sure to specify tick locations to match desired ticklabels\n",
"cbar = fig.colorbar(cax, ticks=[-1, 0, 1])\n",
"cbar.ax.set_yticklabels(['< -1', '0', '> 1']) # vertically oriented colorbar\n",
"cbar.ax.set_yticklabels([\"< -1\", \"0\", \"> 1\"]) # vertically oriented colorbar\n",
"cbar.ax.tick_params(labelsize=16)"
]
}
Expand Down
2 changes: 1 addition & 1 deletion docs/numpydoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ NumPy-style docstring.
.. autosummary::
:toctree: generated/

~numpy.polynomial.Polynomial
~numpy.polynomial.polynomial.Polynomial
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
black==19.10b0
black==22.12.0
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,9 @@
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
entry_points={"sphinx.html_themes": ["sphinx_material = sphinx_material",]},
entry_points={
"sphinx.html_themes": [
"sphinx_material = sphinx_material",
]
},
)
1 change: 1 addition & 0 deletions sphinx_material/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def minify_css(app, exception):
app.multiprocess_manager.shutdown()
return
import glob

from css_html_js_minify.css_minifier import css_minify

css_files = glob.glob(os.path.join(app.outdir, "**", "*.css"), recursive=True)
Expand Down

0 comments on commit ac74442

Please sign in to comment.