Skip to content

Commit 89241ea

Browse files
committed
Initial Commit
0 parents  commit 89241ea

23 files changed

+1281
-0
lines changed

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM ubuntu:20.04
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
5+
RUN apt-get update && \
6+
apt-get install -y build-essential ghostscript libpng-dev libgd-dev fontconfig libgs-dev libpango1.0-dev libexpat-dev wget tar curl git
7+
8+
ADD fonts /usr/local/share/fonts/
9+
10+
RUN fc-cache -f -v && \
11+
fc-list
12+
13+
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - && \
14+
apt-get install -y nodejs
15+
16+
ADD sketchviz /sketchviz/
17+
18+
RUN cd /sketchviz && \
19+
npm install
20+
21+
RUN apt-get install -y ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils
22+
23+
RUN wget -O - https://gitlab.com/graphviz/graphviz/-/package_files/7097037/download | tar Jxv -C /tmp && \
24+
cd /tmp/graphviz-2.46.1 && \
25+
./configure --enable-swig=no && make && make install && \
26+
cd / && \
27+
rm -rf /tmp/graphviz-2.46.1

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Sketchviz Docker
2+
3+
Inspired by `sketchviz.com` (although unaffiliated).
4+
5+
This container bundles Graphviz, a script using [RoughJS](https://www.npmjs.com/package/roughjs) to "draw" the graphs, then tooling needed to convert from `SVG -> PNG`.
6+
7+
Tested with BitBucket Pipelines, see [example script](examples/build_diagrams.sh).

examples/build_diagrams.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
echo "Generating svgs..."
4+
find . -type f -name "*.dot" -exec sh -c 'dot -Tsvg "${0}" -o "${0%.*}.svg"' {} \;
5+
6+
echo "Generating sketchy svgs..."
7+
find . -type f -name "*.svg" -exec sh -c 'git add "${0}"; git diff --cached --exit-code --quiet "${0}" || node /sketchviz/roughen.js "${0}" "${0%.*}.rough.svg"' {} \;
8+
9+
echo "Generating pngs from those svgs..."
10+
find . -type f -name "*.rough.svg" -exec sh -c 'node /sketchviz/node_modules/svgexport/bin/index.js "${0}" "${0%.*.*}.png"' {} \;
11+
12+
echo "Deleting the sketchy svgs..."
13+
find . -type f -name "*.rough.svg" -exec sh -c 'rm "${0}"' {} \;

fonts/Handlee-Regular.ttf

36.9 KB
Binary file not shown.

fonts/OpenSans-Bold.ttf

102 KB
Binary file not shown.

fonts/OpenSans-BoldItalic.ttf

90.5 KB
Binary file not shown.

fonts/OpenSans-ExtraBold.ttf

99.7 KB
Binary file not shown.

fonts/OpenSans-ExtraBoldItalic.ttf

90.6 KB
Binary file not shown.

fonts/OpenSans-Italic.ttf

90.1 KB
Binary file not shown.

fonts/OpenSans-Light.ttf

99.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)