diff scripts/miscellaneous/publish.m @ 30592: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 796f54d4ddbf
children c8ad083a5802
line wrap: on
line diff
--- 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);