DOC_SOURCES = $(filter-out $(MAN_PAGE_SOURCES) $(MAN_PAGE_INCLUDES),$(wildcard doc/*.txt))
DOCS = $(patsubst doc/%.txt,files/%.html,$(DOC_SOURCES))
DOC_SIDE_EFFECTS = files/docbook-xsl.css
+MEDIAWIKI_DOCS = $(patsubst files/%.html, wiki/%.mw, $(DOCS))
EXTRA_DIST = $(MAN_PAGES) $(DOCS) $(DOC_SIDE_EFFECTS)
GENERATED_FILES = $(MAN_PAGES) $(MAN_PAGE_INCLUDES) $(DOCS) $(DOC_SIDE_EFFECTS)
all: $(EXTRA_DIST)
+mediawiki: $(MEDIAWIKI_DOCS)
+
$(MAN_PAGES): files/%: doc/%.txt doc/asciidoc.conf Makefile catalyst
a2x --conf-file=doc/asciidoc.conf --attribute="catalystversion=$(PACKAGE_VERSION)" \
--format=manpage -D files "$<"
a2x --conf-file=doc/asciidoc.conf --attribute="catalystversion=$(PACKAGE_VERSION)" \
--format=xhtml -D files "$<"
+wiki/%.html: doc/%.txt doc/asciidoc.conf Makefile | wiki
+ a2x --conf-file=doc/asciidoc.conf --attribute="catalystversion=$(PACKAGE_VERSION)" \
+ --format=xhtml --attribute 'toc!' -D wiki "$<"
+
+wiki/%.mw: wiki/%.html
+ pandoc -f html -t mediawiki -o "$@" "$<"
+
+wiki:
+ mkdir -p wiki
+
$(DOC_SIDE_EFFECTS): $(firstword $(DOCS))
clean: