doc: add manpage infrastructure

This commit is contained in:
Eli Schwartz 2019-06-04 01:59:58 -04:00
parent 8652c5a724
commit aeab95dbab
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
3 changed files with 64 additions and 2 deletions

View File

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

37
doc/asciidoc.conf Normal file
View File

@ -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: <command>(<section>); if section is defined, else just show
# the command.
[macros]
(?su)[\\]?(?P<name>linkman):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
[attributes]
asterisk=&#42;
plus=&#43;
caret=&#94;
startsb=&#91;
endsb=&#93;
backslash=&#92;
tilde=&#126;
apostrophe=&#39;
backtick=&#96;
litdd=&#45;&#45;
ifdef::backend-docbook[]
[linkman-inlinemacro]
{0%{target}}
{0#<citerefentry>}
{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
{0#</citerefentry>}
endif::backend-docbook[]
ifdef::backend-xhtml11[]
[linkman-inlinemacro]
<a href="{target}.{0}.html">{target}{0?({0})}</a>
endif::backend-xhtml11[]

18
doc/footer.asciidoc Normal file
View File

@ -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 <dreisner@archlinux.org>
* Eli Schwartz <eschwartz@archlinux.org>
For additional contributors, use `git shortlog -s` on the arch-install-scripts.git
repository.