WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] docs: add some scaffolding for building HTML docs fr

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] docs: add some scaffolding for building HTML docs from markdown
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Wed, 26 Oct 2011 17:27:36 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Wed, 26 Oct 2011 09:30:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <03b570c3792bb6abce46.1319646312@xxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <03b570c3792bb6abce46.1319646312@xxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.6.4
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1319646217 -3600
# Node ID 52058c9448935818e2a810a438244e06f40b4e0e
# Parent  03b570c3792bb6abce46de5c9ab560ac169117c3
docs: add some scaffolding for building HTML docs from markdown

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 03b570c3792b -r 52058c944893 docs/Docs.mk
--- a/docs/Docs.mk      Wed Oct 26 17:20:21 2011 +0100
+++ b/docs/Docs.mk      Wed Oct 26 17:23:37 2011 +0100
@@ -7,3 +7,4 @@ DOXYGEN         := doxygen
 POD2MAN                := pod2man
 DOT            := dot
 NEATO          := neato
+MARKDOWN       := markdown
diff -r 03b570c3792b -r 52058c944893 docs/Makefile
--- a/docs/Makefile     Wed Oct 26 17:20:21 2011 +0100
+++ b/docs/Makefile     Wed Oct 26 17:23:37 2011 +0100
@@ -11,10 +11,11 @@ DOC_MAN1SRC := $(wildcard man/*.pod.1)
 DOC_MAN1       := $(patsubst man/%.pod.1,man1/%.1,$(DOC_MAN1SRC))
 DOC_MAN5       := $(patsubst man/%.pod.5,man5/%.5,$(DOC_MAN5SRC))
 DOC_TEX                := src/user.tex src/interface.tex
+DOC_MARKDOWN   := $(wildcard misc/*.markdown)
 DOC_PS         := $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
 DOC_PDF                := $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
-DOC_HTML       := $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX))
-
+DOC_HTML       := $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX)) \
+                  $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN))
 GFX = $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
 
 .PHONY: all
@@ -37,9 +38,7 @@ ps: $(DOC_PS)
 pdf: $(DOC_PDF)
 
 .PHONY: html
-html:
-       @if which $(LATEX2HTML) 1>/dev/null 2>/dev/null; then \
-       $(MAKE) $(DOC_HTML); fi
+html: $(DOC_HTML)
 
 .PHONY: python-dev-docs
 python-dev-docs:
@@ -110,7 +109,16 @@ ps/%.ps: %.dvi
        $(FIG2DEV) -L eps $< $@
 
 html/%/index.html: src/%.tex
-       $(INSTALL_DIR) $(@D)
+       @$(INSTALL_DIR) $(@D)
+       @set -e ; if which $(LATEX2HTML) 1>/dev/null 2>/dev/null; then \
+        echo "Running latex2html to generate $*/index.html ... "; \
        $(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation 
\
        -numbered_footnotes -local_icons -noinfo -math -dir $(@D) \
-       $< 1>/dev/null 2>/dev/null
+       $< 1>/dev/null 2>/dev/null ;fi
+
+html/%.html: %.markdown
+       @$(INSTALL_DIR) $(@D)
+       @set -e ; if which $(MARKDOWN) 1>/dev/null 2>/dev/null; then \
+       echo "Running markdown to generate $*.html ... "; \
+       $(MARKDOWN) $< > $@.tmp ; \
+       $(call move-if-changed,$@.tmp,$@) ; fi

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel