begin the manpage integration with man.text

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-03-09 13:06:23 +01:00
parent d88f4afc87
commit 1c45e4fe17
4 changed files with 36 additions and 14 deletions

View File

@ -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,15 +46,33 @@ 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)

View File

@ -83,6 +83,9 @@ conf/type/<name>/::
This directory is referenced by the variable __type (see below).
conf/type/<name>/man.text::
Manpage in Asciidoc format (nequired for inclusion into upstream)
conf/type/<name>/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)"

View File

@ -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