Skip to content

Commit 3671775

Browse files
Bootstrapsvg (#135)
* Bootstrap Icons 1.11.3 (#131) * Auto-generated (update output with latest stdlib) * Bootstrap Icons SVG --------- Co-authored-by: Pander <[email protected]> Co-authored-by: arnaudroques <[email protected]> Co-authored-by: Pander <[email protected]>
1 parent 40aa8bd commit 3671775

File tree

13 files changed

+9383
-9
lines changed

13 files changed

+9383
-9
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,34 @@ This example renders the following image:
478478

479479
![Example](http://www.plantuml.com/plantuml/png/PSn12i8m40NGVK_nsqqL0k9U2eNMbRLGYjiIawa69faGKz7RUm3V0LxfWk7D4avUPqfEyy68znAQeiOiS3vAoiXFmYicbmchOy9NDdJZjPuHY2oo8B8s18sOQ7MViYZ_urNOKbgylAafYg5TpkEbwwTb66_zRYAhS5ImBYaaCbc71vD2rOBrdRZQ_m00 "Example")
480480

481+
## Bootstrap Icons [bootstrap]
482+
483+
This library consists of a free Bootstrap Icons style icons from Bootstrap. See the entire collection or search via a filter at https://icons.getbootstrap.com/ .
484+
485+
Use it by including the file that contains all the sprites: `!include <bootstrap/bootstrap>`.
486+
When imported, you can use the sprite as normally you would, using `<$bi_sprite_name>`.
487+
Notice that this library requires an `bi_` preffix on sprites names, this is to avoid clash of names if multiple sprites have the same name on different libraries. `bi` stands for Bootstrap Icon and this name is also used in the Bootstrap framework.
488+
489+
Example of usage:
490+
```plantuml
491+
@startuml
492+
skinparam UsecaseBackgroundColor white
493+
!include <bootstrap/bootstrap>
494+
495+
usecase a as "<$bi-globe>\nbi-globe"
496+
usecase b as "<$bi-globe,scale=2.5>"
497+
usecase c as "<$bi-globe{scale=2.5}>" #line:red
498+
499+
usecase d as "<$bi-bootstrap-fill>"
500+
usecase e as "<$bi-bootstrap-fill{scale=2.5,color=blue}>"
501+
usecase f as "<$bi-bootstrap-fill,scale=2.5,color=#00f>"
502+
@enduml
503+
```
504+
505+
This example renders the following image:
506+
507+
![Example](http://www.plantuml.com/plantuml/png/TODO "Example")
508+
481509
## Domain Story library (DomainStory-PlantUML) [DomainStory]
482510

483511
This library provides a set of macros to easily describe and document a domain story which was developed in
@@ -538,6 +566,7 @@ This example renders the following image:
538566
* **classy-c4**: made by https://github.com/james-gadrow-kr/classy-c4
539567
* **tupadr3**: made by https://github.com/tupadr3/plantuml-icon-font-sprites
540568
* **Material Icons**: from https://github.com/Templarian/MaterialDesign
569+
* **Bootstrap Icons**" from https://github.com/twbs/icons
541570
* **Elastic Icons**: from https://github.com/Crashedmind/PlantUML-Elastic-icons
542571
* **Domain Story**: from https://github.com/johthor/DomainStory-PlantUML
543572

script/generateOutput.pl

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,33 @@
99
use warnings;
1010
use feature qw(say);
1111

12+
# Optional filter: $ARGV[0]
13+
my $filter = $ARGV[0];
14+
1215
# Input dir:
1316
my @raw_files = glob("raw/*");
1417

1518
say("::group::Generate `x.repx` using brotli");
16-
foreach (@raw_files) {
17-
my $o = $_;
18-
$o =~ s/raw/output/;
19-
if (/abc.repx$/) {$o =~ s/abc.repx$/abx.repx/}
20-
if (/def.repx$/) {$o =~ s/def.repx$/dex.repx/}
21-
if (/ghi.repx$/) {$o =~ s/ghi.repx$/ghx.repx/}
22-
23-
say($_ . " --> " . $o);
24-
my $output = qx/brotli -q 11 -vf -o $o $_/;
19+
20+
foreach my $infile (@raw_files) {
21+
# If we have a filter, skip if no match before -abc.repx or -def.repx
22+
if (defined $filter) {
23+
next unless (
24+
$infile =~ m{raw/([^/]+)-abc\.repx$} && $1 eq $filter
25+
or $infile =~ m{raw/([^/]+)-def\.repx$} && $1 eq $filter
26+
);
27+
}
28+
29+
# Output filename logic:
30+
my $outfile = $infile;
31+
$outfile =~ s/raw/output/;
32+
$outfile =~ s/abc\.repx$/abx.repx/;
33+
$outfile =~ s/def\.repx$/dex.repx/;
34+
$outfile =~ s/ghi\.repx$/ghx.repx/;
35+
36+
say("$infile --> $outfile");
37+
my $output = qx/brotli -q 11 -vf -o $outfile $infile/;
2538
say($output);
2639
}
40+
2741
say("::endgroup::");

stdlib/bootstrap1.11.3/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/bootstrap-icons-*/
2+
/svg/
3+
/icons/
4+
*.png
5+
/individuals/
6+

stdlib/bootstrap1.11.3/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: bootstrap1.11.3
3+
display_name: Bootstrap
4+
description: Bootstrap Icons from Bootstrap
5+
author: The Bootstrap Authors
6+
version: 1.11.3
7+
release:
8+
license: MIT License
9+
source: https://github.com/twbs/icons
10+
origin:
11+
---
12+
13+
Information about the `bootstrap1.11.3` Standard Library.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@startuml
2+
!include <bootstrap1.11.3/bootstrap>
3+
4+
usecase a as "<$bi-globe>"
5+
usecase b as "<$bi-globe,scale=2.5>"
6+
usecase c as "<$bi-globe{scale=2.5}>" #line:red
7+
8+
usecase d as "<$bi-bootstrap-fill>"
9+
' TODO The following two lines will not work properly until this is fixed:
10+
' https://github.com/plantuml/plantuml/issues/2174#issuecomment-2848519961
11+
usecase e as "<$bi-bootstrap-fill{scale=2.5,color=blue}>"
12+
usecase f as "<$bi-bootstrap-fill,scale=2.5,color=#00f>"
13+
14+
@enduml
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@startuml
2+
!include <bootstrap1.11.3/bootstrap>
3+
listsprite
4+
@enduml
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env sh
2+
set -e
3+
4+
for i in *.sh; do
5+
echo 'Checking '$i
6+
checkbashisms $i
7+
done
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env sh
2+
set -e
3+
4+
cd ..
5+
if [ -d svg ] || [ -d icons ]; then
6+
exit 0
7+
fi
8+
VERSION=$(grep ^version README.md|awk '{print $2}')
9+
BASE=https://github.com/twbs/icons
10+
wget -q $BASE/releases/download/v$VERSION/bootstrap-icons-$VERSION.zip
11+
unzip -q bootstrap-icons-$VERSION.zip
12+
rm -f bootstrap-icons-$VERSION.zip
13+
mv bootstrap-icons-$VERSION/ svg
14+
rm -rf svg/bootstrap-icons.svg svg/font/
15+
wget -q $BASE/archive/refs/tags/v$VERSION.zip
16+
unzip -q v$VERSION.zip
17+
rm -f v$VERSION.zip
18+
mv icons-$VERSION/docs/content/icons .
19+
rm -rf icons-$VERSION
20+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env sh
2+
set -e
3+
4+
cd ..
5+
if [ ! -d svg ]; then
6+
exit 1
7+
fi
8+
9+
mkdir -p individuals
10+
echo '@startuml' > bootstrap.puml
11+
echo >> bootstrap.puml
12+
cd svg
13+
CONVERTED=0
14+
for i in *.svg; do
15+
NAME=$(basename $i .svg)
16+
# TODO Remove the following if-then once this SVG parsing issue is fiexed:
17+
# https://github.com/plantuml/plantuml-stdlib/pull/133#issuecomment-2847700969
18+
if [ "$NAME" = "filetype-cs" ] \
19+
|| [ "$NAME" = "filetype-css" ] \
20+
|| [ "$NAME" = "filetype-m4p" ] \
21+
|| [ "$NAME" = "filetype-pptx" ] \
22+
|| [ "$NAME" = "filetype-py" ] \
23+
|| [ "$NAME" = "filetype-sass" ] \
24+
|| [ "$NAME" = "filetype-scss" ] \
25+
|| [ "$NAME" = "filetype-" ] \
26+
|| [ "$NAME" = "filetype-" ] \
27+
|| [ "$NAME" = "filetype-" ] \
28+
|| [ "$NAME" = "filetype-" ]; then
29+
continue;
30+
fi
31+
echo -n 'sprite bi-'$NAME' ' >> ../bootstrap.puml
32+
cat $i \
33+
| sed -e 's/ xmlns="http:\/\/www\.w3\.org\/2000\/svg"//' \
34+
| sed -e 's/ fill=".*>/>/' \
35+
>> ../bootstrap.puml
36+
echo >> ../bootstrap.puml
37+
echo >> ../bootstrap.puml
38+
CONVERTED=$(($CONVERTED + 1))
39+
if [ $((CONVERTED % 100)) -eq 0 ]; then
40+
printf "%05d %s\n" "$CONVERTED" "$NAME"
41+
fi
42+
cat << EOF > ../individuals/$NAME.puml
43+
@startuml
44+
!include <bootstrap1.11.3/bootstrap>
45+
usecase a as "<\$bi-$NAME,scale=2.5>"
46+
@enduml
47+
EOF
48+
done
49+
if [ $((CONVERTED % 100)) -ne 0 ]; then
50+
printf "%05d %s\n" "$CONVERTED" "$NAME"
51+
fi
52+
echo '@enduml' >> ../bootstrap.puml
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env sh
2+
set -e
3+
4+
cd ..
5+
NAMEVERSION=$(pwd | sed 's!.*/!!')
6+
NAME=$(echo $NAMEVERSION | sed 's/[0-9.]//g')
7+
8+
if [ ! $NAME.puml ]; then
9+
exit 1
10+
fi
11+
12+
if ! which brotli >/dev/null 2>&1; then
13+
echo 'The command brotli is not found. Please, install its package.'
14+
exit 1
15+
fi
16+
17+
cd ../..
18+
./gradlew run
19+
perl -w script/generateOutput.pl $NAMEVERSION
20+
perl -w script/generateOutput.pl $NAME
21+
cp -f output/home.repx ../plantuml/src/main/resources/stdlib/
22+
cp -f output/$NAME*.repx ../plantuml/src/main/resources/stdlib/
23+
cd ../plantuml
24+
./gradlew jar
25+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env sh
2+
set -e
3+
4+
cd ..
5+
NAMEVERSION=$(pwd | sed 's!.*/!!')
6+
NAME=$(echo $NAMEVERSION | sed 's/[0-9.]//g')
7+
8+
if [ ! $NAME.puml ]; then
9+
exit 1
10+
fi
11+
12+
cd _examples_
13+
JAR=$(ls ../../../../plantuml/build/libs/*.jar | tail -1)
14+
# The followoing is on purpose not done via `-r .` as listsprites can fail.
15+
java -jar $JAR example.puml
16+
java -jar $JAR listsprite.puml
17+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env sh
2+
set -e
3+
4+
cd ..
5+
NAMEVERSION=$(pwd | sed 's!.*/!!')
6+
NAME=$(echo $NAMEVERSION | sed 's/[0-9.]//g')
7+
8+
if [ ! $NAME.puml ]; then
9+
exit 1
10+
fi
11+
12+
cd individuals
13+
JAR=$(ls ../../../../plantuml/build/libs/*.jar | tail -1)
14+
# TODO This option is useful https://github.com/plantuml/plantuml/issues/2176
15+
java -jar $JAR -r .
16+
file *png | grep ' x 703'
17+
# These files probably need to be excluded in 2_convert.sh
18+
19+
# Also view the results with an image viewer.
20+
# TODO What to do with extra large renderings sucha as arrow-clockwise, arrow-counterclockwise, power, search
21+
# TODO What to do withh different rendering for pairs such as compass, compass-fill
22+

0 commit comments

Comments
 (0)