File tree Expand file tree Collapse file tree 4 files changed +46
-2
lines changed
Filter options
Expand file tree Collapse file tree 4 files changed +46
-2
lines changed
Original file line number Diff line number Diff line change @@ -2,4 +2,5 @@ tmp.gnuplot
2
2
* .gif
3
3
* .png
4
4
* .svg
5
+ /web
5
6
* .zip
Original file line number Diff line number Diff line change @@ -5,6 +5,18 @@ before_install:
5
5
# Fails because gnuplot is too old there.
6
6
# - sudo apt-get update -qq
7
7
# - sudo apt-get install gnuplot-x11
8
+ after_success : |
9
+ if [ -n "$GITHUB_API_KEY" ]; then
10
+ cd "$TRAVIS_BUILD_DIR"
11
+ make web
12
+ cd web
13
+ git init
14
+ git checkout -b gh-pages
15
+ git add .
16
+ git -c user.name='travis' -c user.email='travis' commit -m init
17
+ git push -f https://cirosantilli:$GITHUB_API_KEY@github.com/cirosantilli/gnuplot-examples-gh-pages gh-pages
18
+ cd "$TRAVIS_BUILD_DIR"
19
+ fi
8
20
script :
9
21
- gnuplot --version
10
22
- make zip
Original file line number Diff line number Diff line change 3
3
IN_EXT ?= .gnuplot
4
4
GIF_EXT ?= .gif
5
5
PNG_EXT ?= .png
6
+ WEB ?= web
6
7
ZIP ?= gnuplot-examples.zip
7
8
8
9
GIFS := $(patsubst % $(GIF_EXT )$(IN_EXT ) ,% $(GIF_EXT ) ,$(wildcard * $(IN_EXT ) ) )
9
10
PNGS := $(patsubst % $(IN_EXT ) ,% $(PNG_EXT ) ,$(wildcard * $(IN_EXT ) ) )
10
11
# Remove some special files that should not be rendered.
11
12
PNGS := $(filter-out main$(PNG_EXT ) template$(PNG_EXT ) ,$(PNGS ) )
12
13
13
- .PHONY : clean
14
+ .PHONY : clean web zip
14
15
15
16
all : $(PNGS ) $(GIFS )
16
17
@@ -21,7 +22,12 @@ all: $(PNGS) $(GIFS)
21
22
gnuplot -e ' set terminal gif animate delay 10' -e ' set output "$@"' ' $<'
22
23
23
24
clean :
24
- rm -f * $(GIF_EXT ) * $(PNG_EXT ) ' $(ZIP)'
25
+ rm -fr * $(GIF_EXT ) * $(PNG_EXT ) ' $(ZIP)' ' $(WEB)'
26
+
27
+ web : all
28
+ mkdir -p ' $(WEB)'
29
+ cp * $(GIF_EXT ) * $(PNG_EXT ) ' $(WEB)'
30
+ ./make-web ' $(WEB)'
25
31
26
32
zip : all
27
33
rm -f ' $(ZIP)'
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ dir=" $1 "
4
+ index=" index.html"
5
+ cd " $1 "
6
+ imgs=*
7
+
8
+ printf ' <!DOCTYPE html>
9
+ <html lang="en">
10
+ <head>
11
+ <meta charset="utf-8"/>
12
+ <title>Gnuplot Examples</title>
13
+ </head>
14
+ <body>
15
+ <h1>Gnuplot Examples</h1>
16
+ ' > " $index "
17
+
18
+ for img in $imgs ; do
19
+ echo " <p>$img </p>" >> " $index "
20
+ echo " <img src=\" $img \" />" >> " $index "
21
+ done
22
+
23
+ printf ' </body>
24
+ </html>
25
+ ' >> " $index "
You can’t perform that action at this time.
0 commit comments