From patchwork Fri Dec 9 16:17:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cedric Bosdonnat X-Patchwork-Id: 9468591 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D6042607DA for ; Fri, 9 Dec 2016 16:19:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C65A02864E for ; Fri, 9 Dec 2016 16:19:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B99C728650; Fri, 9 Dec 2016 16:19:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C4EC928653 for ; Fri, 9 Dec 2016 16:19:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFNrR-0007yX-Si; Fri, 09 Dec 2016 16:17:25 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFNrQ-0007wz-2G for xen-devel@lists.xen.org; Fri, 09 Dec 2016 16:17:24 +0000 Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id D7/E9-20885-319DA485; Fri, 09 Dec 2016 16:17:23 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsVyuP0uq67ATa8 Ig3OrjSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oxZn14xFRxSqbj84ytbA+NluS5GLg4hgSWM Ep82XWbuYuTkYBOwl+j6c5QJxBYRkJa49vkyI0gRs8BmRonzkyeygCSEBRwkXj3dzgpiswioS vzaeg6sgVfAQmJG62kwW0JAXmJX20WwGk4BS4lLZ7+wg9hCQDVLFp5nhagXlDg58wnQTA6gBe oS6+cJgYSZgVqbt85mnsDIOwtJ1SyEqllIqhYwMq9iVC9OLSpLLdI10UsqykzPKMlNzMzRNTQ w1stNLS5OTE/NSUwq1kvOz93ECAwpBiDYwdj4xekQoyQHk5IobzGTV4QQX1J+SmVGYnFGfFFp TmrxIUYZDg4lCd7714FygkWp6akVaZk5wOCGSUtw8CiJ8KqApHmLCxJzizPTIVKnGBWlxHkjb gAlBEASGaV5cG2wiLrEKCslzMsIdIgQT0FqUW5mCar8K0ZxDkYlYd5IkCk8mXklcNNfAS1mAl o874Y7yOKSRISUVAOjSvLcfvafESvTznc2zOXcsV/zgd7vW6YaTn9VZmq8L6223VG1aK7Tv5W su1jdd3+KMMxZ5f9F/2l/ncy7izbK3I0HK65Lbg80jDV2W3ajp5Vb/JGGnbnsi0b/fx8Sddz/ uxadXeBTw3P4yu8IuTl/JnDkeSn6JP5dNP9kY4FirNmdD8nzjPSVWIozEg21mIuKEwHLjQo6o wIAAA== X-Env-Sender: cbosdonnat@suse.com X-Msg-Ref: server-6.tower-31.messagelabs.com!1481300240!49016277!1 X-Originating-IP: [195.135.221.5] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 60150 invoked from network); 9 Dec 2016 16:17:20 -0000 Received: from smtp.nue.novell.com (HELO smtp.nue.novell.com) (195.135.221.5) by server-6.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 9 Dec 2016 16:17:20 -0000 Received: from laptop.vms (mhy71-2-88-167-63-197.fbx.proxad.net [88.167.63.197]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Fri, 09 Dec 2016 17:17:19 +0100 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= To: xen-devel@lists.xen.org Date: Fri, 9 Dec 2016 17:17:04 +0100 Message-Id: <20161209161714.23866-2-cbosdonnat@suse.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161209161714.23866-1-cbosdonnat@suse.com> References: <20161209161714.23866-1-cbosdonnat@suse.com> MIME-Version: 1.0 Cc: Andrew Cooper , Ian Jackson , Wei Liu , =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Subject: [Xen-devel] [PATCH 01/11] docs: allow writing man pages in markdown X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Some of the docs/misc documents are written in markdown language. As an effort to cleanup man pages these documents will be converted into man pages. To avoid some more conversion, add rules to the docs/Makefile to generate man pages out of markdown files as well as pod ones. However, pandoc doesn't know how to convert man pages links. Thus the man links in markdown pages won't work. Signed-off-by: Cédric Bosdonnat Acked-by: Wei Liu --- docs/Makefile | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index e2537e8755..d3f5eb607c 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -3,13 +3,14 @@ include $(XEN_ROOT)/Config.mk -include $(XEN_ROOT)/config/Docs.mk VERSION := $(shell $(MAKE) -C $(XEN_ROOT)/xen --no-print-directory xenversion) +DATE := $(shell date +%Y-%m-%d) DOC_ARCHES := arm x86_32 x86_64 # Documentation sources to build -MAN1SRC-y := $(sort $(shell find man/ -name '*.pod.1' -print)) -MAN5SRC-y := $(sort $(shell find man/ -name '*.pod.5' -print)) -MAN8SRC-y := $(sort $(shell find man/ -name '*.pod.8' -print)) +MAN1SRC-y := $(sort $(shell find man/ -regex '.*\.\(pod\|markdown\)\.1' -print)) +MAN5SRC-y := $(sort $(shell find man/ -regex '.*\.\(pod\|markdown\)\.5' -print)) +MAN8SRC-y := $(sort $(shell find man/ -regex '.*\.\(pod\|markdown\)\.8' -print)) MARKDOWNSRC-y := $(sort $(shell find misc -name '*.markdown' -print)) @@ -18,11 +19,17 @@ TXTSRC-y := $(sort $(shell find misc -name '*.txt' -print)) PANDOCSRC-y := $(sort $(shell find features/ misc/ specs/ -name '*.pandoc' -print)) # Documentation targets -DOC_MAN1 := $(patsubst man/%.pod.1,man1/%.1,$(MAN1SRC-y)) -DOC_MAN5 := $(patsubst man/%.pod.5,man5/%.5,$(MAN5SRC-y)) -DOC_MAN8 := $(patsubst man/%.pod.8,man8/%.8,$(MAN8SRC-y)) +DOC_MAN1 := $(patsubst man/%.pod.1,man1/%.1,$(MAN1SRC-y)) \ + $(patsubst man/%.markdown.1,man1/%.1,$(MAN1SRC-y)) +DOC_MAN5 := $(patsubst man/%.pod.5,man5/%.5,$(MAN5SRC-y)) \ + $(patsubst man/%.markdown.5,man5/%.5,$(MAN5SRC-y)) +DOC_MAN8 := $(patsubst man/%.pod.8,man8/%.8,$(MAN8SRC-y)) \ + $(patsubst man/%.markdown.8,man8/%.8,$(MAN8SRC-y)) DOC_HTML := $(patsubst %.markdown,html/%.html,$(MARKDOWNSRC-y)) \ $(patsubst %.pandoc,html/%.html,$(PANDOCSRC-y)) \ + $(patsubst man/%.markdown.1,html/man/%.1.html,$(MAN1SRC-y)) \ + $(patsubst man/%.markdown.5,html/man/%.5.html,$(MAN5SRC-y)) \ + $(patsubst man/%.markdown.8,html/man/%.8.html,$(MAN8SRC-y)) \ $(patsubst man/%.pod.1,html/man/%.1.html,$(MAN1SRC-y)) \ $(patsubst man/%.pod.5,html/man/%.5.html,$(MAN5SRC-y)) \ $(patsubst man/%.pod.8,html/man/%.8.html,$(MAN8SRC-y)) \ @@ -31,6 +38,9 @@ DOC_HTML := $(patsubst %.markdown,html/%.html,$(MARKDOWNSRC-y)) \ DOC_TXT := $(patsubst %.txt,txt/%.txt,$(TXTSRC-y)) \ $(patsubst %.markdown,txt/%.txt,$(MARKDOWNSRC-y)) \ $(patsubst %.pandoc,txt/%.txt,$(PANDOCSRC-y)) \ + $(patsubst man/%.markdown.1,txt/man/%.1.txt,$(MAN1SRC-y)) \ + $(patsubst man/%.markdown.5,txt/man/%.5.txt,$(MAN5SRC-y)) \ + $(patsubst man/%.markdown.8,txt/man/%.8.txt,$(MAN8SRC-y)) \ $(patsubst man/%.pod.1,txt/man/%.1.txt,$(MAN1SRC-y)) \ $(patsubst man/%.pod.5,txt/man/%.5.txt,$(MAN5SRC-y)) \ $(patsubst man/%.pod.8,txt/man/%.8.txt,$(MAN8SRC-y)) @@ -89,6 +99,16 @@ else @echo "pod2man not installed; skipping $$@" endif +man$(1)/%.$(1): man/%.markdown.$(1) Makefile +ifneq ($(PANDOC),) + @$(INSTALL_DIR) $$(@D) + $(PANDOC) --standalone -V title=$$* -V section=$(1) \ + -V date="$(DATE)" -V footer="$(VERSION)" \ + -V header=Xen $$< -t man --output $$@ +else + @echo "pandoc not installed; skipping $$@" +endif + # HTML manpages html/man/%.$(1).html: man/%.pod.$(1) Makefile ifneq ($(POD2HTML),) @@ -98,6 +118,14 @@ else @echo "pod2html not installed; skipping $$@" endif +html/man/%.$(1).html: man/%.markdown.$(1) Makefile +ifneq ($(PANDOC),) + @$(INSTALL_DIR) $$(@D) + $(PANDOC) --standalone $$< -t html --toc --output $$@ +else + @echo "pandoc not installed; skipping $$@" +endif + # Text manpages txt/man/%.$(1).txt: man/%.pod.$(1) Makefile ifneq ($(POD2TEXT),) @@ -107,6 +135,14 @@ else @echo "pod2text not installed; skipping $$@" endif +txt/man/%.$(1).txt: man/%.markdown.$(1) Makefile +ifneq ($(PANDOC),) + @$(INSTALL_DIR) $$(@D) + $(PANDOC) --standalone $$< -t plain --output $$@ +else + @echo "pandoc not installed; skipping $$@" +endif + # Build .PHONY: man$(1)-pages man$(1)-pages: $$(DOC_MAN$(1))