Skip to content

Commit

Permalink
[MPLUGIN-514] switch from png+imagemap to svg
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed Mar 22, 2024
1 parent ddbaa5b commit 8ba1a07
Show file tree
Hide file tree
Showing 14 changed files with 245 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -15,3 +15,5 @@ out/

.java-version
.factorypath

/*.svg
2 changes: 1 addition & 1 deletion maven-script/maven-plugin-tools-ant/pom.xml
Expand Up @@ -28,7 +28,7 @@

<artifactId>maven-plugin-tools-ant</artifactId>

<name>Maven Plugin Tool for Ant</name>
<name>Maven Plugin Tool for Ant (deprecated)</name>
<description>Descriptor extractor for plugins written in Ant.</description>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion maven-script/maven-plugin-tools-beanshell/pom.xml
Expand Up @@ -28,7 +28,7 @@

<artifactId>maven-plugin-tools-beanshell</artifactId>

<name>Maven Plugin Tool for Beanshell</name>
<name>Maven Plugin Tool for Beanshell (deprecated)</name>
<description>Descriptor extractor for plugins written in Beanshell.</description>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion maven-script/maven-plugin-tools-model/pom.xml
Expand Up @@ -28,7 +28,7 @@

<artifactId>maven-plugin-tools-model</artifactId>

<name>Maven Plugin Metadata Model</name>
<name>Maven Plugin Metadata Model (deprecated)</name>
<description>The Maven Plugin Metadata Model provides an API to play with the Metadata model.</description>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion maven-script/maven-script-ant/pom.xml
Expand Up @@ -28,7 +28,7 @@ under the License.

<artifactId>maven-script-ant</artifactId>

<name>Maven Ant Mojo Support</name>
<name>Maven Ant Mojo Support (deprecated)</name>
<description>Maven Ant Mojo Support, ie write Maven plugins with Ant scripts.</description>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion maven-script/maven-script-beanshell/pom.xml
Expand Up @@ -28,7 +28,7 @@ under the License.

<artifactId>maven-script-beanshell</artifactId>

<name>Maven Beanshell Mojo Support</name>
<name>Maven Beanshell Mojo Support (deprecated)</name>
<description>Maven Beanshell Mojo Support, ie write Maven plugins with Beanshell scripts.</description>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion maven-script/pom.xml
Expand Up @@ -29,7 +29,7 @@ under the License.
<artifactId>maven-script</artifactId>
<packaging>pom</packaging>

<name>Maven Script Mojo Support</name>
<name>Maven Script Mojo Support (deprecated)</name>
<description>Maven Script Mojo Support lets developer write Maven plugins/goals with scripting languages instead of compiled Java. Scripting support is deprecated, with Maven 4 only Java based Mojos will be supported.</description>

<modules>
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Expand Up @@ -342,7 +342,8 @@
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludes combine.children="append">
<exclude>src/site/resources/images/plugin-descriptors.svg</exclude>
<exclude>src/site/resources/images/*.svg</exclude>
<exclude>*.svg</exclude>
<!-- Jenkins job with local Maven repository -->
<exclude>src/site/xdoc/plugin-descriptors.mmd</exclude>
<!-- Hudson Maven3 integration log -->
Expand Down
30 changes: 30 additions & 0 deletions prepare-svg.sh
@@ -0,0 +1,30 @@
#!/bin/bash

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

#libreoffice --headless --convert-to svg src/xdoc/plugin-tools-deps.odg
# CLI export keeps full A3 page
# I prefer doing it by hand, limiting export to "selection" = avoids extra space

# svgo https://github.com/svg/svgo
svgo --config svgo.config.mjs plugin-tools-deps.svg -o plugin-tools-deps-optimized.svg

cat plugin-tools-deps-optimized.svg \
| sed 's/a xlink:href/a target="_parent" xlink:href/' \
| sed 's_file://_.._' \
> src/site/resources/images/plugin-tools-deps.svg
Binary file removed src/site/resources/images/plugin-tools-deps.png
Binary file not shown.
163 changes: 163 additions & 0 deletions src/site/resources/images/plugin-tools-deps.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 5 additions & 48 deletions src/site/xdoc/index.xml
Expand Up @@ -37,28 +37,8 @@
help, and documentation.</p>

<p>
<img src="images/plugin-tools-deps.png" width="759" height="474" border="0" usemap="#PluginTools_dependencies" />
<map name="PluginTools_dependencies">
<area shape="rect" coords="256,0,467,34" alt="maven-plugin-plugin" href="./maven-plugin-plugin" />
<area shape="rect" coords="28,95,205,131" alt="plugin-tools-api" href="./maven-plugin-tools-api"/>
<area shape="rect" coords="287,154,496,190" alt="plugin-tools-javadoc" href="./maven-plugin-tools-javadoc"/>
<area shape="rect" coords="44,146,508,198" alt="plugin-tools-java" href="./maven-plugin-tools-java"/>
<area shape="rect" coords="311,213,496,248" alt="plugin-annotations" href="./maven-plugin-annotations"/>
<area shape="rect" coords="44,204,508,256" alt="plugin-tools-annotations" href="./maven-plugin-tools-annotations"/>
<area shape="rect" coords="55,270,293,306" alt="plugin-tools-beanshell" href="./maven-script/maven-plugin-tools-beanshell"/>
<area shape="rect" coords="319,271,557,306" alt="maven-script-beanshell" href="./maven-script/maven-script-beanshell"/>
<area shape="rect" coords="56,329,223,365" alt="plugin-tools-ant" href="./maven-script/maven-plugin-tools-ant"/>
<area shape="rect" coords="388,329,557,365" alt="maven-script-ant" href="./maven-script/maven-script-ant"/>
<area shape="rect" coords="48,388,231,424" alt="plugin-tools-model" href="./maven-script/maven-plugin-tools-model"/>
<area shape="rect" coords="514,95,759,131" alt="plugin-tools-generators" href="./maven-plugin-tools-generators"/>
<area shape="rect" coords="44,263,570,432" alt="maven-script" href="./maven-script"/>
<area shape="rect" coords="340,438,529,474" alt="maven-plugin-api" href="/ref/current/maven-plugin-api/"/>
<area shape="rect" coords="510,154,582,190" alt="qdox" href="https://github.com/paul-hammant/qdox"/>
<area shape="rect" coords="510,212,583,248" alt="asm" href="https://asm.ow2.org/"/>
<area shape="rect" coords="656,134,747,169" alt="Doxia" href="/doxia/"/>
<area shape="rect" coords="599,271,715,306" alt="Beanshell" href="http://www.beanshell.org/"/>
<area shape="rect" coords="600,329,670,366" alt="Ant" href="https://ant.apache.org/"/>
</map>
<object type="image/svg+xml" data="images/plugin-tools-deps.svg" width="643" height="248">
</object>
</p>

<table>
Expand All @@ -83,10 +63,6 @@
<td>&nbsp;&nbsp;<a href="./maven-plugin-tools-java/index.html">maven-plugin-tools-java</a></td>
<td>Extractor for plugins written in Java annotated with Mojo Javadoc Tags.</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;<a href="./maven-plugin-tools-javadoc/index.html">maven-plugin-tools-javadoc</a></td>
<td>Provides doclets to support Mojo Javadoc Tags in the Javadoc Tool.</td>
</tr>
<tr>
<td>&nbsp;&nbsp;<a href="./maven-plugin-tools-annotations/index.html">maven-plugin-tools-annotations</a></td>
<td>Extractor for plugins written in Java with Java annotations.</td>
Expand All @@ -96,28 +72,9 @@
<td>Provides the Java annotations to use in Mojos.</td>
</tr>
<tr>
<td><a href="./maven-script/index.html">maven-script</a></td>
<td>Maven Script Mojo Support lets developer write Maven plugins/goals with scripting languages instead of compiled Java.</td>
</tr>
<tr>
<td>&nbsp;&nbsp;<a href="./maven-script/maven-plugin-tools-beanshell/index.html">maven-plugin-tools-beanshell</a></td>
<td>Extractor for plugins written in Beanshell.</td>
</tr>
<tr>
<td>&nbsp;&nbsp;<a href="./maven-script/maven-script-beanshell/index.html">maven-script-beanshell</a></td>
<td>Maven Beanshell Mojo Support, ie write Maven plugins with Beanshell scripts.</td>
</tr>
<tr>
<td>&nbsp;&nbsp;<a href="./maven-script/maven-plugin-tools-ant/index.html">maven-plugin-tools-ant</a></td>
<td>Extractor for plugins written in Ant.</td>
</tr>
<tr>
<td>&nbsp;&nbsp;<a href="./maven-script/maven-script-ant/index.html">maven-script-ant</a></td>
<td>Maven Ant Mojo Support, ie write Maven plugins with Ant script.</td>
</tr>
<tr>
<td>&nbsp;&nbsp;<a href="./maven-script/maven-plugin-tools-model/index.html">maven-plugin-tools-model</a></td>
<td>Plugin Metadata Model for script-based plugins.</td>
<td><a href="./maven-script/index.html">maven-script</a> (deprecated)</td>
<td>Maven Script Mojo Support lets developer write Maven plugins/goals with scripting languages instead of compiled Java.<br/>
Deprecated since 3.7.0</td>
</tr>
</table>

Expand Down
Binary file modified src/site/xdoc/plugin-tools-deps.odg
Binary file not shown.
37 changes: 37 additions & 0 deletions svgo.config.mjs
@@ -0,0 +1,37 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export default {
js2svg: {
indent: 1,
pretty: true,
},
plugins: [
'preset-default',
{
name: "removeAttrs",
params: {
attrs: [
"g:class",
"path:class",
]
}
},
],
};

0 comments on commit 8ba1a07

Please sign in to comment.