From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id E6B18138A1F for ; Thu, 30 Jan 2014 00:54:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 50CC9E0C0D; Thu, 30 Jan 2014 00:54:47 +0000 (UTC) Received: from qmta10.westchester.pa.mail.comcast.net (qmta10.westchester.pa.mail.comcast.net [76.96.62.17]) by pigeon.gentoo.org (Postfix) with ESMTP id DCE20E0C0D for ; Thu, 30 Jan 2014 00:54:46 +0000 (UTC) Received: from omta18.westchester.pa.mail.comcast.net ([76.96.62.90]) by qmta10.westchester.pa.mail.comcast.net with comcast id L0ps1n0061wpRvQ5A0umal; Thu, 30 Jan 2014 00:54:46 +0000 Received: from odin.tremily.us ([24.18.63.50]) by omta18.westchester.pa.mail.comcast.net with comcast id L0uk1n00c152l3L3e0ulZF; Thu, 30 Jan 2014 00:54:46 +0000 Received: from nott (nott.tremily.us [192.168.0.8]) by odin.tremily.us (Postfix) with SMTP id E29DBF87282; Wed, 29 Jan 2014 16:54:42 -0800 (PST) Received: by nott (sSMTP sendmail emulation); Wed, 29 Jan 2014 16:57:01 -0800 From: wking@tremily.us To: Catalyst Cc: "W. Trevor King" Subject: [gentoo-catalyst] [PATCH] Makefile: Use asciidoc and Pandoc to generate MediaWiki doc versions Date: Wed, 29 Jan 2014 16:56:57 -0800 Message-Id: X-Mailer: git-send-email 1.8.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1391043286; bh=PE57zRhuzYRPXjWL33E/+RxkNu69nVwJ3NNr84t1oEc=; h=Received:Received:Received:Received:From:To:Subject:Date: Message-Id; b=cQZYiIYOvKz31entaRGL1aqY9xPR2VfpTWSZU9xCFV4Yk1bZBgFq+kX+2mALLyCUY zkdQhS9dUeV/UmdT+S+95szHx5UMBiZo+5pLB53eDMBjgCZ9R07eBOf3Ov8mTn8ERA SFODYvNHVAVA+gdG70YRqK2HowiqtE0whDzbNBtMAyW9B5dPsSEGiaoCenSkFYB64f Xn+T3NYjjGSWpReWiaVIaDSIaugv4xfnH1NK2sfl9usMeyPTj2dp/Nkin9RImKqmLg jHxCD69MmteLRWvLSypNb87dsM8AuCTvpuA8C9RChVqB4jgyl/F1AlUY0DfGsp4Inf OrHU4smuk/R8g== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Archives-Salt: 6d4a0984-0add-4a3e-9d1d-c7cb1f5fc737 X-Archives-Hash: dff75d2195cb49fa9c6fd3553ccf20e2 We need this because hosting content under: https://www.gentoo.org/proj/ is deprecated, with per-project documentation migrating to the wiki [1] * `--attribute 'toc!'` disables AsciiDoc's table of contents [2], which Pandoc doesn't like. * The Pandoc invocation is about as basic as it gets [3]. [1]: https://wiki.gentoo.org/wiki/Gentoo_Wiki:Developer_Central/Project_pages#Migration_from_www.gentoo.org.2Fproj.2F [2]: http://asciidoc.org/userguide.html#X91 [3]: http://johnmacfarlane.net/pandoc/README.html#using-pandoc --- [1] also mentions that the per-project pages are already hosted in converted form. For example: http://dev.gentoo.org/~swift/tmp/proj2wiki/releng/catalyst/ if folks want to copy-paste into the wiki. I don't think I have permission (as a non releng/Catalyst member) to create or edit stuff in the Project:releng namespace on the wiki, but I suggest folks dropping the MediaWiki version of the HOWTO in should reference the source Git commit in their MediaWiki commit: auto-generated from ee08256 (doc/HOWTO.txt: Fix stage descriptions, and add extra context, 2013-12-19). Cheers, Trevor Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index 98accbe..0c23cf1 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ MAN_PAGE_INCLUDES = doc/subarches.generated.txt doc/targets.generated.txt 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) @@ -16,6 +17,8 @@ distdir = catalyst-$(PACKAGE_VERSION) 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 "$<" @@ -34,6 +37,16 @@ $(DOCS): files/%.html: doc/%.txt doc/asciidoc.conf Makefile 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: -- 1.8.4