From aeab95dbab2bac426ef8ab45056b83e2e6a888a0 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 4 Jun 2019 01:59:58 -0400 Subject: [PATCH] doc: add manpage infrastructure --- Makefile | 11 +++++++++-- doc/asciidoc.conf | 37 +++++++++++++++++++++++++++++++++++++ doc/footer.asciidoc | 18 ++++++++++++++++++ 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 doc/asciidoc.conf create mode 100644 doc/footer.asciidoc diff --git a/Makefile b/Makefile index 7fa638f..c15311c 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,8 @@ BINPROGS = \ BASH = bash -all: $(BINPROGS) +all: $(BINPROGS) man +man: $(MANS) V_GEN = $(_v_GEN_$(V)) _v_GEN_ = $(_v_GEN_0) @@ -20,8 +21,11 @@ edit = $(V_GEN) m4 -P $@.in >$@ && chmod go-w,+x $@ %: %.in common $(edit) +doc/%: doc/%.asciidoc doc/asciidoc.conf doc/footer.asciidoc + $(V_GEN) a2x --no-xmllint --asciidoc-opts="-f doc/asciidoc.conf" -d manpage -f manpage -D doc $< + clean: - $(RM) $(BINPROGS) + $(RM) $(BINPROGS) $(MANS) check: all @for f in $(BINPROGS); do bash -O extglob -n $$f; done @@ -31,5 +35,8 @@ install: all install -dm755 $(DESTDIR)$(PREFIX)/bin install -m755 $(BINPROGS) $(DESTDIR)$(PREFIX)/bin install -Dm644 zsh-completion $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_archinstallscripts + for manfile in $(MANS); do \ + install -Dm644 $$manfile -t $(DESTDIR)$(PREFIX)/share/man/man$${manfile##*.}; \ + done; .PHONY: all clean install uninstall diff --git a/doc/asciidoc.conf b/doc/asciidoc.conf new file mode 100644 index 0000000..c675a20 --- /dev/null +++ b/doc/asciidoc.conf @@ -0,0 +1,37 @@ +## linkman: macro +# Inspired by/borrowed from the GIT source tree at Documentation/asciidoc.conf +# +# Usage: linkman:command[manpage-section] +# +# Note, {0} is the manpage section, while {target} is the command. +# +# Show man link as: (
); if section is defined, else just show +# the command. + +[macros] +(?su)[\\]?(?Plinkman):(?P\S*?)\[(?P.*?)\]= + +[attributes] +asterisk=* +plus=+ +caret=^ +startsb=[ +endsb=] +backslash=\ +tilde=~ +apostrophe=' +backtick=` +litdd=-- + +ifdef::backend-docbook[] +[linkman-inlinemacro] +{0%{target}} +{0#} +{0#{target}{0}} +{0#} +endif::backend-docbook[] + +ifdef::backend-xhtml11[] +[linkman-inlinemacro] +{target}{0?({0})} +endif::backend-xhtml11[] diff --git a/doc/footer.asciidoc b/doc/footer.asciidoc new file mode 100644 index 0000000..4445b0c --- /dev/null +++ b/doc/footer.asciidoc @@ -0,0 +1,18 @@ + +Bugs +---- +Bugs can be reported on the bug tracker 'https://bugs.archlinux.org' in the Arch +Linux category and title prefixed with [arch-install-scripts] or via +mailto:arch-projects@archlinux.org[]. + + +Authors +------- + +Maintainers: + +* Dave Reisner +* Eli Schwartz + +For additional contributors, use `git shortlog -s` on the arch-install-scripts.git +repository.