Mercurial > jwe > octave
changeset 30597:939e69b45601 stable
publish.m: Update URLs.
* scripts/miscellaneous/publish.m (format_text): Update URL string to current
Octave documentation. Improve development version detection. Use https, also
in comments.
* scripts/miscellaneous/private/__publish_html_output__.m: Update to MathJax3.
The latest minor will be chosen automatically, less maintanence.
author | Kai T. Ohlhus <k.ohlhus@gmail.com> |
---|---|
date | Wed, 05 Jan 2022 15:46:56 +0900 |
parents | d00ae0ad8f89 |
children | bcaa4c5f5928 347dbc9049d5 |
files | scripts/miscellaneous/private/__publish_html_output__.m scripts/miscellaneous/publish.m |
diffstat | 2 files changed, 19 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/miscellaneous/private/__publish_html_output__.m Fri Dec 31 19:22:51 2021 +0100 +++ b/scripts/miscellaneous/private/__publish_html_output__.m Wed Jan 05 15:46:56 2022 +0900 @@ -117,15 +117,17 @@ function outstr = do_header (title_str, intro_str, toc_cstr) mathjax_str = sprintf ("%s\n", -'<script type="text/x-mathjax-config">', -"MathJax.Hub.Config({", -" tex2jax: { inlineMath: [['$','$'], ['\\\\(','\\\\)']] },", -" TeX: { equationNumbers: { autoNumber: 'all' } }", -"});", +"<script>", +"MathJax = {", +" tex: {", +" inlineMath: [['$','$'], ['\\\\(','\\\\)']],", +" tags: 'all'", +" }", +"};", "</script>", -['<script type="text/javascript" async ', ... - 'src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?', ... - 'config=TeX-MML-AM_CHTML"></script>']); +'<script type="text/javascript" async ', +'src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">', +"</script>"); stylesheet_str = sprintf ("%s\n", "<style>",
--- a/scripts/miscellaneous/publish.m Fri Dec 31 19:22:51 2021 +0100 +++ b/scripts/miscellaneous/publish.m Wed Jan 05 15:46:56 2022 +0900 @@ -859,9 +859,9 @@ ## Regular expressions for the formats: ## - ## 1) Links "<http://www.someurl.com>" + ## 1) Links "<https://www.someurl.com>" ## 2) Links "<octave:Function SOME TEXT>" - ## 3) Links "<http://www.someurl.com SOME TEXT>" + ## 3) Links "<https://www.someurl.com SOME TEXT>" ## 4) LaTeX block math "$$x^2$$" ## 5) LaTeX inline math "$x^2$" ## 6) Bold *text* @@ -893,7 +893,7 @@ "once"); switch (i) case 1 - ## Links "<http://www.someurl.com>" + ## Links "<https://www.someurl.com>" url = cstr{j}; cstr{j} = formatter ("link", url(2:end-1), url(2:end-1)); case 2 @@ -902,16 +902,17 @@ url = cstr{j}; url = texinfo_esc (url(9:idx-1)); v = version (); - if (v(end) == '+') - v = "interpreter"; + if (v(end) != '0') # No official release + v = "latest"; + else + v = ["v" v]; # "v6.4.0" etc. endif - url = sprintf ( ... - "https://www.gnu.org/software/octave/doc/%s/XREF%s.html", v, url); + url = sprintf ("https://octave.org/doc/%s/XREF%s.html", v, url); txt = cstr{j}; txt = format_text (txt(idx+1:end-1), formatter); cstr{j} = formatter ("link", url, txt); case 3 - ## Links "<http://www.someurl.com SOME TEXT>" + ## Links "<https://www.someurl.com SOME TEXT>" idx = strfind (cstr{j}, " ")(1); url = cstr{j}; url = url(2:idx-1);