You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2021/10/08 17:49:21 UTC

[sis] branch geoapi-4.0 updated (2b995e7 -> fabb532)

This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a change to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git.


    from 2b995e7  Add `BandedCoverage.getCoordinateReferenceSystem()` and `getEnvelope()` methods.
     new bc7c80e  Update the developer guide generator for the new directory layout of Apache SIS web site.
     new fabb532  Replace deprecated <mfenced> tag in MathML.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/sis/internal/book/Assembler.java    | 84 +++++++++++++---------
 .../org/apache/sis/internal/book/package-info.java | 21 +++---
 .../org/apache/sis/referencing/datum/formulas.html | 24 ++++---
 .../referencing/operation/transform/formulas.html  | 54 +++++++++-----
 4 files changed, 110 insertions(+), 73 deletions(-)

[sis] 02/02: Replace deprecated tag in MathML.

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit fabb532212e9afdb8360521124a9bf5041593cf5
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Fri Oct 8 16:36:55 2021 +0200

    Replace deprecated <mfenced> tag in MathML.
---
 .../org/apache/sis/referencing/datum/formulas.html | 24 ++++++----
 .../referencing/operation/transform/formulas.html  | 54 ++++++++++++++--------
 2 files changed, 52 insertions(+), 26 deletions(-)

diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/formulas.html b/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/formulas.html
index 04519b7..2fa9484 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/formulas.html
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/formulas.html
@@ -40,17 +40,20 @@
 
     <h2>Bursa-Wolf</h2>
     <math display="block" alttext="MathML capable browser required">
-      <mfenced open="[" close="]">
+      <mrow>
+        <mo>[</mo>
         <mtable>
           <mtr><mtd><msub><mi>X</mi><mi>t</mi></msub></mtd></mtr>
           <mtr><mtd><msub><mi>Y</mi><mi>t</mi></msub></mtd></mtr>
           <mtr><mtd><msub><mi>Z</mi><mi>t</mi></msub></mtd></mtr>
         </mtable>
-      </mfenced>
+        <mo>]</mo>
+      </mrow>
       <mo>=</mo>
       <mo>(</mo><mn>1</mn><mo>+</mo><mi>dS</mi><mo>)</mo>
       <mo>⋅</mo>
-      <mfenced open="[" close="]">
+      <mrow>
+        <mo>[</mo>
         <mtable>
           <mtr>
             <mtd><mn>1</mn></mtd>
@@ -68,23 +71,28 @@
             <mtd><mn>1</mn></mtd>
           </mtr>
         </mtable>
-      </mfenced>
+        <mo>]</mo>
+      </mrow>
       <mo>×</mo>
-      <mfenced open="[" close="]">
+      <mrow>
+        <mo>[</mo>
         <mtable>
           <mtr><mtd><msub><mi>X</mi><mi>s</mi></msub></mtd></mtr>
           <mtr><mtd><msub><mi>Y</mi><mi>s</mi></msub></mtd></mtr>
           <mtr><mtd><msub><mi>Z</mi><mi>s</mi></msub></mtd></mtr>
         </mtable>
-      </mfenced>
+        <mo>]</mo>
+      </mrow>
       <mo>+</mo>
-      <mfenced open="[" close="]">
+      <mrow>
+        <mo>[</mo>
         <mtable>
           <mtr><mtd><msub><mi>t</mi><mi>x</mi></msub></mtd></mtr>
           <mtr><mtd><msub><mi>t</mi><mi>y</mi></msub></mtd></mtr>
           <mtr><mtd><msub><mi>t</mi><mi>z</mi></msub></mtd></mtr>
         </mtable>
-      </mfenced>
+        <mo>]</mo>
+      </mrow>
     </math>
   </body>
 </html>
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/formulas.html b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/formulas.html
index fb7fff4..dd13387 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/formulas.html
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/formulas.html
@@ -42,21 +42,25 @@
     <div class="horizontal-flow">
       <div>
         <math display="block" alttext="MathML capable browser required">
-          <mfenced open="[" close="]">
+          <mrow>
+            <mo>[</mo>
             <mtable>
               <mtr><mtd><mi>x</mi><mo>'</mo></mtd></mtr>
               <mtr><mtd><mi>y</mi><mo>'</mo></mtd></mtr>
               <mtr><mtd><mi>z</mi><mo>'</mo></mtd></mtr>
             </mtable>
-          </mfenced>
+            <mo>]</mo>
+          </mrow>
           <mo>=</mo>
