命令行选项与 man 页面

As one can generate man pages for a docbook refentry as well, it sounds like a good idea to use it for that purpose. This way the interface is part of the reference and one gets the man-page for free.

6.1.1. 为工具书写文档

Create one refentry file per tool. Following our example we would call it meep/docs/reference/meeper/meep.xml. For the xml tags that should be used and can look at generated file in the xml subdirectory as well as examples e.g. in glib.

6.1.2. 添加额外的配置检查

Example 6-1额外的配置检查
AC_ARG_ENABLE(man,
              [AC_HELP_STRING([--enable-man],
                              [regenerate man pages from Docbook [default=no]])],enable_man=yes,
              enable_man=no)

AC_PATH_PROG([XSLTPROC], [xsltproc])
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)

            

6.1.3. 添加额外的makefile规则

Example 6-2额外的配置检查
man_MANS = \
       meeper.1

if ENABLE_GTK_DOC
if ENABLE_MAN

%.1 : %.xml
        @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<

endif
endif

BUILT_EXTRA_DIST = $(man_MANS)
EXTRA_DIST += meep.xml