doc: integrate image rendering into makefiles

This makes it so that `make -C doc` works to build all of the docs in a single command.

there are still a few problems with this:
1. the build does not fail if the correct fonts are not found
2. the images are only generated via the makefile, so trying to build the docs by other methods won't work
This commit is contained in:
David Lechner
2019-02-08 13:25:55 -06:00
parent 0423530af6
commit 2b67a3a10d
20 changed files with 25 additions and 16 deletions
+1
View File
@@ -17,4 +17,5 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(MAKE) -C source/_images `[ "$@" = "clean" ] && echo clean || echo all`
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+14
View File
@@ -0,0 +1,14 @@
SRC_DIR = .
OUT_DIR = ../images
SVG := $(wildcard $(SRC_DIR)/*.svg)
PNG := $(patsubst $(SRC_DIR)/%.svg,$(OUT_DIR)/%.png,$(SVG))
all: $(PNG)
clean:
rm -f $(PNG)
$(OUT_DIR)/%.png: $(SRC_DIR)/%.svg
inkscape --file=$< --export-area-drawing --export-png=$@

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 140 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

+3
View File
@@ -0,0 +1,3 @@
*.png
!pybricks-logo-large.png
!pybricks-logo-small.png
-9
View File
@@ -1,9 +0,0 @@
#!/usr/bin/env bash
rm -rf build
mkdir build
for filenamedotext in *.svg; do
filename=$(echo "$filenamedotext" | cut -f 1 -d '.')
inkscape --file=$filename.svg --export-area-drawing --export-png=build/$filename.png
done
+3 -3
View File
@@ -4,7 +4,7 @@ Installation
This page shows how you prepare your computer and the EV3 brick for writing and running Python programs. The final configuration is shown in the figure below.
.. figure:: images/build/overview.png
.. figure:: images/overview.png
.. Caption
@@ -34,7 +34,7 @@ You will be writing your Python programs using Visual Studio Code. You can downl
3. Download the `EV3 Python extension <.>`_. Follow the steps in the diagram below to install it.
4. Close Visual Studio Code and open it again to activate the extensions.
.. image:: images/build/vsix.png
.. image:: images/vsix.png
Preparing the SD Card
-----------------------------------------------------------
@@ -47,7 +47,7 @@ You will now follow a series of steps to download and install the EV3 Python fir
3. Insert the micro SD card into your computer or card reader.
4. Launch the etcher program and follow the steps on your screen to install the firmware file you have just downloaded. Do not remove the card until the installation process is complete.
5. Turn the EV3 brick off if it is currently on.
6. Put the micro SD card in the SD card slot of the EV3 brick.
6. Put the micro SD card in the SD card slot of the EV3 brick.
Using the EV3 brick
+4 -4
View File
@@ -4,14 +4,14 @@ Creating and running programs
Starting a new project
-----------------------------------------------------------
.. image:: images/build/newproject.png
.. image:: images/newproject.png
Example text
Understanding projects folder and files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: images/build/projectoverview.png
.. image:: images/projectoverview.png
Example text
@@ -25,14 +25,14 @@ Running a program
Connecting the EV3 brick and the computer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: images/build/connecting.png
.. image:: images/connecting.png
Example text
Downloading and running a program
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: images/build/running.png
.. image:: images/running.png
Example text