Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
graph-tool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Malte R
graph-tool
Commits
164a0286
Commit
164a0286
authored
Sep 16, 2020
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc: switch from Mathjax 2 to 3
parent
68e1234a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
65 deletions
+1
-65
doc/conf.py
doc/conf.py
+1
-1
doc/mathjax.py
doc/mathjax.py
+0
-64
No files found.
doc/conf.py
View file @
164a0286
...
...
@@ -39,7 +39,7 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
#'matplotlib.sphinxext.plot_directive'
]
mathjax_path
=
"MathJax/
MathJax.js?config=default
"
mathjax_path
=
"MathJax/
tex-chtml-full.js
"
# Add any paths that contain templates here, relative to this directory.
templates_path
=
[
'.templates'
]
...
...
doc/mathjax.py
deleted
100644 → 0
View file @
68e1234a
# -*- coding: utf-8 -*-
"""
sphinx.ext.mathjax
~~~~~~~~~~~~~~~~~~
Set up everything for use of MathJax (http://www.mathjax.org/)
to display math in HTML via JavaScript.
(c) Kevin Dunn, http://connectmv.com
:license: BSD, see LICENSE for details.
"""
from
docutils
import
nodes
from
sphinx.application
import
ExtensionError
from
sphinx.ext.mathbase
import
setup_math
as
mathbase_setup
def
html_visit_math
(
self
,
node
):
self
.
body
.
append
(
self
.
starttag
(
node
,
'span'
,
''
,
CLASS
=
'math'
))
self
.
body
.
append
(
self
.
builder
.
config
.
mathjax_inline
[
0
]
+
\
self
.
encode
(
node
[
'latex'
])
+
\
self
.
builder
.
config
.
mathjax_inline
[
1
]
+
'</span>'
)
raise
nodes
.
SkipNode
def
html_visit_displaymath
(
self
,
node
):
self
.
body
.
append
(
self
.
starttag
(
node
,
'div'
,
CLASS
=
'math'
))
if
node
[
'nowrap'
]:
self
.
body
.
append
(
self
.
builder
.
config
.
mathjax_display
[
0
]
+
\
node
[
'latex'
]
+
\
self
.
builder
.
config
.
mathjax_display
[
1
])
self
.
body
.
append
(
'</div>'
)
raise
nodes
.
SkipNode
parts
=
[
prt
for
prt
in
node
[
'latex'
].
split
(
'
\n\n
'
)
if
prt
.
strip
()
!=
''
]
for
i
,
part
in
enumerate
(
parts
):
part
=
self
.
encode
(
part
)
if
i
==
0
:
# necessary to e.g. set the id property correctly
if
node
[
'number'
]:
self
.
body
.
append
(
'<span class="eqno">(%s)</span>'
%
node
[
'number'
])
if
'&'
in
part
or
'
\\\\
'
in
part
:
self
.
body
.
append
(
self
.
builder
.
config
.
mathjax_display
[
0
]
+
\
'
\\
begin{split}'
+
part
+
'
\\
end{split}'
+
\
self
.
builder
.
config
.
mathjax_display
[
1
])
else
:
self
.
body
.
append
(
self
.
builder
.
config
.
mathjax_display
[
0
]
+
part
+
\
self
.
builder
.
config
.
mathjax_display
[
1
])
self
.
body
.
append
(
'</div>
\n
'
)
raise
nodes
.
SkipNode
def
builder_inited
(
app
):
if
not
app
.
config
.
mathjax_path
:
raise
ExtensionError
(
'mathjax_path config value must be set for the '
'mathjax extension to work'
)
app
.
add_javascript
(
app
.
config
.
mathjax_path
)
def
setup
(
app
):
mathbase_setup
(
app
,
(
html_visit_math
,
None
),
(
html_visit_displaymath
,
None
))
app
.
add_config_value
(
'mathjax_path'
,
''
,
False
)
app
.
add_config_value
(
'mathjax_inline'
,
[
r
'\('
,
r
'\)'
],
'html'
)
app
.
add_config_value
(
'mathjax_display'
,
[
r
'\['
,
r
'\]'
],
'html'
)
app
.
connect
(
'builder-inited'
,
builder_inited
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment