From 35dc61af79dba32653ec97bd455b428b9cdb681d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 8 Jun 2011 12:50:49 +1000 Subject: Use XSL to generate man page from the rules XML Take evdev.xml and convert it into a man page, install it as xkeyoard-config.7 man page to list all option that xkeyboard-config provides. man.xsl is badly indented because I couldn't figure out how to make xsl ignore whitespaces properly. Adds a requirement on the xorg util-macros. Signed-off-by: Peter Hutterer --- configure.in | 14 ++++++++ rules/Makefile.am | 8 +++++ xslt/man.xsl | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 xslt/man.xsl diff --git a/configure.in b/configure.in index 527e807..a037abb 100644 --- a/configure.in +++ b/configure.in @@ -3,6 +3,13 @@ AC_CONFIG_SRCDIR(rules/base.xml.in) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE +# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS +m4_ifndef([XORG_MACROS_VERSION], + [m4_fatal([must install xorg-macros 1.8 or later before + running autoconf/autogen])]) +XORG_MACROS_VERSION(1.8) +XORG_MANPAGE_SECTIONS + AC_SUBST(VERSION) AC_PATH_PROG([XKBCOMP], [xkbcomp], [not_found]) @@ -24,6 +31,13 @@ AC_ARG_ENABLE( compat_rules, enable_compat_rules="$enableval", enable_compat_rules="yes" ) +AC_PATH_PROG(SED, [sed]) +AC_PATH_PROG(XSLTPROC, [xsltproc]) +AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"]) +if test "x$XSLTPROC" = "x"; then + AC_MSG_WARN([xsltproc not found, needed to generate man page.]) +fi + # xkeyboard-config does not have build-time dependencies. However, it does # have run-time dependencies and keyboard layouts may not work without the # right libX11 or xproto installed. diff --git a/rules/Makefile.am b/rules/Makefile.am index f2d73ce..39351c9 100644 --- a/rules/Makefile.am +++ b/rules/Makefile.am @@ -234,3 +234,11 @@ rulesdir = $(xkb_base)/rules xmldir = $(rulesdir) @INTLTOOL_XML_NOMERGE_RULE@ + +xkeyboard-config.man: evdev.xml + $(XSLTPROC) $(top_srcdir)/xslt/man.xsl evdev.xml > $@ + +xkeyboard-config.7: xkeyboard-config.man + $(SED) $(MAN_SUBSTS) < $< > $@ + +dist_man_MANS = xkeyboard-config.7 diff --git a/xslt/man.xsl b/xslt/man.xsl new file mode 100644 index 0000000..f0475e0 --- /dev/null +++ b/xslt/man.xsl @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3