Skip to content

Commit 4d66e41

Browse files
authored
Merge pull request #740 from ManifoldFR/topic/doxygen-mathjax-2025
Add support for MathJax 3, upgrade vendored MathJax to 3.2.2
2 parents 851587a + 4654815 commit 4d66e41

File tree

314 files changed

+2798
-3726
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

314 files changed

+2798
-3726
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ repos:
4545
hooks:
4646
- id: check-hooks-apply
4747
- id: check-useless-excludes
48-
exclude: \.js$
48+
exclude: (\.js$|^doxygen/MathJax/)

doxygen.cmake

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2008-2023 LAAS-CNRS, JRL AIST-CNRS, INRIA.
1+
# Copyright (C) 2008-2025 LAAS-CNRS, JRL AIST-CNRS, INRIA.
22
#
33
# This program is free software: you can redistribute it and/or modify it under
44
# the terms of the GNU General Public License as published by the Free Software
@@ -254,6 +254,7 @@ macro(_SETUP_DOXYGEN_CONFIG_FILE configfile)
254254
MATHJAX_RELPATH
255255
MATHJAX_EXTENSIONS
256256
MATHJAX_CODEFILE
257+
MATHJAX_VERSION
257258
SEARCHENGINE
258259
SERVER_BASED_SEARCH
259260
EXTERNAL_SEARCH
@@ -397,6 +398,39 @@ macro(_set_if_undefined variable)
397398
endif()
398399
endmacro()
399400

401+
# _SETUP_MATHJAX_DEFAULTS
402+
# ----------------------------
403+
#
404+
# Set MathJax defaults depending on the current version of Doxygen and whether
405+
# some flags were already set.
406+
#
407+
# If the Doxygen version is less than 1.9.2, the DOXYGEN_MATHJAX_VERSION option will be unset.
408+
# If a path to MathJax is not provided, we will either:
409+
# - point to our local vendored version of MathJax 3
410+
# - unset the MathJax path; the Doxygen HTML header will point to the MathJax 2 CDN.
411+
macro(_SETUP_MATHJAX_DEFAULTS)
412+
if(DOXYGEN_VERSION VERSION_GREATER_EQUAL 1.9.2)
413+
_set_if_undefined(DOXYGEN_MATHJAX_VERSION MathJax_3)
414+
else()
415+
# remove unsupported option
416+
unset(DOXYGEN_MATHJAX_VERSION)
417+
message(
418+
STATUS
419+
"Doxygen version inferior to 1.9.2. If MathJax is enabled, v2.7 will be used."
420+
)
421+
# set to empty string to use the MathJax CDN
422+
endif()
423+
if("${DOXYGEN_MATHJAX_VERSION}" STREQUAL "MathJax_3")
424+
# If using MathJax 3, use our vendored version by default.
425+
_set_if_undefined(
426+
DOXYGEN_MATHJAX_RELPATH
427+
${PROJECT_JRL_CMAKE_MODULE_DIR}/doxygen/MathJax
428+
)
429+
else()
430+
_set_if_undefined(DOXYGEN_MATHJAX_RELPATH)
431+
endif()
432+
endmacro(_SETUP_MATHJAX_DEFAULTS)
433+
400434
# _SETUP_DOXYGEN_DEFAULT_OPTIONS
401435
# ----------------------------
402436
#
@@ -442,6 +476,7 @@ macro(_SETUP_DOXYGEN_DEFAULT_OPTIONS)
442476
# ---------------------------------------------------------------------------
443477
_set_if_undefined(DOXYGEN_HTML_OUTPUT doxygen-html)
444478
_set_if_undefined(DOXYGEN_GENERATE_TREEVIEW YES)
479+
_SETUP_MATHJAX_DEFAULTS()
445480
# ---------------------------------------------------------------------------
446481
# Configuration options related to the LaTeX output
447482
# ---------------------------------------------------------------------------
@@ -591,6 +626,15 @@ macro(_SETUP_PROJECT_DOCUMENTATION)
591626
COPY ${PROJECT_JRL_CMAKE_MODULE_DIR}/doxygen/MathJax
592627
DESTINATION ${PROJECT_BINARY_DIR}/doc/doxygen-html
593628
)
629+
# the variable is unset if Doxygen version < 1.9.2
630+
# otherwise, MathJax_3 is the default.
631+
if(DOXYGEN_MATHJAX_VERSION STREQUAL "MathJax_3")
632+
message(
633+
STATUS
634+
"MathJax version 3 will be used. If MATHJAX_RELPATH is unset we will use the vendored MathJax. "
635+
"If you have set it, check that it's pointing at a MathJax 3 distribution."
636+
)
637+
endif()
594638
endif()
595639

596640
# Install generated files.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: [numfocus]
2+
custom: ['https://numfocus.org/donate-to-mathjax']
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Replace the text below with the details of the issue you are facing.
11+
DO NOT simply erase the form and type a free-form response.**
12+
-----
13+
14+
### Issue Summary
15+
16+
A summary of the issue and the browser/OS environment in which it occurs. If
17+
suitable, include the steps required to reproduce the bug.
18+
19+
### Steps to Reproduce:
20+
21+
1. This is the first step
22+
2. This is the second step
23+
3. Further steps, etc.
24+
25+
Any other information you want to share that is relevant to the issue
26+
being reported. Especially, why do you consider this to be a bug? What
27+
do you expect to happen instead?
28+
29+
### Technical details:
30+
31+
* MathJax Version: 3.2
32+
* Client OS: (e.g., Mac OS X 10.8.4)
33+
* Browser: (e.g., Chrome 29.0.1547.57)
34+
35+
I am using the following MathJax configuration:
36+
37+
``` js
38+
MathJax = {
39+
...
40+
};
41+
```
42+
43+
and loading MathJax via
44+
45+
``` html
46+
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
47+
```
48+
49+
### Supporting information:
50+
51+
* Please supply a link to a (live) minimal example page, when possible.
52+
* If your issue is with the display of the mathematics produced by MathJax, include a screen snapshot that illustrates the problem, when possible.
53+
* Check your browser console window for any error messages, and include them here.
54+
* Include the MathJax configuration you are using, and the script tag that loads MathJax itself.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

doxygen/MathJax/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+

doxygen/MathJax/.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
dist: focal
2+
language: node_js
3+
node_js:
4+
- stable
5+
sudo: false
6+
script:
7+
- npm test
8+
branches:
9+
only:
10+
- "/^\\d+\\.\\d+/"
11+
deploy:
12+
provider: npm
13+
email: manager@mathjax.org
14+
api_key:
15+
secure: rdvJ27qbw4DZJl49NSf/ybkeHWNWnk2MajS8Y8bMKwI8RaDyEGcAm3frA+CfBw+YHWl71KRJlQHL69YgVwp1nMSzKrGOpwrbL3TMFrFMdBC6tJ30dX1HSvAg9eU5K12E5672MM8qkTwJdYXsvEcyYlzRR+sogR8jTWRl3APuAwY=
16+
on:
17+
tags: true

0 commit comments

Comments
 (0)