FreedomBox/doc/Makefile
Sunil Mohan Adapa ef2d3a4787 doc: Fetch manual from the Wiki
- Already reorganised the manual page on the wiki for this purpose.

- Fix several issues with the Docbook export of MoinMoin.

  - Replace / in title with a space.

  - Remove revision history.

  - Convert image dimensions to points from pixels.

  - Fix incorrect wiki paths.

- Implement mechnism for downloading images and using them with
  relative paths.

- Remove the old way of compiling the manual.  Its contents are mostly
  not applicable for end users.  Design documents are outdated.  INSTALL
  and HACKING talk about Plinth installation not FreedomBox in general.
  A fresh man page will be written later.
2015-09-27 09:49:45 -04:00

66 lines
2.1 KiB
Makefile

#!/usr/bin/make -f
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
MANUAL_URL="https://wiki.debian.org/FreedomBox/Manual?action=show&mimetype=text%2Fdocbook"
OUTPUTS=freedombox-manual.pdf freedombox-manual.html freedombox-manual.part.html
all: $(OUTPUTS)
# Do not edit the manual page in this directory. The manual is
# maintained as separate pages on the FreedomBox wiki and aggregated
# into a single page using the MoinMoin include feature. Then it is
# exported as Docbook format and kept here.
#
# It is important to keep a copy of the manual in this source tree
# because Debian packages promise an entire source tree including the
# documentation.
#
# Use 'make fetch' to retrieve the latest manual from the wiki and
# commit it to the repository. The wiki page is already reviewed, so
# commits that update the manual just using the 'fetch' target do not
# require further reviews.
.PHONY: fetch
fetch:
wget --quiet -O - $(MANUAL_URL) | \
xmllint --format --output freedombox-manual.raw.xml -
xsltproc --output freedombox-manual.xml fixes.xslt freedombox-manual.raw.xml
xsltproc fetch-images.xslt freedombox-manual.raw.xml | sort -u | \
awk '{print "wget --quiet -O images/" $$1 " " $$2}' | sh
rm -f freedombox-manual.raw.xml
%.pdf: %.xml
xmlto --with-dblatex pdf $<
%.part.html: %.html
perl -pe 'BEGIN {undef $/} s/.*<body[^>]*>(.*)<\/body>.*/$1/s' $< > $@
%.html: %.xml
xmlto html-nochunks $<
.PHONY: clean
clean:
rm -f $(OUTPUTS)