From 1c45e4fe174995206c06ae6abc4b01e0cb3200aa Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 9 Mar 2011 13:06:23 +0100 Subject: [PATCH] begin the manpage integration with man.text Signed-off-by: Nico Schottelius --- Makefile | 33 ++++++++++++++----- .../type/__file/man.text | 0 doc/man/cdist-reference.text.sh | 14 +++++--- doc/man/cdist-type.text | 3 +- 4 files changed, 36 insertions(+), 14 deletions(-) rename doc/man/cdist-type__file.text => conf/type/__file/man.text (100%) diff --git a/Makefile b/Makefile index adf03e31..115fa5f8 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,6 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-type.text \ $(MANDIR)/cdist-type-template.text \ - $(MANDIR)/cdist-type__file.text \ ################################################################################ @@ -47,16 +46,34 @@ all: man: doc/man/.marker -doc/man/.marker: $(MANSRC) $(MANGENERATED) - for mansrc in $^; do $(A2X) $$mansrc; done - for manpage in $(MANDIR)/*.[1-9]; do cat=$${manpage##*.}; mandir=$(MANDIR)/man$$cat; mkdir -p $$mandir; mv $$manpage $$mandir; done +doc/man/.marker: touch $@ -# Only depends on cdist-type__*.text in reality -$(MANDIR)/cdist-reference.text: $(MANSRC) $(MANDIR)/cdist-reference.text.sh - $(MANDIR)/cdist-reference.text.sh - +# Manual from core +mancore: $(MANSRC) + for mansrc in $^; do $(A2X) $$mansrc; done +# Manuals from types +mantype: + for man in conf/type/*/man.text; do $(A2X) $$man; done + +# Move into manpath directories +manmove: mantype mancore + for manpage in $(MANDIR)/*.[1-9] conf/type/*/*.7; do \ + cat=$${manpage##*.}; \ + echo $$cat; \ + mandir=$(MANDIR)/man$$cat; \ + mkdir -p $$mandir; \ + mv $$manpage $$mandir; \ + done + +# Reference +$(MANDIR)/cdist-reference.text: manmove $(MANDIR)/cdist-reference.text.sh + $(MANDIR)/cdist-reference.text.sh + $(A2X) $(MANDIR)/cdist-reference.text + # Move us to the destination as well + make manmove + clean: rm -rf doc/man/*.html doc/man/*.[1-9] doc/man/man[1-9] $(MANGENERATED) diff --git a/doc/man/cdist-type__file.text b/conf/type/__file/man.text similarity index 100% rename from doc/man/cdist-type__file.text rename to conf/type/__file/man.text diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh index 2453c216..f900e35e 100755 --- a/doc/man/cdist-reference.text.sh +++ b/doc/man/cdist-reference.text.sh @@ -83,6 +83,9 @@ conf/type//:: This directory is referenced by the variable __type (see below). +conf/type//man.text:: + Manpage in Asciidoc format (nequired for inclusion into upstream) + conf/type//manifest:: Used to generate additional objects from a type. @@ -132,9 +135,9 @@ TYPES The following types are available: eof -for type in cdist-type__*.text; do - name_1="${type#cdist-type}" - name_2="${name_1%.text}" +for type in man7/cdist-type__*; do + name_1="${type#man7/cdist-type}" + name_2="${name_1%.7}" name="$name_2" echo "- $name" @@ -175,8 +178,9 @@ SEE ALSO -------- - cdist(7) eof -for type in cdist-type__*.text; do - name_2="${type%.text}" +for type in man7/cdist-type__*; do + name_1="${type#man7/}" + name_2="${name_1%.7}" name="$name_2" echo "- ${name}(7)" diff --git a/doc/man/cdist-type.text b/doc/man/cdist-type.text index b5097a5c..2835815e 100644 --- a/doc/man/cdist-type.text +++ b/doc/man/cdist-type.text @@ -153,7 +153,8 @@ If you think your type may be useful for others, ensure it works with the current master branch of cdist and submit the git url containing the type for inclusion to the mailinglist **cdist at cdist -- at -- l.schottelius.org**. -Ensure a corresponding manpage named cdist-type__NAME is included. +Ensure a corresponding manpage named man.text in asciidoc format with +the manpage-name "cdist-type__NAME" is included in the type directory. SEE ALSO