Skip to content

Commit

Permalink
switch from png+imagemap to svg
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed Mar 20, 2024
1 parent ddbaa5b commit 663a32d
Show file tree
Hide file tree
Showing 8 changed files with 307 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ out/

.java-version
.factorypath

/*.svg
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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.
234 changes: 234 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.
24 changes: 2 additions & 22 deletions src/site/xdoc/index.xml
Original file line number Diff line number Diff line change
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="759">
</object>
</p>

<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
Original file line number Diff line number Diff line change
@@ -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 663a32d

Please sign in to comment.