-          <mfenced open="[" close="]">
+          <mrow>
+            <mo>[</mo>
             <mtable>
               <mtr><mtd><mi>u</mi><mo>/</mo><mi>t</mi></mtd></mtr>
               <mtr><mtd><mi>v</mi><mo>/</mo><mi>t</mi></mtd></mtr>
               <mtr><mtd><mi>w</mi><mo>/</mo><mi>t</mi></mtd></mtr>
             </mtable>
-          </mfenced>
+            <mo>]</mo>
+          </mrow>
         </math>
 
         </div><div style="vertical-align: middle" >
@@ -64,16 +68,19 @@
         </div><div>
 
         <math display="block" alttext="MathML capable browser required">
-          <mfenced open="[" close="]">
+          <mrow>
+            <mo>[</mo>
             <mtable>
               <mtr><mtd><mi>u</mi></mtd></mtr>
               <mtr><mtd><mi>v</mi></mtd></mtr>
               <mtr><mtd><mi>w</mi></mtd></mtr>
               <mtr><mtd><mi>t</mi></mtd></mtr>
             </mtable>
-          </mfenced>
+            <mo>]</mo>
+          </mrow>
           <mo>=</mo>
-          <mfenced open="[" close="]">
+          <mrow>
+            <mo>[</mo>
             <mtable>
               <mtr>
                 <mtd><msub><mi>m</mi><mn>00</mn></msub></mtd>
@@ -100,16 +107,19 @@
                 <mtd><msub><mi>m</mi><mn>33</mn></msub></mtd>
               </mtr>
             </mtable>
-          </mfenced>
+            <mo>]</mo>
+          </mrow>
           <mo>×</mo>
-          <mfenced open="[" close="]">
+          <mrow>
+            <mo>[</mo>
             <mtable>
               <mtr><mtd><mi>x</mi></mtd></mtr>
               <mtr><mtd><mi>y</mi></mtd></mtr>
               <mtr><mtd><mi>z</mi></mtd></mtr>
               <mtr><mtd><mn>1</mn></mtd></mtr>
             </mtable>
-          </mfenced>
+            <mo>]</mo>
+          </mrow>
         </math>
       </div>
     </div>
@@ -119,7 +129,8 @@
 
     <h2>SwapAxes</h2>
     <math display="block" alttext="MathML capable browser required">
-      <mfenced open="[" close="]">
+      <mrow>
+        <mo>[</mo>
         <mtable>
           <mtr>
             <mtd><mn>0</mn></mtd>
@@ -137,7 +148,8 @@
             <mtd><mn>1</mn></mtd>
           </mtr>
         </mtable>
-      </mfenced>
+        <mo>]</mo>
+      </mrow>
     </math>
 
 
@@ -145,7 +157,8 @@
 
     <h2>NormalizeGeographic</h2>
     <math display="block" alttext="MathML capable browser required">
-      <mfenced open="[" close="]">
+      <mrow>
+        <mo>[</mo>
         <mtable>
           <mtr>
             <mtd><mi>π</mi><mo>/</mo><mn>180</mn></mtd>
@@ -163,7 +176,8 @@
             <mtd><mn>1</mn></mtd>
           </mtr>
         </mtable>
-      </mfenced>
+        <mo>]</mo>
+      </mrow>
     </math>
 
 
@@ -171,7 +185,8 @@
 
     <h2>DenormalizeGeographic</h2>
     <math display="block" alttext="MathML capable browser required">
-      <mfenced open="[" close="]">
+      <mrow>
+        <mo>[</mo>
         <mtable>
           <mtr>
             <mtd><mi>180</mi><mo>/</mo><mn>π</mn></mtd>
@@ -189,7 +204,8 @@
             <mtd><mn>1</mn></mtd>
           </mtr>
         </mtable>
-      </mfenced>
+        <mo>]</mo>
+      </mrow>
     </math>
 
 
@@ -197,7 +213,8 @@
 
     <h2>DenormalizeCartesian</h2>
     <math display="block" alttext="MathML capable browser required">
-      <mfenced open="[" close="]">
+      <mrow>
+        <mo>[</mo>
         <mtable>
           <mtr>
             <mtd><mi>a</mi> <mo>⋅</mo> <msub><mi>k</mi><mn>0</mn></msub></mtd>
@@ -215,7 +232,8 @@
             <mtd><mn>1</mn></mtd>
           </mtr>
         </mtable>
-      </mfenced>
+        <mo>]</mo>
+      </mrow>
     </math>
   </body>
 </html>

