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 267de06 commit c710760
Show file tree
Hide file tree
Showing 8 changed files with 793 additions and 35 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
.factorypath
.vscode/
repo/
/*.svg
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,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>
<exclude>.mvn/**</exclude>
<!--
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.
723 changes: 723 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",
]
}
},
],
};
36 changes: 1 addition & 35 deletions src/site/xdoc/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,41 +40,7 @@ under the License.
process.</p>

<p>
<img src="images/maven-deps.png" width="1005" height="681" border="0" usemap="#Maven_dependencies" />
<map name="Maven_dependencies">
<area shape="rect" coords="478,1,567,40" alt="maven-bom" href="maven-bom/" />
<area shape="rect" coords="251,0,400,40" alt="apache-maven" href="apache-maven/" />
<area shape="rect" coords="251,66,400,106" alt="maven-embedder" href="maven-embedder/" />
<area shape="rect" coords="250,131,400,173" alt="maven-compat" href="maven-compat/" />
<area shape="rect" coords="250,197,401,237" alt="maven-core" href="maven-core/" />
<area shape="rect" coords="91,447,268,488" alt="maven-resolver-provider" href="maven-resolver-provider/" />
<area shape="rect" coords="204,639,423,680" alt="maven-repository-metadata" href="maven-repository-metadata/" />
<area shape="rect" coords="528,197,638,238" alt="maven-plugin-api" href="maven-plugin-api/" />
<area shape="rect" coords="374,258,554,299" alt="maven-toolchain-builder" href="maven-toolchain-builder/" />
<area shape="rect" coords="375,324,553,365" alt="maven-toolchain-model" href="maven-toolchain-model/" />
<area shape="rect" coords="601,578,696,619" alt="maven-artifact" href="maven-artifact/" />
<area shape="rect" coords="381,446,547,486" alt="maven-builder-support" href="maven-builder-support/" />
<area shape="rect" coords="244,381,406,421" alt="maven-settings-builder" href="maven-settings-builder/" />
<area shape="rect" coords="278,447,371,486" alt="maven-settings" href="maven-settings/" />
<area shape="rect" coords="387,512,540,553" alt="maven-model-builder" href="maven-model-builder/" />
<area shape="rect" coords="492,577,594,619" alt="maven-model" href="maven-model/" />
<area shape="rect" coords="71,0,222,41" alt="maven-slf4j-provider" href="maven-slf4j-provider/" />
<area shape="rect" coords="73,66,220,108" alt="maven-slf4j-wrapper" href="maven-slf4j-wrapper/" />
<area shape="rect" coords="1,517,192,680" alt="maven-resolver" href="https://maven.apache.org/resolver/" />
<area shape="rect" coords="87,132,204,172" alt="slf4j-api" href="https://www.slf4j.org/manual.html" />
<area shape="rect" coords="679,66,827,106" alt="commons-cli" href="https://commons.apache.org/cli/" />
<area shape="rect" coords="82,197,216,237" alt="maven-shared-utils" href="https://maven.apache.org/shared/maven-shared-utils/" />
<area shape="rect" coords="109,263,189,304" alt="jansi" href="https://fusesource.github.io/jansi/" />
<area shape="rect" coords="679,132,892,171" alt="wagon-provider-api" href="https://maven.apache.org/wagon/wagon-provider-api/" />
<area shape="rect" coords="674,437,831,477" alt="plexus-sec-dispatcher" href="https://github.com/codehaus-plexus/plexus-sec-dispatcher" />
<area shape="rect" coords="859,436,949,479" alt="plexus-cipher" href="https://github.com/codehaus-plexus/plexus-cipher" />
<area shape="rect" coords="673,380,820,422" alt="plexus-interpolation" href="https://codehaus-plexus.github.io/plexus-interpolation" />
<area shape="rect" coords="674,324,809,365" alt="plexus-classworlds" href="https://codehaus-plexus.github.io/plexus-classworlds" />
<area shape="rect" coords="868,324,951,366" alt="plexus-utils" href="https://codehaus-plexus.github.io/plexus-utils" />
<area shape="rect" coords="660,310,965,520" alt="plexus" href="https://codehaus-plexus.github.io/" />
<area shape="rect" coords="679,183,910,281" alt="sisu" href="https://projects.eclipse.org/projects/technology.sisu" />
<area shape="rect" coords="921,195,1004,239" alt="guice" href="https://github.com/google/guice" />
</map>
<object data="images/maven-deps.svg" width="960" height="601"></object>
</p>
</section>

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

0 comments on commit c710760

Please sign in to comment.