1- # # -*- coding: utf-8 -*-
2- # # Copyright 2019 United Kingdom Research and Innovation
3- # # Copyright 2019 The University of Manchester
4- # #
5- # # Licensed under the Apache License, Version 2.0 (the "License");
6- # # you may not use this file except in compliance with the License.
7- # # You may obtain a copy of the License at
8- # #
9- # # http://www.apache.org/licenses/LICENSE-2.0
10- # #
11- # # Unless required by applicable law or agreed to in writing, software
12- # # distributed under the License is distributed on an "AS IS" BASIS,
13- # # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14- # # See the License for the specific language governing permissions and
15- # # limitations under the License.
16- # #
17- # # Authors:
18- # # CIL Developers, listed at: https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt
19-
20- # Minimal makefile for Sphinx documentation
21- #
22-
231# You can set these variables from the command line.
2+ JEKYLLOPTS =
3+ JEKYLLBUILD = bundle exec jekyll build
4+ JEKYLLSRCDIR = pages
245SPHINXOPTS =
256SPHINXBUILD = sphinx-build
267SOURCEDIR = source
278BUILDDIR = build
28-
29- # Put it first so that "make" without argument is like "make help".
9+ BUILDSUBDIR = $(shell git rev-parse --abbrev-ref HEAD)
3010help :
3111 @$(SPHINXBUILD ) -M help " $( SOURCEDIR) " " $( BUILDDIR) " $(SPHINXOPTS ) $(O )
12+ @echo extra options
13+ @echo ' web-deps to install website dependencies'
14+ @echo ' web to build website'
15+ @echo ' dirhtml to build docs'
16+ @echo ' serve to serve website & docs'
17+ .PHONY : help Makefile serve web-deps web dirhtml
3218
33- .PHONY : help Makefile
19+ serve :
20+ @python -m http.server -d " $( BUILDDIR) "
21+ web-deps :
22+ @bundle install
23+ web :
24+ @$(JEKYLLBUILD ) -s " $( JEKYLLSRCDIR) " $(JEKYLLOPTS )
25+ @ls " $( JEKYLLSRCDIR) " /* .md | xargs -II basename I .md | xargs -II rm -rf " $( BUILDDIR) /I"
26+ @rm -rf " $( BUILDDIR) /assets"
27+ @mv _site/* " $( BUILDDIR) /"
28+ dirhtml :
29+ @rm -rf " $( BUILDDIR) /$( BUILDSUBDIR) "
30+ @$(SPHINXBUILD ) -b dirhtml $(SPHINXOPTS ) " $( SOURCEDIR) " " $( BUILDDIR) /$( BUILDSUBDIR) "
31+ @./mkversions.py
3432
3533# Catch-all target: route all unknown targets to Sphinx using the new
3634# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
3735% : Makefile
38- @$(SPHINXBUILD ) -M $@ " $( SOURCEDIR) " " $( BUILDDIR) " $(SPHINXOPTS ) $(O )
36+ @$(SPHINXBUILD ) -M $@ " $( SOURCEDIR) " " $( BUILDDIR) " $(SPHINXOPTS ) $(O )
0 commit comments