]> git.proxmox.com Git - pve-docs.git/blobdiff - Makefile
mediawiki.conf: implement thumbnail attribute
[pve-docs.git] / Makefile
index 36537204804034e2ff8881a46750a9e27fcfae63..ed5097bf5517764cfa878f0c3acbb8b77eb6bcbd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,12 @@
 DGDIR=.
 ASCIIDOC_PVE=./asciidoc-pve
 
-include ./pve-doc-generator.mk
-
 GEN_PACKAGE=pve-doc-generator
 DOC_PACKAGE=pve-docs
 MEDIAWIKI_PACKAGE=pve-docs-mediawiki
 
 # also update debian/changelog
-PKGREL=8
+PKGREL=13
 
 GITVERSION:=$(shell cat .git/refs/heads/master)
 
@@ -18,18 +16,29 @@ GEN_DEB=${GEN_PACKAGE}_${DOCRELEASE}-${PKGREL}_${ARCH}.deb
 DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
 MEDIAWIKI_DEB=${MEDIAWIKI_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
 
+
 all: index.html
 
-.pve-doc-depends link-refs.json: $(wildcard *.adoc) scan-adoc-refs
-       ./scan-adoc-refs *.adoc --depends .pve-doc-depends > link-refs.json
+.PHONY: verify-images
+verify-images:
+       for i in ./images/screenshot/*.png; do ./png-verify.pl $$i; done
 
-include .pve-doc-depends
+ADOC_SOURCES_GUESS=$(filter-out %-synopsis.adoc %-opts.adoc %-table.adoc, $(wildcard *.adoc))
+.pve-doc-depends link-refs.json: ${ADOC_SOURCES_GUESS} scan-adoc-refs
+       ./scan-adoc-refs *.adoc --depends .pve-doc-depends.tmp > link-refs.json.tmp
+       @cmp --quiet .pve-doc-depends .pve-doc-depends.tmp || mv .pve-doc-depends.tmp .pve-doc-depends
+       @cmp --quiet link-refs.json link-refs.json.tmp || mv link-refs.json.tmp link-refs.json
+
+pve-doc-generator.mk: .pve-doc-depends pve-doc-generator.mk.in
+       cat pve-doc-generator.mk.in .pve-doc-depends > $@.tmp
+       mv $@.tmp $@
+
+include ./pve-doc-generator.mk
 
 GEN_DEB_SOURCES=                               \
        pve-doc-generator.mk                    \
        ${MANUAL_SOURCES}                       \
-       ${PVESM_ADOCSOURCES}                    \
-       pmxcfs.8-cli.adoc                       \
+       pmxcfs.8-synopsis.adoc                  \
        docinfo.xml
 
 GEN_SCRIPTS=                                   \
@@ -63,9 +72,13 @@ pve-docs-mediawiki-import: pve-docs-mediawiki-import.in link-refs.json
 INDEX_INCLUDES=                                                                \
        pve-admin-guide.pdf                                             \
        pve-admin-guide.epub                                            \
+       chapter-index-table.adoc                                        \
+       man1-index-table.adoc                                           \
+       man5-index-table.adoc                                           \
+       man8-index-table.adoc                                           \
        $(sort $(addsuffix .html, ${MANUAL_PAGES}) ${CHAPTER_LIST})
 
-ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}"
+ADOC_STDARG= -b html5 -a icons -a data-uri -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}"
 
 BROWSER?=xdg-open
 
@@ -73,27 +86,6 @@ BROWSER?=xdg-open
 %-nwdiag.svg: %.nwdiag
        nwdiag -T svg $*.nwdiag -o $@;
 
-%-plain.html: asciidoc-pve %.adoc
-       ./asciidoc-pve compile-wiki -o $@ $*.adoc
-
-chapter-%.html: %.adoc asciidoc-pve ${PVE_COMMON_DOC_SOURCES}
-       ./asciidoc-pve compile-chapter -o $@ $*.adoc
-
-%.1.html: %.adoc %.1-synopsis.adoc asciidoc-pve ${PVE_COMMON_DOC_SOURCES}
-       ./asciidoc-pve compile-man-html -o $@ $*.adoc
-
-pmxcfs.8.html: pmxcfs.adoc pmxcfs.8-cli.adoc asciidoc-pve ${PVE_COMMON_DOC_SOURCES}
-       ./asciidoc-pve compile-man-html -o $@ pmxcfs.adoc
-
-%.8.html: %.adoc %.8-synopsis.adoc asciidoc-pve ${PVE_COMMON_DOC_SOURCES}
-       ./asciidoc-pve compile-man-html -o $@ $*.adoc
-
-%.5.html: %.adoc %.5-opts.adoc asciidoc-pve ${PVE_COMMON_DOC_SOURCES}
-       ./asciidoc-pve compile-man-html -o $@ $*.adoc
-
-%.5-plain.html: %.adoc %.5-opts.adoc asciidoc-pve ${PVE_COMMON_DOC_SOURCES}
-       ./asciidoc-pve compile-man-wiki -o $@ $*.adoc
-
 README.html: README.adoc
        asciidoc ${ADOC_STDARG} -o $@ $<
 
@@ -101,11 +93,27 @@ README.html: README.adoc
 index: index.html
        $(BROWSER) index.html &
 
-index.html: index.adoc ${API_VIEWER_SOURCES} ${INDEX_INCLUDES} 
-       asciidoc -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" index.adoc
+chapter-index-table.adoc: asciidoc-pve
+       ./asciidoc-pve chapter-table >$@.tmp
+       mv $@.tmp $@
+
+man1-index-table.adoc: asciidoc-pve
+       ./asciidoc-pve man1page-table >$@.tmp
+       mv $@.tmp $@
+
+man5-index-table.adoc: asciidoc-pve
+       ./asciidoc-pve man5page-table >$@.tmp
+       mv $@.tmp $@
+
+man8-index-table.adoc: asciidoc-pve
+       ./asciidoc-pve man8page-table >$@.tmp
+       mv $@.tmp $@
+
+index.html: index.adoc ${API_VIEWER_SOURCES} ${INDEX_INCLUDES}
+       asciidoc ${ADOC_STDARG} -o $@ index.adoc
 
 pve-admin-guide.html: ${PVE_ADMIN_GUIDE_ADOCDEPENDS}
-       asciidoc -a pvelogo -a "revnumber=${DOCRELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc
+       asciidoc -a pvelogo ${ADOC_STDARG} pve-admin-guide.adoc
 
 pve-admin-guide.chunked: ${PVE_ADMIN_GUIDE_ADOCDEPENDS}
        rm -rf pve-admin-guide.chunked
@@ -115,7 +123,7 @@ pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_ADOCDEPENDS} docinfo.xml pve-admin-guide-
        inkscape -z -D --export-pdf=proxmox-logo.pdf images/proxmox-logo.svg
        inkscape -z -D --export-pdf=proxmox-ci-header.pdf images/proxmox-ci-header.svg
        grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in  pve-admin-guide-docinfo.xml" && false);
-       a2x -a docinfo -a docinfo1 -f pdf -L --dblatex-opts "-P latex.output.revhistory=0" --dblatex-opts "-P latex.class.options=12pt" --dblatex-opts "-P doc.section.depth=2 -P toc.section.depth=2" --dblatex-opts "-P doc.publisher.show=0 -s asciidoc-dblatex-custom.sty" pve-admin-guide.adoc
+       a2x -a docinfo -a docinfo1 -f pdf -L --dblatex-opts "-p ./asciidoc/pve-dblatex.xsl -s asciidoc/dblatex-custom.sty" pve-admin-guide.adoc
        rm proxmox-logo.pdf proxmox-ci-header.pdf
 
 pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_ADOCDEPENDS}
@@ -136,7 +144,7 @@ deb:
        rm -f ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
        make ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB};
 
-${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPORTS} ${API_VIEWER_SOURCES} ${GEN_DEB_SOURCES} asciidoc-pve pve-docs-mediawiki-import
+${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPORTS} ${API_VIEWER_SOURCES} ${GEN_DEB_SOURCES} asciidoc-pve pve-docs-mediawiki-import asciidoc/mediawiki.conf verify-images
        rm -rf build
        mkdir build
        rsync -a debian/ build/debian
@@ -148,12 +156,18 @@ ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}: index.html ${INDEX_INCLUDES} ${WIKI_IMPO
        mkdir -p build/usr/bin
        install -m 0644 ${GEN_DEB_SOURCES} build/usr/share/${GEN_PACKAGE}
        install -m 0755 ${GEN_SCRIPTS} build/usr/share/${GEN_PACKAGE}
+       # install asciidoc-pve
        install -m 0755 asciidoc-pve build/usr/bin/
+       install -D -m 0644 asciidoc/mediawiki.conf build/usr/share/${GEN_PACKAGE}/asciidoc/mediawiki.conf
+       install -m 0644 asciidoc/asciidoc-pve.conf build/usr/share/${GEN_PACKAGE}/asciidoc/
        # install files for pvedocs package
        mkdir -p build/usr/share/${DOC_PACKAGE}
        mkdir -p build/usr/share/doc/${DOC_PACKAGE}
        install -m 0644 index.html ${INDEX_INCLUDES} build/usr/share/${DOC_PACKAGE}
        install -m 0644 ${WIKI_IMPORTS} build/usr/share/${DOC_PACKAGE}
+       # install screenshot images
+       mkdir -p build/usr/share/${DOC_PACKAGE}/images/screenshot
+       install -m 0644 images/screenshot/*.png build/usr/share/${DOC_PACKAGE}/images/screenshot
        # install api doc viewer
        mkdir build/usr/share/${DOC_PACKAGE}/api-viewer
        install -m 0644 ${API_VIEWER_SOURCES} build/usr/share/${DOC_PACKAGE}/api-viewer
@@ -169,11 +183,11 @@ upload: ${GEN_DEB} ${DOC_DEB} ${MEDIAWIKI_DEB}
 
 .PHONY: update
 update: clean
-       rm -f *.5-opts.adoc *.1-synopsis.adoc *.8-synopsis.adoc
+       find . -regex '.*-\(opts\|synopsis\)\.adoc' -not -name pmxcfs.8-synopsis.adoc -exec rm -f \{\} \;
        rm -f api-viewer/apidata.js
        rm -f pve-firewall-macros.adoc pct-network-opts.adoc pct-mountpoint-opts.adoc
        make all
 
 clean: 
-       rm -rf *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidoc.js chapter-*.html *-plain.html chapter-*.html pve-admin-guide.chunked asciidoc-pve link-refs.json .asciidoc-pve-tmp_* pve-docs-mediawiki-import
+       rm -rf *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidoc.js chapter-*.html *-plain.html chapter-*.html pve-admin-guide.chunked asciidoc-pve link-refs.json .asciidoc-pve-tmp_* pve-docs-mediawiki-import .pve-doc-depends pve-doc-generator.mk chapter-index-table.adoc man1-index-table.adoc man5-index-table.adoc man8-index-table.adoc
        find . -name '*~' -exec rm {} ';'