[gnome-shell] man: Use asciidoc for main man page as well



commit 3fc5c4c1808bd0f364196642ae1d6967da0db0c2
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Dec 27 23:46:57 2020 +0100

    man: Use asciidoc for main man page as well
    
    We already use asciidoc for the gnome-extensions man page, while
    the main man page is generated from docbook XML. The former is a
    much friendlier source format, so use it for both man pages.
    
    Hopefully the plain text format encourages updates, to prevent the
    page from getting as badly out of sync again as it is currently.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1553>

 man/gnome-shell.txt |  81 ++++++++++++++++++++++++++
 man/gnome-shell.xml | 165 ----------------------------------------------------
 man/meson.build     |  16 +----
 man/stylesheet.xsl  |  27 +++++++++
 meson.build         |   3 +-
 5 files changed, 111 insertions(+), 181 deletions(-)
---
diff --git a/man/gnome-shell.txt b/man/gnome-shell.txt
new file mode 100644
index 0000000000..4ed5b711b4
--- /dev/null
+++ b/man/gnome-shell.txt
@@ -0,0 +1,81 @@
+GNOME-SHELL(1)
+=============
+:man manual: User Commands
+:man source: GNOME-SHELL
+:doctype: manpage
+:date: December 2020
+
+NAME
+----
+gnome-shell - Graphical shell for the GNOME desktop
+
+SYNOPSIS
+--------
+*gnome-shell* ['OPTION'...]
+
+DESCRIPTION
+-----------
+GNOME shell provides core user interface functions for the GNOME 3 desktop,
+like switching to windows and launching applications. GNOME shell takes
+advantage of the capabilities of modern graphics hardware and introduces
+innovative user interface concepts to provide a visually attractive and
+easy to use experience.
+
+gnome-shell is a required component of the GNOME desktop, i.e. it is listed in
+the RequiredComponents field of /usr/share/gnome-session/sessions/gnome.session.
+It is started in the window manager phase of the session.
+
+OPTIONS
+-------
+*-r*, *--replace*::
+Replace the running window manager
+
+*--sm-disable*::
+Disable connection to the session manager
+
+*--sm-client-id*='ID'::
+Specify session management 'ID'
+
+*--sm-save-file*='FILE'::
+Initialize session from 'FILE'
+
+*--screen*='SCREEN'::
+X screen to use
+
+*-d*, *--display*='DISPLAY'::
+X display to use
+
+*--sync*::
+Make X calls synchronous
+
+*--version*::
+Print version and exit
+
+*--help*::
+Display help and exit
+
+*--mode*='MODE'::
+Use a specific mode, e.g. "gdm" for login screen
+
+*--list-modes*::
+List possible modes and exit
+
+*--clutter-display*='DISPLAY'::
+Clutter the option display (otherwise ignored)
+
+FILES
+-----
+/usr/share/gnome-session/sessions/gnome.session,
+/usr/share/applications/org.gnome.Shell.desktop.
+
+BUGS
+----
+The bug tracker can be reached by visiting the website
+https://bugzilla.gnome.org/buglist.cgi?product=gnome-shell.
+Before sending a bug report, please verify that you have the latest version
+of gnome-shell. Many bugs (major and minor) are fixed at each release, and
+if yours is out of date, the problem may already have been solved.
+
+ADDITIONAL INFORMATION
+----------------------
+For further information, visit the website https://wiki.gnome.org/Projects/GnomeShell.
diff --git a/man/meson.build b/man/meson.build
index 9d39a38b8c..aa37ef0f3a 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -1,19 +1,7 @@
 custom_target('man page',
-  input: 'gnome-shell.xml',
+  input: ['gnome-shell.txt', 'stylesheet.xsl'],
   output: 'gnome-shell.1',
-  command: [
-    xsltproc,
-    '-o', '@OUTPUT@',
-    '--nonet',
-    '--stringparam', 'man.output.quietly', '1',
-    '--stringparam', 'funcsynopsis.style', 'ansi',
-    '--stringparam', 'man.th.extra1.suppress', '1',
-    '--stringparam', 'man.authors.section.enabled', '0',
-    '--stringparam', 'man.copyright.section.enabled', '0',
-    'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
-    '@INPUT@'
-  ],
-  build_by_default: true,
+  command: [a2x, '-D', '@OUTDIR@', '--xsl-file', '@INPUT1@', '-f' ,'manpage', '@INPUT0@'],
   install_dir: mandir + '/man1',
   install: true
 )
diff --git a/man/stylesheet.xsl b/man/stylesheet.xsl
new file mode 100644
index 0000000000..047bd1b59d
--- /dev/null
+++ b/man/stylesheet.xsl
@@ -0,0 +1,27 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+               version='1.0'>
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
+
+<xsl:template match="variablelist/title">
+  <xsl:text>.PP&#10;</xsl:text>
+  <xsl:call-template name="bold">
+    <xsl:with-param name="node" select="."/>
+    <xsl:with-param name="context" select=".."/>
+  </xsl:call-template>
+  <xsl:text>&#10;</xsl:text>
+</xsl:template>
+
+<xsl:template match="varlistentry[preceding-sibling::title]">
+  <xsl:if test="not(preceding-sibling::varlistentry)">
+    <xsl:text>.RS 4&#10;</xsl:text>
+    <!-- comment out the leading .PP added by the original template -->
+    <xsl:text>.\"</xsl:text>
+  </xsl:if>
+  <xsl:apply-imports/>
+  <xsl:if test="position() = last()">
+    <xsl:text>.RE&#10;</xsl:text>
+  </xsl:if>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/meson.build b/meson.build
index c77c519269..71b3ca4717 100644
--- a/meson.build
+++ b/meson.build
@@ -126,8 +126,7 @@ else
 endif
 
 if get_option('man')
-  xsltproc = find_program('xsltproc')
-
+  a2x = find_program('a2x')
   subdir('man')
 endif
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]