1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-05 22:00:54 +00:00

Add description and version info to manpages

This adopts customized docbook manpage header from git's
Documentation/asciidoc.conf and does away with a couple of
ugly hacks.

(cherry picked from commit 0ecc8b9d60,
 omitting generated files)
This commit is contained in:
Jonas Fonseca 2008-03-03 02:51:25 +01:00 committed by Kalle Olavi Niemitalo
parent 857c27e8b6
commit 34a18bd597
2 changed files with 20 additions and 10 deletions

View File

@ -14,7 +14,10 @@ PDF_DIR = $(DESTDIR)$(docdir)/$(PACKAGE)/pdf
TXT_DIR = $(DESTDIR)$(docdir)/$(PACKAGE)/txt
ASCIIDOC_CONF = $(srcdir)asciidoc.conf
ASCIIDOC_FLAGS += -f $(ASCIIDOC_CONF) -a "builddir=$(CURDIR)/" -a asciidoc7compatible
ASCIIDOC_FLAGS += -f $(ASCIIDOC_CONF) \
-a "builddir=$(CURDIR)/" \
-a asciidoc7compatible \
-a elinks_version=$(VERSION)
#############################################################################
# Build files
@ -167,12 +170,6 @@ asciidoc_dep = sed -n 's/[{]builddir}//g;s@include::\(.*\)\[.*@$@: $< \1@p' < $<
-include .deps/*.asciidoc
# Do a little post-processing of man pages. Inserting title headers and date.
MAN_DATE = $(shell date -I)
man_desc = `sed -n 's/:Description:\s*\(.*\)/\1/p' < $(srcdir)$(subst .xml,.txt,$(<F))`
man_hack = sed "s/^\(\.TH \"ELINKS[^\"]*\" [0-9] \).*/\1\"$(1)\" \"$(MAN_DATE)\" \"$(1)\"/" < $@ | \
sed "s/@squote@/\\\\'/g" > $@.tmp && mv $@.tmp $@
#############################################################################
# Build recipies
@ -187,11 +184,9 @@ man_hack = sed "s/^\(\.TH \"ELINKS[^\"]*\" [0-9] \).*/\1\"$(1)\" \"$(MAN_DATE)\"
%.1: %.1.xml
$(call cmd,xmlto,man)
@$(call man_hack,$(call man_desc))
%.5: %.5.xml
$(call cmd,xmlto,man)
@$(call man_hack,$(call man_desc))
%.html-chunked: %.xml
$(call cmd,xmlto,html)

View File

@ -19,7 +19,7 @@ ifdef::backend-docbook[]
# To be replaced later
[attributes]
squote=@squote@
squote='
# No interlinking between elinks manpages
[man-inlinemacro]
@ -48,6 +48,21 @@ ifdef::doctype-manpage[]
[mailto-inlinemacro]
&lt;{target}&gt;
[header]
template::[header-declarations]
<refentry>
<refmeta>
<refentrytitle>{mantitle}</refentrytitle>
<manvolnum>{manvolnum}</manvolnum>
<refmiscinfo class="source">ELinks</refmiscinfo>
<refmiscinfo class="version">{elinks_version}</refmiscinfo>
<refmiscinfo class="manual">{description}</refmiscinfo>
</refmeta>
<refnamediv>
<refname>{manname}</refname>
<refpurpose>{manpurpose}</refpurpose>
</refnamediv>
endif::doctype-manpage[]
endif::backend-docbook[]