From 936e7520d2bb5aee5fe4b21e660b00567ef506bc Mon Sep 17 00:00:00 2001
From: Konstantin Ladutenko
Date: Tue, 25 Oct 2016 16:11:13 +0300
Subject: [PATCH] Update readme.html for #3254 (#3255)
* Use cmake to find local MathJax
---
cmake/setup_cached_variables.cmake | 6 ++++
doc/doxygen/CMakeLists.txt | 26 ++++++++++++++++++
doc/doxygen/options.dox.in | 2 +-
doc/readme.html | 44 ++++++++++++++++++++++--------
4 files changed, 65 insertions(+), 13 deletions(-)
diff --git a/cmake/setup_cached_variables.cmake b/cmake/setup_cached_variables.cmake
index a0aee028b6..6ff2fad6ed 100644
--- a/cmake/setup_cached_variables.cmake
+++ b/cmake/setup_cached_variables.cmake
@@ -345,6 +345,12 @@ OPTION(DEAL_II_DOXYGEN_USE_MATHJAX
)
MARK_AS_ADVANCED(DEAL_II_DOXYGEN_USE_MATHJAX)
+OPTION(DEAL_II_DOXYGEN_USE_ONLINE_MATHJAX
+ "If set to ON, doxygen documentation is generated using online (from CDN) mathjax copy"
+ ON
+ )
+MARK_AS_ADVANCED(DEAL_II_DOXYGEN_USE_ONLINE_MATHJAX)
+
SET(DEAL_II_CPACK_EXTERNAL_LIBS "opt" CACHE STRING
"A relative path to tree of external libraries that will be installed in bundle package. The path is relative to the /Applications/${DEAL_II_CPACK_BUNDLE_NAME}.app/Contents/Resources directory. It defaults to opt, but you may want to use a different value, for example if you want to distribute a brew based package."
)
diff --git a/doc/doxygen/CMakeLists.txt b/doc/doxygen/CMakeLists.txt
index 501d7ab930..0451e280c8 100644
--- a/doc/doxygen/CMakeLists.txt
+++ b/doc/doxygen/CMakeLists.txt
@@ -55,9 +55,35 @@ ADD_SUBDIRECTORY(code-gallery)
#
IF(DEAL_II_DOXYGEN_USE_MATHJAX)
SET(_use_mathjax YES)
+ IF(NOT DEAL_II_DOXYGEN_USE_ONLINE_MATHJAX)
+ DEAL_II_FIND_PATH(MATHJAX_PATH MathJax.js
+ PATHS ${MATHJAX_ROOT}
+ $ENV{MATHJAX_ROOT}
+ "${CMAKE_PREFIX_PATH}/share/javascript/mathjax"
+ "${CMAKE_INSTALL_DATADIR}/javascript/mathjax"
+ "/usr/share/javascript/mathjax"
+ "/usr/share/yelp/mathjax"
+ DOC "Root path of MathJax.js"
+ )
+ IF(MATHJAX MATCHES "-NOTFOUND")
+ MESSAGE(FATAL_ERROR "MathJax was not found.")
+ ENDIF()
+ ENDIF()
+ IF(MATHJAX_PATH AND NOT DEAL_II_DOXYGEN_USE_ONLINE_MATHJAX)
+ SET(_mathjax_relpath ${MATHJAX_PATH})
+ MESSAGE(STATUS "Using local MathJax: " ${MATHJAX_PATH})
+ SET(MATHJAX_RELPATH_CONFIG "MATHJAX_RELPATH = ${MATHJAX_PATH}")
+ ELSE()
+ SET(_mathjax_relpath "https://cdn.mathjax.org/mathjax/latest")
+ MESSAGE(STATUS "Using web-based MathJax: " ${_mathjax_relpath})
+ SET(MATHJAX_RELPATH_CONFIG "")
+ MESSAGE(STATUS "Using default web-based MathJax")
+ ENDIF()
ELSE()
SET(_use_mathjax NO)
ENDIF()
+
+
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/options.dox.in
${CMAKE_CURRENT_BINARY_DIR}/options.dox
diff --git a/doc/doxygen/options.dox.in b/doc/doxygen/options.dox.in
index 11b5e8c71f..98ab862678 100644
--- a/doc/doxygen/options.dox.in
+++ b/doc/doxygen/options.dox.in
@@ -112,7 +112,7 @@ HTML_FILE_EXTENSION = .html
HTML_HEADER = header.html
HTML_FOOTER = footer.html
USE_MATHJAX = @_use_mathjax@
-MATHJAX_RELPATH = https://cdn.mathjax.org/mathjax/latest
+MATHJAX_RELPATH = @_mathjax_relpath@
MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 200
diff --git a/doc/readme.html b/doc/readme.html
index 128ac71e44..7ebe1aebb6 100644
--- a/doc/readme.html
+++ b/doc/readme.html
@@ -316,18 +316,38 @@
so, invoke cmake
in the build instructions above as follows:
-
- cmake -DDEAL_II_COMPONENT_DOCUMENTATION=ON -DCMAKE_INSTALL_PREFIX=/path/install/dir ../deal.II
-
-
-
- For this to succeed, you will need Perl 5.x,
- doxygen
- and dot
(which is part of
- the GraphViz
- package) to be installed.
-
+
+ cmake -DDEAL_II_COMPONENT_DOCUMENTATION=ON -DCMAKE_INSTALL_PREFIX=/path/install/dir ../deal.II
+
+
+
+ For this to succeed, you will need Perl 5.x,
+ doxygen
+ and dot
(which is part of
+ the GraphViz
+ package) to be installed.
+
+
+
+ The documentation contains links to pictures (e.g., for the
+ tutorial programs) that are by default stored online at the
+ dealii.org domain. If you want to use the documentation
+ completely offline, you can run
+ the contrib/utilities/makeofflinedoc.sh
script in
+ an installed documentation directory to download all images.
+
+
+ Finally, the default for locally installed documentation is to
+ render formulas as images. You can force formulas to be
+ displayed via the MathJax system by
+ adding -DDEAL_II_DOXYGEN_USE_MATHJAX=ON
to the
+ CMake call above. These formulas are then rendered natively by the
+ browser. With -DDEAL_II_DOXYGEN_USE_ONLINE_MATHJAX=OFF
+ CMake will try to find a local installation of MathJax scripts,
+ otherwise the online version of the scripts will be used in the
+ documentation.
+
Upon calling make
and make install
, this will
--
2.39.5