Skip to content

Commit

Permalink
[MNG-8085] switch png+imagemap to svg
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed Mar 24, 2024
1 parent a137cc6 commit eae3947
Show file tree
Hide file tree
Showing 8 changed files with 547 additions and 34 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
.checkstyle
.vscode/
repo/
/*.svg
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ under the License.
<exclude>src/test/projects/**</exclude>
<exclude>src/test/remote-repo/**</exclude>
<exclude>**/*.odg</exclude>
<exclude>**/*.svg</exclude>
<exclude>.asf.yaml</exclude>
<!--
! Excluded the license files itself cause they do not have have a license of themselves.
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/site/xdoc/maven-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 src/site/svgo.config.mjs maven-deps.svg -o maven-deps-optimized.svg

cat maven-deps-optimized.svg \
| sed 's/a xlink:href/a target="_parent" xlink:href/' \
| sed 's_file://_.._' \
> src/site/resources/images/maven-deps.svg
Binary file removed src/site/resources/images/maven-deps.png
Binary file not shown.
477 changes: 477 additions & 0 deletions src/site/resources/images/maven-deps.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions src/site/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",
]
}
},
],
};
35 changes: 1 addition & 34 deletions src/site/xdoc/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,40 +40,7 @@ under the License.
process.</p>

<p>
<img src="images/maven-deps.png" width="930" height="579" border="0" usemap="#Maven_dependencies" />
<map name="Maven_dependencies">
<area shape="rect" coords="228,1,361,36" alt="apache-maven" href="apache-maven/" />
<area shape="rect" coords="228,59,362,94" alt="maven-embedder" href="maven-embedder/" />
<area shape="rect" coords="228,116,362,152" alt="maven-compat" href="maven-compat/" />
<area shape="rect" coords="229,176,362,211" alt="maven-core" href="maven-core/" />
<area shape="rect" coords="134,364,292,399" alt="maven-resolver-provider" href="maven-resolver-provider/" />
<area shape="rect" coords="183,544,374,578" alt="maven-repository-metadata" href="maven-repository-metadata/" />
<area shape="rect" coords="433,176,531,211" alt="maven-plugin-api" href="maven-plugin-api/" />
<area shape="rect" coords="495,544,577,577" alt="maven-artifact" href="maven-artifact/" />
<area shape="rect" coords="304,414,452,450" alt="maven-builder-support" href="maven-builder-support/" />
<area shape="rect" coords="304,233,451,269" alt="maven-settings-builder" href="maven-settings-builder/" />
<area shape="rect" coords="284,293,367,328" alt="maven-settings" href="maven-settings/" />
<area shape="rect" coords="275,473,407,507" alt="maven-model-builder" href="maven-model-builder/" />
<area shape="rect" coords="397,544,488,578" alt="maven-model" href="maven-model/" />
<area shape="rect" coords="43,0,200,36" alt="maven-slf4j-provider" href="maven-slf4j-provider/" />
<area shape="rect" coords="0,434,172,578" alt="maven-resolver" href="https://maven.apache.org/resolver/" />
<area shape="rect" coords="71,59,173,94" alt="slf4j-api" href="http://www.slf4j.org/manual.html" />
<area shape="rect" coords="551,58,707,94" alt="commons-cli" href="http://commons.apache.org/cli/" />
<area shape="rect" coords="88,175,205,212" alt="maven-shared-utils" href="https://maven.apache.org/shared/maven-shared-utils/" />
<area shape="rect" coords="0,175,70,211" alt="jansi" href="http://fusesource.github.io/jansi/" />
<area shape="rect" coords="0,234,70,269" alt="jansi-native" href="https://github.com/fusesource/jansi-native" />
<area shape="rect" coords="551,116,739,152" alt="wagon-provider-api" href="https://maven.apache.org/wagon/wagon-provider-api/" />
<area shape="rect" coords="560,338,699,374" alt="plexus-sec-dispatcher" href="https://github.com/codehaus-plexus/plexus-sec-dispatcher" />
<area shape="rect" coords="723,339,802,374" alt="plexus-cipher" href="https://github.com/codehaus-plexus/plexus-cipher" />
<area shape="rect" coords="563,405,690,441" alt="plexus-interpolation" href="https://codehaus-plexus.github.io/plexus-interpolation" />
<area shape="rect" coords="560,289,784,324" alt="plexus-component-annotations" href="https://codehaus-plexus.github.io/plexus-containers" />
<area shape="rect" coords="799,289,917,324" alt="plexus-classworlds" href="https://codehaus-plexus.github.io/plexus-classworlds" />
<area shape="rect" coords="819,405,909,441" alt="plexus-utils" href="https://codehaus-plexus.github.io/plexus-utils" />
<area shape="rect" coords="552,276,929,477" alt="plexus" href="https://codehaus-plexus.github.io/" />
<area shape="rect" coords="551,163,777,248" alt="sisu" href="http://www.eclipse.org/projects/project_summary.php?projectid=technology.sisu" />
<area shape="rect" coords="831,176,905,211" alt="guice" href="http://code.google.com/p/google-guice/" />
<area shape="rect" coords="807,230,929,265" alt="javax.inject" href="http://docs.oracle.com/javaee/6/api/javax/inject/package-summary.html" />
</map>
<object data="images/maven-deps.svg" width="866" height="522"></object>
</p>
</section>

Expand Down
Binary file modified src/site/xdoc/maven-deps.odg
Binary file not shown.

0 comments on commit eae3947

Please sign in to comment.