mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-08-18 02:22:47 -07:00
docs-rst: auto-generate PDF image files
The PDF files that contain media images were actually generated offline from their SVG or PNG source files. Sphinx can handle PNG sources automatially. So, let's just drop their PDF counterparts. For SVG, however, Sphinx doesn't produce the right tags to use the TexLive SVG support. Also, the SVG support is done via shell execution, with is not nice. So, while we don't have any support for SVG inside Sphinx core or as an extension, move the logic to build them to Makefile, producing the PDF images on runtime. NOTE: due to the way Sphinx works, the PDF images should be generated inside the Kernel source tree, as otherwise Sphinx won't find it, not obeying what's specified by "O=" makefile parameter. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
1 parent
f390293479
commit
15a04d4e76
42 files changed
+60
-33
No files matched your search
@@ -54,7 +54,7 @@ loop_cmd = $(echo-cmd) $(cmd_$(1))
|
||||
# e.g. "media" for the linux-tv book-set at ./Documentation/media
|
||||
|
||||
quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
|
||||
cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media all;\
|
||||
cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media $2;\
|
||||
BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
|
||||
$(SPHINXBUILD) \
|
||||
-b $2 \
|
||||
@@ -98,6 +98,7 @@ installmandocs:
|
||||
|
||||
cleandocs:
|
||||
$(Q)rm -rf $(BUILDDIR)
|
||||
$(Q)$(MAKE) -C Documentation/media clean
|
||||
|
||||
endif # HAVE_SPHINX
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
*.pdf
|
||||
@@ -10,8 +10,35 @@ FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \
|
||||
|
||||
TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
|
||||
|
||||
.PHONY: all
|
||||
IMAGES = \
|
||||
typical_media_device.svg \
|
||||
uapi/dvb/dvbstb.svg \
|
||||
uapi/v4l/constraints.svg \
|
||||
uapi/v4l/subdev-image-processing-full.svg \
|
||||
uapi/v4l/subdev-image-processing-scaling-multi-source.svg \
|
||||
uapi/v4l/subdev-image-processing-crop.svg \
|
||||
|
||||
IMGTGT := $(patsubst %.png,%.pdf,$(patsubst %.svg,%.pdf,$(IMAGES)))
|
||||
IMGPDF := $(patsubst %,$(SRC_DIR)/%,$(IMGTGT))
|
||||
|
||||
cmd = $(echo-cmd) $(cmd_$(1))
|
||||
|
||||
quiet_cmd_genpdf = GENPDF $2
|
||||
cmd_genpdf = convert $2 $3
|
||||
|
||||
%.pdf: %.svg
|
||||
@$(call cmd,genpdf,$<,$@)
|
||||
|
||||
.PHONY: all html epub xml latex
|
||||
|
||||
all: $(BUILDDIR) ${TARGETS}
|
||||
html: all
|
||||
epub: all
|
||||
xml: all
|
||||
latex: $(IMGPDF) all
|
||||
|
||||
clean:
|
||||
-rm $(IMGTGT) 2>/dev/null
|
||||
|
||||
$(BUILDDIR):
|
||||
$(Q)mkdir -p $@
|
||||
|
||||
@@ -13,8 +13,8 @@ A typical media device hardware is shown at :ref:`typical_media_device`.
|
||||
|
||||
.. _typical_media_device:
|
||||
|
||||
.. figure:: media_api_files/typical_media_device.*
|
||||
:alt: typical_media_device.svg
|
||||
.. figure:: typical_media_device.*
|
||||
:alt: typical_media_device.pdf / typical_media_device.svg
|
||||
:align: center
|
||||
|
||||
Typical Media Device
|
||||
|
||||
Binary file not shown.
File renamed without changes.
File renamed without changes.
@@ -55,7 +55,7 @@ Overview
|
||||
|
||||
.. _stb_components:
|
||||
|
||||
.. figure:: intro_files/dvbstb.*
|
||||
.. figure:: dvbstb.*
|
||||
:alt: dvbstb.pdf / dvbstb.svg
|
||||
:align: center
|
||||
|
||||
|
||||
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -53,8 +53,8 @@ Cropping Structures
|
||||
|
||||
.. _crop-scale:
|
||||
|
||||
.. figure:: crop_files/crop.*
|
||||
:alt: crop.pdf / crop.gif
|
||||
.. figure:: crop.png
|
||||
:alt: crop.png
|
||||
:align: center
|
||||
|
||||
Image Cropping, Insertion and Scaling
|
||||
|
||||
Binary file not shown.
@@ -221,8 +221,8 @@ and always returns default parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does
|
||||
|
||||
.. _vbi-hsync:
|
||||
|
||||
.. figure:: dev-raw-vbi_files/vbi_hsync.*
|
||||
:alt: vbi_hsync.pdf / vbi_hsync.gif
|
||||
.. figure:: vbi_hsync.png
|
||||
:alt: vbi_hsync.png
|
||||
:align: center
|
||||
|
||||
**Figure 4.1. Line synchronization**
|
||||
@@ -230,8 +230,8 @@ and always returns default parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does
|
||||
|
||||
.. _vbi-525:
|
||||
|
||||
.. figure:: dev-raw-vbi_files/vbi_525.*
|
||||
:alt: vbi_525.pdf / vbi_525.gif
|
||||
.. figure:: vbi_525.png
|
||||
:alt: vbi_525.png
|
||||
:align: center
|
||||
|
||||
**Figure 4.2. ITU-R 525 line numbering (M/NTSC and M/PAL)**
|
||||
@@ -240,8 +240,8 @@ and always returns default parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does
|
||||
|
||||
.. _vbi-625:
|
||||
|
||||
.. figure:: dev-raw-vbi_files/vbi_625.*
|
||||
:alt: vbi_625.pdf / vbi_625.gif
|
||||
.. figure:: vbi_625.png
|
||||
:alt: vbi_625.png
|
||||
:align: center
|
||||
|
||||
**Figure 4.3. ITU-R 625 line numbering**
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -99,8 +99,8 @@ the video sensor and the host image processing hardware.
|
||||
|
||||
.. _pipeline-scaling:
|
||||
|
||||
.. figure:: dev-subdev_files/pipeline.*
|
||||
:alt: pipeline.pdf / pipeline.png
|
||||
.. figure:: pipeline.png
|
||||
:alt: pipeline.png
|
||||
:align: center
|
||||
|
||||
Image Format Negotiation on Pipelines
|
||||
@@ -404,8 +404,8 @@ selection will refer to the sink pad format dimensions instead.
|
||||
|
||||
.. _subdev-image-processing-crop:
|
||||
|
||||
.. figure:: dev-subdev_files/subdev-image-processing-crop.*
|
||||
:alt: subdev-image-processing-crop.svg
|
||||
.. figure:: subdev-image-processing-crop.*
|
||||
:alt: subdev-image-processing-crop.pdf / subdev-image-processing-crop.svg
|
||||
:align: center
|
||||
|
||||
**Figure 4.5. Image processing in subdevs: simple crop example**
|
||||
@@ -421,8 +421,8 @@ pad.
|
||||
|
||||
.. _subdev-image-processing-scaling-multi-source:
|
||||
|
||||
.. figure:: dev-subdev_files/subdev-image-processing-scaling-multi-source.*
|
||||
:alt: subdev-image-processing-scaling-multi-source.svg
|
||||
.. figure:: subdev-image-processing-scaling-multi-source.*
|
||||
:alt: subdev-image-processing-scaling-multi-source.pdf / subdev-image-processing-scaling-multi-source.svg
|
||||
:align: center
|
||||
|
||||
**Figure 4.6. Image processing in subdevs: scaling with multiple sources**
|
||||
@@ -437,8 +437,8 @@ an area at location specified by the source crop rectangle from it.
|
||||
|
||||
.. _subdev-image-processing-full:
|
||||
|
||||
.. figure:: dev-subdev_files/subdev-image-processing-full.*
|
||||
:alt: subdev-image-processing-full.svg
|
||||
.. figure:: subdev-image-processing-full.*
|
||||
:alt: subdev-image-processing-full.pdf / subdev-image-processing-full.svg
|
||||
:align: center
|
||||
|
||||
**Figure 4.7. Image processing in subdevs: scaling and composition with multiple sinks and sources**
|
||||
|
||||
Binary file not shown.
Loaded 20 of 42 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user