[sis] 01/02: Update the developer guide generator for the new directory layout of Apache SIS web site.

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit bc7c80e09388ca392f4621172beefb7d4ed62a8d
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Fri Oct 8 11:11:45 2021 +0200

    Update the developer guide generator for the new directory layout of Apache SIS web site.
---
 .../org/apache/sis/internal/book/Assembler.java    | 84 +++++++++++++---------
 .../org/apache/sis/internal/book/package-info.java | 21 +++---
 2 files changed, 58 insertions(+), 47 deletions(-)

diff --git a/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java b/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java
index 6bc538f..0e3d18a 100644
--- a/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java
+++ b/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java
@@ -66,7 +66,7 @@ import static org.apache.sis.internal.book.CodeColorizer.toArray;
  * See package javadoc for usage example.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.2
  * @since   0.7
  */
 public final class Assembler {
@@ -85,10 +85,13 @@ public final class Assembler {
 
     /**
      * Relative path to be replaced by {@code "../"} path. We perform this substitution because the source files
-     * defined in the {@code book/<language>/<chapter>} directories reference directly the images in their final
-     * {@code content/book/images} directory.
+     * defined in the {@code source/developer-guide/<chapter>} directories reference directly the images in their
+     * final {@code static/book/images} directory.
      */
-    private static final String PATH_TO_REPLACE = "../../../content/book/";
+    private static final String[] PATHS_TO_REPLACE = {
+        "../../../static/book/",        // English version
+        "../../../../static/book/"      // Localized versions
+    };
 
     /**
      * The directory of all input files to process.
@@ -151,7 +154,7 @@ public final class Assembler {
     /**
      * Creates a new assembler for the given input and output files.
      *
-     * @param  input   the input file (e.g. {@code "site/book/en/index.html"}).
+     * @param  input   the input file (e.g. {@code "sis-site/main/source/developer-guide/index.html"}).
      * @param  locale  the locale for the message to generates in HTML code.
      * @throws ParserConfigurationException if this constructor can not build the XML document.
      * @throws IOException if an error occurred while reading the file.
@@ -188,7 +191,7 @@ public final class Assembler {
                         "      http://www.apache.org/licenses/LICENSE-2.0" + LINE_SEPARATOR +
                         LINE_SEPARATOR +
                         "  This is an automatically generated file. DO NOT EDIT." + LINE_SEPARATOR +
-                        "  See the files in the ../../../book/ directory instead." + LINE_SEPARATOR +
+                        "  See the files in the `source/developer-guide` directory instead." + LINE_SEPARATOR +
                         LINE_SEPARATOR);
                 break;
             }
@@ -277,19 +280,34 @@ public final class Assembler {
     }
 
     /**
-     * Adjusts the relative path in {@code <a href="../../../content">} or
-     * {@code <img src="../../../content">} attribute value.
+     * Adjusts the relative path in {@code <a href="../../../static/">}
+     * or {@code <img src="../../../static/">} attribute value.
      */
-    private void adjustURL(final Element element) {
+    private static void adjustURL(final Element element) {
+        for (final String prefix : PATHS_TO_REPLACE) {
+            if (adjustURL(element, prefix)) break;
+        }
+    }
+
+    /**
+     * Adjusts the relative path in {@code <a href="../../../static/">}
+     * or {@code <img src="../../../static/">} attribute value.
+     *
+     * @param  element  the element to adjust.
+     * @param  prefix   the path prefix to search and replace.
+     * @return whether replacement has been done.
+     */
+    private static boolean adjustURL(final Element element, final String prefix) {
         String attribute;
         String href = element.getAttribute(attribute = "href");
-        if (href == null || !href.startsWith(PATH_TO_REPLACE)) {
+        if (href == null || !href.startsWith(prefix)) {
             href = element.getAttribute(attribute = "src");
-            if (href == null || !href.startsWith(PATH_TO_REPLACE)) {
-                return;
+            if (href == null || !href.startsWith(prefix)) {
+                return false;
             }
         }
-        element.setAttribute(attribute, "../" + href.substring(PATH_TO_REPLACE.length()));
+        element.setAttribute(attribute, "../" + href.substring(prefix.length()));
+        return true;
     }
 
     /**
@@ -596,12 +614,11 @@ public final class Assembler {
     }
 
     /**
-     * Generates the {@code "content/book/en|fr/developer-guide.html"} file from {@code "book/en|fr/index.html"}.
-     * The only argument expected by this method is the language: {@code "en"} or {@code "fr"}.
-     * The current directory shall be the parent directory of {@code "book"} and {@code "content"}.
-     * See package javadoc for usage example.
+     * Generates the {@code "static/book/en|fr/developer-guide.html"} files
+     * from {@code "source/developer-guide/[fr/]index.html"} files.
+     * The only argument expected by this method is the root of {@code sis-site} project.
      *
-     * @param  args  command-line arguments. Should contain exactly on value, which is the language.
+     * @param  args  command-line arguments. Should contain exactly on value, which is the site root directory.
      * @throws Exception if an I/O error, a XML parsing error or other kinds of error occurred.
      *
      * @since 0.8
@@ -609,29 +626,26 @@ public final class Assembler {
     @SuppressWarnings("UseOfSystemOutOrSystemErr")
     public static void main(final String[] args) throws Exception {
         if (args.length != 1) {
-            System.err.println("Expected parameter: the language (\"en\" or \"fr\").");
-            System.err.println("Current directory shall be the root of Apache SIS site source code.");
+            System.err.println("Expected parameter: root of `sis-site` project.");
             System.exit(1);
         }
-        String lang = args[0];
-        final Locale locale;
-        if ("en".equalsIgnoreCase(lang)) {
-            locale = Locale.ENGLISH;
-        } else if ("fr".equalsIgnoreCase(lang)) {
-            locale = Locale.FRENCH;
-        } else {
-            System.err.println("Unsupported language code: " + lang);
+        final File directory = new File(args[0]);
+        if (!directory.isDirectory()) {
+            System.err.println("Not a directory: " + directory);
             System.exit(1);
-            return;
         }
-        lang = locale.getLanguage();
-        File input = new File("book/" + lang + "/index.html");
+        final File input = new File(directory, "source/developer-guide/index.html");
         if (!input.isFile()) {
-            System.err.println("Can not read " + input + ". Is the current directory the root of SIS site source code?");
+            System.err.println("File not found: " + input);
+            System.err.println("Is the given directory the root of `sis-site` project?");
             System.exit(1);
-            return;
         }
-        final Assembler assembler = new Assembler(input, locale);
-        assembler.run(new File("content/book/" + lang + "/developer-guide.html"));
+        Assembler assembler = new Assembler(input, Locale.ENGLISH);
+        assembler.run(new File(directory, "static/book/en/developer-guide.html"));
+        /*
+         * Localized versions.
+         */
+        assembler = new Assembler(new File(directory, "source/fr/developer-guide/index.html"), Locale.FRENCH);
+        assembler.run(new File(directory, "static/book/fr/developer-guide.html"));
     }
 }
diff --git a/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/package-info.java b/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/package-info.java
index 5853ebf..1409ab3 100644
--- a/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/package-info.java
+++ b/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/package-info.java
@@ -16,30 +16,27 @@
  */
 
 /**
- * Takes the source HTML files in the {@code http://svn.apache.org/repos/asf/sis/site/trunk/book/} directory
- * and assembles them in a single file to be published in the
- * {@code http://svn.apache.org/repos/asf/sis/site/trunk/content/book/} directory.
+ * Takes the source HTML files in the {@code sis-site/main/source/developer-guide/} directory
+ * and assembles them in a single file to be published in the {@code asf-staging/book/} directory.
  *
  * <p>The main class in this package is {@link org.apache.sis.internal.book.Assembler}.
  * Other classes are helper classes that should be ignored. Assuming the following directory layout:</p>
  *
  * <pre>&lt;current directory&gt;
- * ├─ trunk
+ * ├─ master
+ * │   └─ core
+ * │       └─ sis-build-helper
  * └─ site
- *     ├─ book
- *     └─ content
+ *     ├─ source
+ *     └─ static
  * </pre>
  *
  * Then the command can be used as below on Unix systems:
  *
- * <pre>cd site
- * java -classpath ../trunk/core/sis-build-helper/target/classes org.apache.sis.internal.book.Assembler en
- * </pre>
- *
- * Replace {@code en} by {@code fr} for generating the French version.
+ * <pre>java -classpath master/core/sis-build-helper/target/classes org.apache.sis.internal.book.Assembler site</pre>
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.2
  * @since   0.7
  */
 package org.apache.sis.internal.book;