Begin to add a manpage and also its equivalent XML-based www-readable equivalent

This commit is contained in:
Mke Brady
2014-11-15 16:20:20 +00:00
parent 6b1e4d49df
commit 5bdc16e3b4
8 changed files with 672 additions and 2 deletions
+2
View File
@@ -1,3 +1,5 @@
SUBDIRS = man
bin_PROGRAMS = shairport-sync
shairport_sync_SOURCES = shairport.c rtsp.c mdns.c mdns_external.c common.c rtp.c player.c alac.c audio.c audio_dummy.c audio_pipe.c
+20 -2
View File
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.50])
AC_INIT([shairport-sync], [2.1.10], [mikebrady@eircom.net])
AC_INIT([shairport-sync], [2.1.11], [mikebrady@eircom.net])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([shairport.c])
AC_CONFIG_HEADERS([config.h])
@@ -129,10 +129,28 @@ AM_CONDITIONAL([USE_DNS_SD], [test "x$HAS_DNS_SD" = "x1"])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([getopt_long.h])
AC_CHECK_HEADERS([arpa/inet.h fcntl.h mach/mach.h memory.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h syslog.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([clock_gettime gethostname gettimeofday inet_ntoa memchr memmove memset pow select socket stpcpy strcasecmp strchr strdup strerror strstr strtol strtoul])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([Makefile man/Makefile])
AC_OUTPUT
+1
View File
@@ -0,0 +1 @@
man_MANS = shairport-sync.7
+116
View File
@@ -0,0 +1,116 @@
.TH shairport-sync 7 User Manuals
.SH NAME
shairport-sync \- iTunes / AirPlay synchronised audio player
.SH SYNOPSIS
\fBshairport-sync [-dvw]\fB [-A \fB\fIname\fB]\fB [-a \fB\fIlatency\fB]\fB [-B \fB\fIcommand\fB]\fB [-E \fB\fIcommand\fB]\fB [-i \fB\fIlatency\fB]\fB [-m \fB\fIbackend\fB]\fB [-o \fB\fIbackend\fB]\fB [-r \fB\fIthreshold\fB]\fB [-S \fB\fImode\fB]\fB [-t \fB\fItimeout\fB]\fB [-- \fB\fIaudio_backend_options\fB]\fB
shairport-sync -D\fB
shairport-sync -h\fB
shairport-sync -k\fB
shairport-sync -h\fB
shairport-sync -R\fB
shairport-sync -V\fB
\f1
.SH DESCRIPTION
shairport-sync plays audio streamed from iTunes or from an AirPlay device to an audio device connected via an audio back end. (At present, only an ALSA audio back end has been implemented.)
A feature of shairport-sync is that the audio is played synchronously. This means that if many devices are playing the same stream at the same time, all the outputs will stay in step with one another. This allows multiple devices play the same source without getting out of phase with one another, enabling, for example, simultaneous multi-room operation.
.SH OPTIONS
Many of the options take sensible default values, so you can normally ignore most of them. See the EXAMPLES section for typical usages.
The command line for shairport-sync can take two kinds of options: regular program options and audio backend options. Program options are always listed first, followed by any audio backend options separated by a -- symbol.
.SH PROGRAM OPTIONS
These options are used by shairport-sync itself.
.TP
\fB-A | --AirPlayLatency=\f1\fIlatency\f1
Use this latency, in frames, for audio streamed from an AirPlay device. The default is 88,200 frames, where there are 44,100 frames to the second.
.TP
\fB-a \f1\fIservice name\f1\fB | --name=\f1\fIservice name\f1
Use this service name to identify this player in iTunes, etc. The default name is "Shairport Sync on <hostname>".
.TP
\fB-B \f1\fIprogram\f1\fB | --on-start=\f1\fIprogram\f1
Execute \fIprogram\f1 when playback is about to begin. Specify the full path to the program, e.g. \fI/usr/bin/logger\f1. Executable scripts can be used, but they must have \fI#!/bin/sh\f1 (or whatever is appropriate) in the headline.
If you want shairport-sync to wait until the command has completed before starting to play, select the \fB-w\f1 option as well.
.TP
\fB-D | --disconnectFromOutput\f1
Disconnect the shairport-sync daemon from the output device and exit. (Requires that the daemon has written its PID to an agreed file -- see the \fB-d\f1 option).
.TP
\fB-d | --daemon\f1
Instruct shairport-sync to demonise itself. It will write its Process ID (PID) to a file, usually at /var/run/shairport-sync.pid, which is used by the \fB-k\f1, \fB-D\f1 and \fB-R\f1 options to locate the daemon at a later time.
.TP
\fB-E \f1\fIprogram\f1\fB | --on-stop=\f1\fIprogram\f1
Execute \fIprogram\f1 when playback has ended. Specify the full path to the program, e.g. \fI/usr/bin/logger\f1. Executable scripts can be used, but they must have \fI#!/bin/sh\f1 (or whatever is appropriate) in the headline.
If you want shairport-sync to wait until the command has completed before continuing, select the \fB-w\f1 option as well.
.TP
\fB-h | --help\f1
Print brief help message and exit.
.TP
\fB-i | --iTunesLatency=\f1\fIlatency\f1
Use this latency, in frames, for audio streamed from an iTunes source. The default is 99,400 frames, where there are 44,100 frames to the second.
.TP
\fB-k | --kill\f1
Kill the shairport-sync daemon and exit. (Requires that the daemon has written its PID to an agreed file -- see the \fB-d\f1 option).
.TP
\fB-m \f1\fImdnsbackend\f1\fB | --mdns=\f1\fImdnsbackend\f1
Force the use of the specified mDNS backend to advertise the player on the network. The default is to try them all until one works.
.TP
\fB-o \f1\fIoutputbackend\f1\fB | --output=\f1\fIoutputbackend\f1
Force the use of the specified output backend to play the audio. The default is to try the first one. (This is not used at present.)
.TP
\fB-p \f1\fIport\f1\fB | --port=\f1\fIport\f1
Listen for play requests on \fIport\f1. The default is to use port 5000.
.TP
\fB-R | --reconnectoToOutput\f1
Reconnect the shairport-sync daemon to the output device and exit. It may take a few seconds to synchronise. (Requires that the daemon has written its PID to an agreed file -- see the \fB-d\f1 option).
.TP
\fB-r \f1\fIthreshold\f1\fB | --resync=\f1\fIthreshold\f1
Resynchronise if timings differ by more than \fIthreshold\f1 frames. If the output timing differs from the source timing by more than the threshold, output will be muted and a full resynchronisation will occur. The default threshold is 2,205 frames, i.e. 50 milliseconds. Specify \fB0\f1 to disable resynchronisation.
.TP
\fB-S \f1\fImode\f1\fB | --stuffing=\f1\fImode\f1
Stuff the audio stream using the \fImode\f1. "Stuffing" refers to the process of adding or removing frames of audio to or from the stream sent to the output device to keep it exactly in synchrony with the player. The default mode, \fBbasic\f1, is normally almost completely inaudible. The alternative mode, \fBsoxr\f1, is even less obtrusive but requires much more processing power. For this mode, support for libsoxr, the SoX Resampler Library, must be selected when shairport-sync is compiled.
.TP
\fB-t \f1\fItimeout\f1\fB | --timeout=\f1\fItimeout\f1
Exit play mode if the stream disappears for more than \fItimeout\f1 seconds.
When shairport-sync plays an audio stream, it startes a play session and will return a busy signal to any other sources that attempt to use it. If the audio stream disappears for longer than \fItimeout\f1 seconds, the play session will be terminated. If you specify a timeout time of \fB0\f1, shairport-sync will never signal that it is busy and will not prevent other sources from "barging in" on an existing play session. The default value is 120 seconds.
.TP
\fB-V | --version\f1
Print version information and exit.
.TP
\fB-v | --verbose\f1
Print debug information. Repeat up to three times to get more detail.
.TP
\fB-w | --wait-cmd\f1
Wait for commands specified using \fB-B\f1 or \fB-E\f1 to complete before continuing execution.
.SH AUDIO BACKEND OPTIONS
These options are passed to the chosen audio backend. (At present, the only backend implemented is for ALSA.) The audio backend options are preceded by a \fB--\f1 symbol to introduce them and to separate them from any program options. In this way, option letters can be reused as program options and as audio backend options without ambiguity. For instance, the option \fB-d\f1 is interpreted as the daemonise option when read as a program option, and is interpreted as a device selection option when read as an audio backend option.
.TP
\fB-c \f1\fIcontrolname\f1
Use the hardware volume control called \fIcontrolname\f1. This is needed if the output type is specified, using the \fB-t\f1 option, to be \fBhardware\f1. There is no default.
.TP
\fB-d \f1\fIdevice\f1
Use the specified output \fIdevice\f1. The default is the device named \fBdefault\f1.
.TP
\fB-t \f1\fIdevicetype\f1
The type of the output device is \fIdevicetype\f1 which must be \fBhardware\f1 or \fBsoftware\f1. The default is \fBsoftware\f1. If you specify \fBhardware\f1 you must also specify the name of the volume control using the \fB-c\f1 option.
.SH EXAMPLES
Here is a typical example:
shairport-sync \fB-d\f1 \fB-a "Joe's Stereo"\f1 \fB-S soxr\f1 \fB--\f1 \fB-d hw:1\f1 \fB-t hardware\f1 \fB-c PCM\f1
The program will run in daemon mode ( \fB-d\f1 ), will be visible as "Joe's Stereo" ( \fB-a "Joe's Stereo"\f1 ) and will use the SoX Resampler Library-based stuffing ( \fB-S soxr\f1 ). The audio backend options following the \fB--\f1 separator specify that the audio will be output on the ALSA device called hw:1 ( \fB-d hw:1\f1 ), and will take advantage of that device's hardware ( \fB-t hardware\f1 ) mixer named "PCM" ( \fB-c "PCM"\f1 ).
.SH CREDITS
Mike Brady developed shairport-sync from the original shairport by James Laird.
shairport-sync can be found at \fBhttps://github.com/mikebrady/shairport-sync.\f1
shairport can be found at \fBhttps://github.com/abrasive/shairport.\f1
.SH COMMENTS
This man page was written using \fBxml2man(1)\f1 by Oliver Kurth.
+341
View File
@@ -0,0 +1,341 @@
<?xml version="1.0"?><!--*-nxml-*-->
<!DOCTYPE manpage SYSTEM "xmltoman.dtd">
<?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
<!--
This man pager source file is part of shairport-sync.
Copyright (c) Mike Brady 2014
All rights reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-->
<manpage name="shairport-sync" section="7" desc="Synchronised Audio Player for iTunes / AirPlay">
<synopsis>
<!--
<cmd>shairport-sync <opt>-D</opt> <arg>interface</arg></cmd>
-->
<cmd>shairport-sync <opt>[-dvw]</opt>
<opt>[-A </opt><arg>name</arg><opt>]</opt>
<opt>[-a </opt><arg>latency</arg><opt>]</opt>
<opt>[-B </opt><arg>command</arg><opt>]</opt>
<opt>[-E </opt><arg>command</arg><opt>]</opt>
<opt>[-i </opt><arg>latency</arg><opt>]</opt>
<opt>[-m </opt><arg>backend</arg><opt>]</opt>
<opt>[-o </opt><arg>backend</arg><opt>]</opt>
<opt>[-r </opt><arg>threshold</arg><opt>]</opt>
<opt>[-S </opt><arg>mode</arg><opt>]</opt>
<opt>[-t </opt><arg>timeout</arg><opt>]</opt>
<opt>[-- </opt><arg>audio_backend_options</arg><opt>]</opt>
</cmd>
<cmd>shairport-sync <opt>-D</opt></cmd>
<cmd>shairport-sync <opt>-h</opt></cmd>
<cmd>shairport-sync <opt>-k</opt></cmd>
<cmd>shairport-sync <opt>-h</opt></cmd>
<cmd>shairport-sync <opt>-R</opt></cmd>
<cmd>shairport-sync <opt>-V</opt></cmd>
</synopsis>
<description>
<p>shairport-sync plays audio streamed from iTunes or from an AirPlay
device to an audio device connected via an audio back end. (At present,
only an ALSA audio back end has been implemented.)</p>
<p> A feature of shairport-sync is that the audio is played synchronously.
This means that if many devices are playing the same stream at the same
time, all the outputs will stay in step with one another.
This allows multiple devices play the same source without getting out of phase with one another,
enabling, for example, simultaneous multi-room operation.
</p>
</description>
<options>
<p>Many of the options take sensible default values, so you can normally
ignore most of them. See the EXAMPLES section for typical usages.</p>
<p>The command line for shairport-sync can take two kinds of options:
regular program options and audio backend options. Program options are
always listed first, followed by any audio backend options separated by
a <b>--</b> symbol.</p>
<section name="Program Options">
<p>These options are used by shairport-sync itself.</p>
</section>
<option>
<p><opt>-A | --AirPlayLatency=</opt><arg>latency</arg></p>
<optdesc><p>
Use this latency, in frames, for audio streamed from an AirPlay
device. The default is 88,200 frames, where there are 44,100
frames to the second.
</p></optdesc>
</option>
<option>
<p><opt>-a </opt><arg>service name</arg><opt> | --name=</opt><arg>service name</arg></p>
<optdesc><p>
Use this service name to identify this player in iTunes, etc.
The default name is "Shairport Sync on &lt;hostname&gt;".
</p></optdesc>
</option>
<option>
<p><opt>-B </opt><arg>program</arg><opt> | --on-start=</opt><arg>program</arg></p>
<optdesc><p>
Execute <arg>program</arg> when playback is about to begin. Specify the
full path to the program, e.g. <file>/usr/bin/logger</file>.
Executable scripts can be used, but they must have <file>#!/bin/sh</file> (or
whatever is appropriate) in the headline.</p>
<p>If you want shairport-sync to wait until the command has
completed before starting to play, select the <opt>-w</opt> option as well.
</p></optdesc>
</option>
<option>
<p><opt>-D | --disconnectFromOutput</opt></p>
<optdesc><p>
Disconnect the shairport-sync daemon from the output device and
exit. (Requires that the daemon has written its PID to an agreed
file -- see the <opt>-d</opt> option).
</p></optdesc>
</option>
<option>
<p><opt>-d | --daemon</opt></p>
<optdesc><p>
Instruct shairport-sync to demonise itself. It will write its
Process ID (PID) to a file, usually at
/var/run/shairport-sync.pid, which is used by the
<opt>-k</opt>, <opt>-D</opt> and <opt>-R</opt> options to locate
the daemon at a later time.
</p></optdesc>
</option>
<option>
<p><opt>-E </opt><arg>program</arg><opt> | --on-stop=</opt><arg>program</arg></p>
<optdesc><p>
Execute <arg>program</arg> when playback has ended. Specify the
full path to the program, e.g. <file>/usr/bin/logger</file>.
Executable scripts can be used, but they must have <file>#!/bin/sh</file> (or
whatever is appropriate) in the headline.</p>
<p>If you want shairport-sync to wait until the command has
completed before continuing, select the <opt>-w</opt> option as well.
</p></optdesc>
</option>
<option>
<p><opt>-h | --help</opt></p>
<optdesc><p>
Print brief help message and exit.
</p></optdesc>
</option>
<option>
<p><opt>-i | --iTunesLatency=</opt><arg>latency</arg></p>
<optdesc><p>
Use this latency, in frames, for audio streamed from an iTunes
source. The default is 99,400 frames, where there are 44,100
frames to the second.
</p></optdesc>
</option>
<option>
<p><opt>-k | --kill</opt></p>
<optdesc><p>
Kill the shairport-sync daemon and exit. (Requires that the daemon has
written its PID to an agreed file -- see the <opt>-d</opt> option).
</p></optdesc>
</option>
<option>
<p><opt>-m </opt><arg>mdnsbackend</arg><opt> | --mdns=</opt><arg>mdnsbackend</arg></p>
<optdesc><p>
Force the use of the specified mDNS backend to advertise the
player on the network. The default is to try them all until one
works.
</p></optdesc>
</option>
<option>
<p><opt>-o </opt><arg>outputbackend</arg><opt> | --output=</opt><arg>outputbackend</arg></p>
<optdesc><p>
Force the use of the specified output backend to play the audio.
The default is to try the first one. (This is not used at
present.)
</p></optdesc>
</option>
<option>
<p><opt>-p </opt><arg>port</arg><opt> | --port=</opt><arg>port</arg></p>
<optdesc><p>
Listen for play requests on <arg>port</arg>. The default is to use port
5000.
</p></optdesc>
</option>
<option>
<p><opt>-R | --reconnectoToOutput</opt></p>
<optdesc><p>
Reconnect the shairport-sync daemon to the output device and
exit. It may take a few seconds to synchronise. (Requires that
the daemon has written its PID to an agreed file -- see the <opt>-d</opt>
option).
</p></optdesc>
</option>
<option>
<p><opt>-r </opt><arg>threshold</arg><opt> | --resync=</opt><arg>threshold</arg></p>
<optdesc><p>
Resynchronise if timings differ by more than <arg>threshold</arg> frames.
If the output timing differs from the source timing by more than
the threshold, output will be muted and a full resynchronisation
will occur. The default threshold is 2,205 frames, i.e. 50
milliseconds. Specify <opt>0</opt> to disable resynchronisation.
</p></optdesc>
</option>
<option>
<p><opt>-S </opt><arg>mode</arg><opt> | --stuffing=</opt><arg>mode</arg></p>
<optdesc><p>
Stuff the audio stream using the <arg>mode</arg>. "Stuffing" refers to the
process of adding or removing frames of audio to or from the
stream sent to the output device to keep it exactly in synchrony
with the player.
The default mode, <opt>basic</opt>, is normally almost completely inaudible.
The alternative mode, <opt>soxr</opt>, is even less obtrusive but
requires much more processing power. For this mode, support for
libsoxr, the SoX Resampler Library, must be selected when
shairport-sync is compiled.
</p></optdesc>
</option>
<option>
<p><opt>-t </opt><arg>timeout</arg><opt> | --timeout=</opt><arg>timeout</arg></p>
<optdesc><p>
Exit play mode if the stream disappears for more than <arg>timeout</arg>
seconds.</p>
<p>When shairport-sync plays an audio stream, it startes a play
session and will return a busy signal to any other sources that
attempt to use it. If the audio stream disappears for longer
than <arg>timeout</arg> seconds, the play session will be terminated.
If you specify a timeout time of <opt>0</opt>,
shairport-sync will never signal that
it is busy and will not prevent other sources from "barging in"
on an existing play session. The default value is 120 seconds.
</p></optdesc>
</option>
<option>
<p><opt>-V | --version</opt></p>
<optdesc><p>
Print version information and exit.
</p></optdesc>
</option>
<option>
<p><opt>-v | --verbose</opt></p>
<optdesc><p>
Print debug information. Repeat up to three times to get more detail.
</p></optdesc>
</option>
<option>
<p><opt>-w | --wait-cmd</opt></p>
<optdesc><p>
Wait for commands specified using <opt>-B</opt> or <opt>-E</opt> to complete before
continuing execution.
</p></optdesc>
</option>
<section name="Audio Backend Options">
<p>These options are passed to the chosen audio backend. (At present, the
only backend implemented is for ALSA.) The audio backend options are
preceded by a <opt>--</opt> symbol to introduce them and to separate them from any
program options. In this way, option letters can be reused as program
options and as audio backend options without ambiguity. For instance,
the option <opt>-d</opt> is interpreted as the daemonise option when read as a
program option, and is interpreted as a device selection option when
read as an audio backend option.</p>
</section>
<option>
<p><opt>-c </opt><arg>controlname</arg></p>
<optdesc><p>
Use the hardware volume control called <arg>controlname</arg>. This is needed if
the output type is specified, using the <opt>-t</opt> option,
to be <opt>hardware</opt>. There is no default.
</p></optdesc>
</option>
<option>
<p><opt>-d </opt><arg>device</arg></p>
<optdesc><p>
Use the specified output <arg>device</arg>.
The default is the device named <opt>default</opt>.
</p></optdesc>
</option>
<option>
<p><opt>-t </opt><arg>devicetype</arg></p>
<optdesc><p>
The type of the output device is <arg>devicetype</arg> which must be
<opt>hardware</opt> or <opt>software</opt>. The default is <opt>software</opt>.
If you specify <opt>hardware</opt> you must also specify the name of the
volume control using the <opt>-c</opt> option.
</p></optdesc>
</option>
</options>
<section name="Examples">
<p>Here is a typical example:</p>
<cmd>shairport-sync <opt>-d</opt>
<opt>-a "Joe's Stereo"</opt>
<opt>-S soxr</opt>
<opt>--</opt>
<opt>-d hw:1</opt>
<opt>-t hardware</opt>
<opt>-c PCM</opt>
</cmd>
<p>The program will run in daemon mode ( <opt>-d</opt> ), will be visible as
"Joe's Stereo" ( <opt>-a "Joe's Stereo"</opt> ) and will use the SoX Resampler Library-based stuffing ( <opt>-S soxr</opt> ).
The audio backend options following the <opt>--</opt> separator specify
that the audio will be output on the ALSA device called hw:1 (
<opt>-d hw:1</opt> ), and will take advantage of that device's hardware (
<opt>-t hardware</opt> ) mixer named "PCM" ( <opt>-c "PCM"</opt> ).
</p>
</section>
<section name="Credits">
<p>Mike Brady developed shairport-sync from the original shairport by James Laird.</p>
<p>shairport-sync can be found at <url href="https://github.com/mikebrady/shairport-sync."/></p>
<p>shairport can be found at <url href="https://github.com/abrasive/shairport."/></p>
</section>
<section name="Comments">
<p>This man page was written using <manref name="xml2man" section="1"
href="http://masqmail.cx/xml2man/"/> by Oliver Kurth.</p>
</section>
</manpage>
+28
View File
@@ -0,0 +1,28 @@
/***
This file is part of avahi.
avahi is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your
option) any later version.
avahi is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with avahi; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***/
body { color: black; background-color: white; }
a:link, a:visited { color: #900000; }
h1 { text-transform:uppercase; font-size: 18pt; }
p { margin-left:1cm; margin-right:1cm; }
.cmd { font-family:monospace; }
.file { font-family:monospace; }
.arg { text-transform:uppercase; font-family:monospace; font-style: italic; }
.opt { font-family:monospace; font-weight: bold; }
.manref { font-family:monospace; }
.option .optdesc { margin-left:2cm; }
+37
View File
@@ -0,0 +1,37 @@
<!--
This file is part of avahi.
avahi is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your
option) any later version.
avahi is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with avahi; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-->
<!ELEMENT manpage (synopsis | description | section | options | seealso)*>
<!ATTLIST manpage name CDATA #REQUIRED section CDATA #REQUIRED desc CDATA #IMPLIED>
<!ELEMENT arg (#PCDATA)>
<!ELEMENT p (#PCDATA | arg | url | manref | opt | file )*>
<!ELEMENT synopsis (cmd | p)+>
<!ELEMENT description (p)+>
<!ELEMENT section (p | option)*>
<!ATTLIST section name CDATA #REQUIRED>
<!ELEMENT option (#PCDATA | p | optdesc)*>
<!ELEMENT optdesc (#PCDATA | p )*>
<!ELEMENT cmd (#PCDATA | arg | opt)*>
<!ELEMENT options (p | option)*>
<!ELEMENT seealso (p)*>
<!ELEMENT opt (#PCDATA)>
<!ELEMENT file (#PCDATA)>
<!ELEMENT manref EMPTY>
<!ATTLIST manref name CDATA #REQUIRED section CDATA #REQUIRED href CDATA #IMPLIED>
<!ELEMENT url EMPTY>
<!ATTLIST url href CDATA #REQUIRED>
+127
View File
@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="iso-8859-15"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<!--
This file is part of avahi.
avahi is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your
option) any later version.
avahi is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with avahi; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-->
<xsl:output method="xml" version="1.0" encoding="iso-8859-15" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes"/>
<xsl:template match="/manpage">
<html>
<head>
<title><xsl:value-of select="@name"/>(<xsl:value-of select="@section"/>)</title>
<style type="text/css">
body { color: black; background-color: white; }
a:link, a:visited { color: #900000; }
h1 { text-transform:uppercase; font-size: 18pt; }
p { margin-left:1cm; margin-right:1cm; }
.cmd { font-family:monospace; }
.file { font-family:monospace; }
.arg { text-transform:uppercase; font-family:monospace; font-style: italic; }
.opt { font-family:monospace; font-weight: bold; }
.manref { font-family:monospace; }
.option .optdesc { margin-left:2cm; }
</style>
</head>
<body>
<h1>Name</h1>
<p><xsl:value-of select="@name"/>
<xsl:if test="string-length(@desc) &gt; 0"> - <xsl:value-of select="@desc"/></xsl:if>
</p>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="p">
<p>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="cmd">
<p class="cmd">
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="arg">
<span class="arg"><xsl:apply-templates/></span>
</xsl:template>
<xsl:template match="opt">
<span class="opt"><xsl:apply-templates/></span>
</xsl:template>
<xsl:template match="file">
<span class="file"><xsl:apply-templates/></span>
</xsl:template>
<xsl:template match="optdesc">
<div class="optdesc">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="synopsis">
<h1>Synopsis</h1>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="seealso">
<h1>Synopsis</h1>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="description">
<h1>Description</h1>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="options">
<h1>Options</h1>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="section">
<h1><xsl:value-of select="@name"/></h1>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="option">
<div class="option"><xsl:apply-templates/></div>
</xsl:template>
<xsl:template match="manref">
<xsl:choose>
<xsl:when test="string-length(@href) &gt; 0">
<a class="manref"><xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute><xsl:value-of select="@name"/>(<xsl:value-of select="@section"/>)</a>
</xsl:when>
<xsl:otherwise>
<span class="manref"><xsl:value-of select="@name"/>(<xsl:value-of select="@section"/>)</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="url">
<a class="url"><xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute><xsl:value-of select="@href"/></a>
</xsl:template>
</xsl:stylesheet>