-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.bat
More file actions
106 lines (89 loc) · 2.56 KB
/
Copy pathmake.bat
File metadata and controls
106 lines (89 loc) · 2.56 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
@ECHO OFF
REM Windows equivalent of the Makefile targets.
pushd %~dp0
if "%PYTHON%" == "" (set PYTHON=python)
if "%BUILDDIR%" == "" (set BUILDDIR=_build)
set SPHINXOPTS=-W --keep-going
if "%1" == "" goto help
if "%1" == "help" goto help
if "%1" == "validate" goto validate
if "%1" == "schema" goto schema
if "%1" == "export" goto export
if "%1" == "pages" goto pages
if "%1" == "thumbnails" goto thumbnails
if "%1" == "homepage" goto homepage
if "%1" == "generate" goto generate
if "%1" == "lint" goto lint
if "%1" == "test" goto test
if "%1" == "html" goto html
if "%1" == "html-noplot" goto htmlnoplot
if "%1" == "clean" goto clean
echo Unknown target "%1". Run "make help".
goto end
:help
echo validate check catalog, metadata, schema and thumbnails agree
echo schema regenerate the metadata JSON schema
echo export regenerate the landing-page + _static tutorials.json
echo pages regenerate the per-domain pages
echo thumbnails regenerate the placeholder SVG thumbnails
echo homepage regenerate the homepage/list-page partials
echo generate run every generator
echo lint run pre-commit on all files
echo test run the script unit tests
echo html full build, executing runnable tutorials
echo html-noplot fast build with no tutorial execution
echo clean remove build artefacts
goto end
:validate
%PYTHON% scripts\generate_schema.py --check
if errorlevel 1 goto end
%PYTHON% scripts\validate_catalog.py
if errorlevel 1 goto end
%PYTHON% scripts\generate_thumbnails.py --check
goto end
:schema
%PYTHON% scripts\generate_schema.py
goto end
:export
%PYTHON% scripts\export_landing_page.py
goto end
:pages
%PYTHON% scripts\generate_bucket_pages.py
goto end
:thumbnails
%PYTHON% scripts\generate_thumbnails.py
goto end
:homepage
%PYTHON% scripts\generate_homepage.py
goto end
:generate
%PYTHON% scripts\generate_thumbnails.py
%PYTHON% scripts\generate_homepage.py
%PYTHON% scripts\generate_bucket_pages.py
%PYTHON% scripts\export_landing_page.py
goto end
:lint
pre-commit run --all-files
goto end
:test
%PYTHON% -m pytest
goto end
:html
call "%~f0" generate
%PYTHON% -m sphinx -b html %SPHINXOPTS% . %BUILDDIR%\html
goto end
:htmlnoplot
call "%~f0" generate
set TUTORIALS_NOPLOT=1
%PYTHON% -m sphinx -b html %SPHINXOPTS% . %BUILDDIR%\html
set TUTORIALS_NOPLOT=
goto end
:clean
if exist %BUILDDIR% rmdir /s /q %BUILDDIR%
if exist _gallery rmdir /s /q _gallery
if exist _pages rmdir /s /q _pages
if exist _generated rmdir /s /q _generated
if exist sg_execution_times.rst del /q sg_execution_times.rst
goto end
:end
popd