Skip to content

Commit 3a46460

Browse files
committed
grab release version from setup.py
1 parent 36e9dbb commit 3a46460

File tree

1 file changed

+44
-5
lines changed

1 file changed

+44
-5
lines changed

docs/source/conf.py

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import os
1515
import sys
1616
import sphinx_rtd_theme
17+
import re
1718

1819

1920
# -- Project information -----------------------------------------------------
@@ -22,10 +23,12 @@
2223
copyright = '2020, Jesse Haviland and Peter Corke'
2324
author = 'Jesse Haviland and Peter Corke'
2425

25-
print(__file__)
26-
# The full version, including alpha/beta/rc tags
27-
with open('../../RELEASE', encoding='utf-8') as f:
28-
release = f.read()
26+
# print(__file__)
27+
28+
# parse version number out of setup.py
29+
with open('../../setup.py', encoding='utf-8') as f:
30+
setup_py = f.read()
31+
m = re.search("version='([0-9\.]*)',", setup_py, re.MULTILINE)
2932

3033
# -- General configuration ---------------------------------------------------
3134

@@ -75,7 +78,6 @@
7578
#'github_repo': 'spatialmath-python',
7679
#'logo_name': False,
7780
'logo_only': False,
78-
#'description': 'Spatial maths and geometry for Python',
7981
'display_version': True,
8082
'prev_next_buttons_location': 'both',
8183
'analytics_id': 'G-11Q6WJM565',
@@ -111,4 +113,41 @@
111113
# 'fncychap': '\\usepackage[Lenny]{fncychap}',
112114
'fncychap': '\\usepackage{fncychap}',
113115
'maketitle': "blah blah blah"
116+
}
117+
118+
# see https://stackoverflow.com/questions/9728292/creating-latex-math-macros-within-sphinx
119+
mathjax_config = {
120+
'TeX': {
121+
'Macros': {
122+
# RVC Math notation
123+
# - not possible to do the if/then/else approach
124+
# - subset only
125+
"presup": [r"\,{}^{\scriptscriptstyle #1}\!", 1],
126+
# groups
127+
"SE": [r"\mathbf{SE}(#1)", 1],
128+
"SO": [r"\mathbf{SO}(#1)", 1],
129+
"se": [r"\mathbf{se}(#1)", 1],
130+
"so": [r"\mathbf{so}(#1)", 1],
131+
# vectors
132+
"vec": [r"\boldsymbol{#1}", 1],
133+
"dvec": [r"\dot{\boldsymbol{#1}}", 1],
134+
"ddvec": [r"\ddot{\boldsymbol{#1}}", 1],
135+
"fvec": [r"\presup{#1}\boldsymbol{#2}", 2],
136+
"fdvec": [r"\presup{#1}\dot{\boldsymbol{#2}}", 2],
137+
"fddvec": [r"\presup{#1}\ddot{\boldsymbol{#2}}", 2],
138+
"norm": [r"\Vert #1 \Vert", 1],
139+
# matrices
140+
"mat": [r"\mathbf{#1}", 1],
141+
"fmat": [r"\presup{#1}\mathbf{#2}", 2],
142+
# skew matrices
143+
"sk": [r"\left[#1\right]", 1],
144+
"skx": [r"\left[#1\right]_{\times}", 1],
145+
"vex": [r"\vee\left( #1\right)", 1],
146+
"vexx": [r"\vee_{\times}\left( #1\right)", 1],
147+
# quaternions
148+
"q": r"\mathring{q}",
149+
"fq": [r"\presup{#1}\mathring{q}", 1],
150+
151+
}
152+
}
114153
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy