Gentoo Archives: gentoo-catalyst

From: wking@×××××××.us
To: Catalyst <gentoo-catalyst@l.g.o>
Cc: "W. Trevor King" <wking@×××××××.us>
Subject: [gentoo-catalyst] [PATCH] Makefile: Use asciidoc and Pandoc to generate MediaWiki doc versions
Date: Thu, 30 Jan 2014 00:54:47
Message-Id: b7bfcf4c2e33c446fd7033fe4dc4f418585477d9.1391043085.git.wking@tremily.us
1 We need this because hosting content under:
2
3 https://www.gentoo.org/proj/
4
5 is deprecated, with per-project documentation migrating to the wiki [1]
6
7 * `--attribute 'toc!'` disables AsciiDoc's table of contents [2],
8 which Pandoc doesn't like.
9 * The Pandoc invocation is about as basic as it gets [3].
10
11 [1]: https://wiki.gentoo.org/wiki/Gentoo_Wiki:Developer_Central/Project_pages#Migration_from_www.gentoo.org.2Fproj.2F
12 [2]: http://asciidoc.org/userguide.html#X91
13 [3]: http://johnmacfarlane.net/pandoc/README.html#using-pandoc
14 ---
15 [1] also mentions that the per-project pages are already hosted in
16 converted form. For example:
17
18 http://dev.gentoo.org/~swift/tmp/proj2wiki/releng/catalyst/
19
20 if folks want to copy-paste into the wiki. I don't think I have
21 permission (as a non releng/Catalyst member) to create or edit stuff
22 in the Project:releng namespace on the wiki, but I suggest folks
23 dropping the MediaWiki version of the HOWTO in should reference the
24 source Git commit in their MediaWiki commit:
25
26 auto-generated from ee08256 (doc/HOWTO.txt: Fix stage descriptions,
27 and add extra context, 2013-12-19).
28
29 Cheers,
30 Trevor
31
32 Makefile | 13 +++++++++++++
33 1 file changed, 13 insertions(+)
34
35 diff --git a/Makefile b/Makefile
36 index 98accbe..0c23cf1 100644
37 --- a/Makefile
38 +++ b/Makefile
39 @@ -8,6 +8,7 @@ MAN_PAGE_INCLUDES = doc/subarches.generated.txt doc/targets.generated.txt
40 DOC_SOURCES = $(filter-out $(MAN_PAGE_SOURCES) $(MAN_PAGE_INCLUDES),$(wildcard doc/*.txt))
41 DOCS = $(patsubst doc/%.txt,files/%.html,$(DOC_SOURCES))
42 DOC_SIDE_EFFECTS = files/docbook-xsl.css
43 +MEDIAWIKI_DOCS = $(patsubst files/%.html, wiki/%.mw, $(DOCS))
44 EXTRA_DIST = $(MAN_PAGES) $(DOCS) $(DOC_SIDE_EFFECTS)
45 GENERATED_FILES = $(MAN_PAGES) $(MAN_PAGE_INCLUDES) $(DOCS) $(DOC_SIDE_EFFECTS)
46
47 @@ -16,6 +17,8 @@ distdir = catalyst-$(PACKAGE_VERSION)
48
49 all: $(EXTRA_DIST)
50
51 +mediawiki: $(MEDIAWIKI_DOCS)
52 +
53 $(MAN_PAGES): files/%: doc/%.txt doc/asciidoc.conf Makefile catalyst
54 a2x --conf-file=doc/asciidoc.conf --attribute="catalystversion=$(PACKAGE_VERSION)" \
55 --format=manpage -D files "$<"
56 @@ -34,6 +37,16 @@ $(DOCS): files/%.html: doc/%.txt doc/asciidoc.conf Makefile
57 a2x --conf-file=doc/asciidoc.conf --attribute="catalystversion=$(PACKAGE_VERSION)" \
58 --format=xhtml -D files "$<"
59
60 +wiki/%.html: doc/%.txt doc/asciidoc.conf Makefile | wiki
61 + a2x --conf-file=doc/asciidoc.conf --attribute="catalystversion=$(PACKAGE_VERSION)" \
62 + --format=xhtml --attribute 'toc!' -D wiki "$<"
63 +
64 +wiki/%.mw: wiki/%.html
65 + pandoc -f html -t mediawiki -o "$@" "$<"
66 +
67 +wiki:
68 + mkdir -p wiki
69 +
70 $(DOC_SIDE_EFFECTS): $(firstword $(DOCS))
71
72 clean:
73 --
74 1.8.4

Replies