File: build_doc.sh

package info (click to toggle)
orange3 3.40.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,928 kB
  • sloc: python: 162,745; ansic: 622; makefile: 322; sh: 93; cpp: 77
file content (47 lines) | stat: -rw-r--r-- 1,497 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash

set -o pipefail
set -o errexit

# Ensure new images have indexed palettes
images="$(git diff --name-only origin/master..HEAD |
          grep -E '\bdoc/' | grep -iE '\.(png|jpg)$' || true )"
echo "Checking if images are indexed:"
while read image; do
    [ -f "$image" ] || continue
    if  [[ "$image" == *"_unindexed"* ]]; then
      continue
    fi
    imtype=$(identify -verbose "$image" | awk '/^ *Type: /{ print $2 }')
    echo "$image  $imtype"
    if ! echo "$imtype" | grep -Eq '(Palette|Grayscale)'; then
        echo "Error: image '$image' is not indexed or grayscale" >&2
        not_ok=1
    fi
done < <(echo "$images")
[ "$not_ok" ] && false
echo -e 'all ok\n'

SCRIPT_DIR=$(dirname "$BASH_SOURCE")
make html --directory "$SCRIPT_DIR"/development
make html --directory "$SCRIPT_DIR"/data-mining-library
make html --directory "$SCRIPT_DIR"/visual-programming

# check if the widget catalog in the repository (for orange-hugo is up to date
cd "$SCRIPT_DIR"
wget_command="wget -N https://raw.githubusercontent.com/biolab/orange-web2/main/scripts/create_widget_catalog.py"
run_command="python create_widget_catalog.py --categories Data,Transform,Visualize,Model,Evaluate,Unsupervised --doc visual-programming/source/"
eval "$wget_command"
eval "$run_command"
diff=$(git diff -- widgets.json)
echo "$diff"
if [ -n "$diff" ]
then
  echo "Widget catalog is stale. Rebuild it with:"
  echo "cd doc"
  echo "$wget_command"
  echo "$run_command"
  echo
  echo "$diff"
  exit 1
fi