Skip to content

Commit 0313e1b

Browse files
committed
chore: replace screenshots set by generated asset
Replace externally generated jpg set of screenshots by source SVG asset linked to raw screenshots and generate PNG/webp bitmaps used in README.md and docs. This way, update raw screenshots and running update-assets is enough to keep all assets aligned.
1 parent f94f7fa commit 0313e1b

File tree

11 files changed

+177
-6
lines changed

11 files changed

+177
-6
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ RacksDB provides multiple interfaces to request the database with its
6262

6363
<p align="center">
6464
<img
65-
src="assets/racksdb_web_ui.jpg"
66-
alt="RacksDB Web-UI"
65+
src="assets/screenshots/assemblies/bitmaps/screenshots-small.webp"
66+
alt="RacksDB web UI"
6767
width="600px"
6868
style="margin: 0 auto;">
6969
<p>

Diff for: assets/racksdb_web_ui.jpg

-241 KB
Binary file not shown.
78.1 KB
Loading
14.5 KB
Binary file not shown.

Diff for: assets/screenshots/assemblies/screenshots.svg

+147
Loading

Diff for: assets/screenshots/build.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
---
2+
# Define DPI/sizes for which PNG bitmaps version of assemblies must be
3+
# generated.
4+
assemblies:
5+
screenshots.svg:
6+
- small
27
# List raw screenshots for which versions with dropped shadow must be generated.
38
shadowed:
49
- home.png

Diff for: assets/update-assets

+20-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ BITMAPS_DIR = "bitmaps"
2525
SCALABLES_DIR = "scalables"
2626
SCREENSHOTS_DIR = "screenshots"
2727
RAW_DIR = "raw"
28+
ASSEMBLIES_DIR = "assemblies"
2829
SHADOWED_DIR = "shadowed"
2930
FAVICON_SIZES = [256, 64, 48, 32, 16]
3031

@@ -49,8 +50,10 @@ def main():
4950
builder.build(outputs=[svg], rule=f"svg-plain-{output}", inputs=[branding])
5051
builder.run()
5152

52-
# Then generate bitmaps and favicon
53+
# Generate bitmaps and favicon
5354
builder = NinjaBuilder()
55+
56+
# Rules for bitmaps
5457
for size, dpi in DPI_SIZES.items():
5558
builder.rule(
5659
name=f"png-{size}",
@@ -83,6 +86,7 @@ def main():
8386
ico = branding.parent / BITMAPS_DIR / "favicon.ico"
8487
builder.build(outputs=[ico], rule="favicon", inputs=[branding])
8588

89+
# Load assemblies and bitmaps generation rules
8690
with open(Path(SCREENSHOTS_DIR) / "build.yaml") as fh:
8791
rules = yaml.safe_load(fh.read())
8892

@@ -98,6 +102,11 @@ def main():
98102
),
99103
)
100104

105+
builder.rule(
106+
name="convert",
107+
command=("convert $in $out"),
108+
)
109+
101110
raws = rules["shadowed"]
102111
for raw_s in raws:
103112
raw = Path(SCREENSHOTS_DIR) / RAW_DIR / raw_s
@@ -106,6 +115,16 @@ def main():
106115
)
107116
builder.build(outputs=[shadowed], rule="shadow", inputs=[raw])
108117

118+
# Generate bitmaps versions of assemblies
119+
assemblies = rules["assemblies"]
120+
for assembly_s, sizes in assemblies.items():
121+
assembly = Path(SCREENSHOTS_DIR) / ASSEMBLIES_DIR / assembly_s
122+
for size in sizes:
123+
png = assembly.parent / BITMAPS_DIR / f"{assembly.stem}-{size}.png"
124+
webp = png.with_suffix(".webp")
125+
builder.build(outputs=[png], rule=f"png-{size}", inputs=[assembly])
126+
builder.build(outputs=[webp], rule="convert", inputs=[png])
127+
109128
builder.run()
110129

111130

Diff for: docs/modules/overview/images/racksdb_web_ui.jpg

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../assets/screenshots/assemblies/bitmaps/screenshots-small.webp

Diff for: docs/modules/overview/pages/overview.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Once the database is defined, data can be searched and extracted using the
5656
xref:usage:racksdb.adoc[`racksdb` CLI]. A xref:usage:ui.adoc[Web UI] is also
5757
available to explore its content.
5858

59-
image::overview:racksdb_web_ui.jpg[RacksDB Web UI,width=400]
59+
image::overview:racksdb_web_ui_screenshots.webp[RacksDB Web UI,width=600]
6060

6161
For full integration with your software, a xref:usage:lib.adoc[Python library]
6262
and a xref:usage:rest.adoc[REST API] can also be used to stay continuously

Diff for: docs/modules/overview/pages/start.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ Advanced detailed informations are available:
2323
* icon:mouse-pointer[] xref:usage:ui.adoc[Web UI user guide]
2424
* icon:maximize[] xref:db:ext.adoc[Schema extension howto]
2525
26-
image::overview:racksdb_web_ui.jpg[RacksDB Web UI]
26+
image::overview:racksdb_web_ui_screenshots.webp[RacksDB Web UI]

0 commit comments

Comments
 (0)