Commit 57c4fd48 authored by Nick Schermer's avatar Nick Schermer Committed by Jannis Pohlmann

Build manual documentation during make.

This will generate the manual during make if --enable-gen-doc
is used and only ship the generated html files in the dist
tarball. It will automatically pick up new translations (see
bug #6036) and print xml valid warnings which are useful for
translators to valid their translations.

All documentation is now also installed in @docdir@ (bug #5810).

Symlink to C images if the language does not ship its own
screenshots. This will reduce the tarball and installation
size a lot.

To keep the patch small, the existing translation directories are not
removed. Please do this after appying the patch:
  git rm -fr docs/manual/{C,da,es,eu,fr,gl,it,ja,nl,pl,ru,tr,zh_TW}
Optionally the po-doc/ChangeLog files should be deleted too.
Signed-off-by: Nick Schermer's avatarNick Schermer <nick@xfce.org>
Signed-off-by: default avatarJannis Pohlmann <jannis@xfce.org>
parent d1927ac4
......@@ -85,7 +85,6 @@ DISTCLEANFILES = \
DISTCHECK_CONFIGURE_FLAGS = \
--enable-gtk-doc \
--enable-xml2po \
--enable-xsltproc
--enable-gen-doc
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
......@@ -19,7 +19,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
HELPDIR="@datadir@/doc/Thunar/html/"
HELPDIR="@docdir@/html/"
if test -n "$LC_ALL"; then
LC=$LC_ALL
......
......@@ -178,29 +178,28 @@ dnl *** Check for gtk-doc ***
dnl *************************
GTK_DOC_CHECK([1.0])
dnl **************************
dnl *** Check for xsltproc ***
dnl **************************
AC_ARG_ENABLE([xsltproc], [AC_HELP_STRING([--enable-xsltproc], [Use xsltproc to build documentation @<:@default=no@:>@])],, [enable_xsltproc=no])
if test x"$enable_xsltproc" = x"yes"; then
AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
if test x"$XSLTPROC" = x"no"; then
enable_xsltproc=no
fi
fi
AM_CONDITIONAL([ENABLE_XSLTPROC], [test x"$enable_xsltproc" = x"yes"])
dnl ***************************************************
dnl *** Check if we need to build the documentation ***
dnl ***************************************************
AC_ARG_ENABLE([gen-doc], [AC_HELP_STRING([--enable-gen-doc],
[Generate HTML documentation (requires xsltproc, xml2po and xmllint) [default=no]])],, [enable_gen_doc=no])
if test x"$enable_gen_doc" = x"yes"; then
AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
if test x"$XSLTPROC" = x"no"; then
enable_gen_doc=no
fi
AC_PATH_PROG([XML2PO], [xml2po], [no])
if test x"$XML2PO" = x"no"; then
enable_gen_doc=no
fi
dnl ************************
dnl *** Check for xml2po ***
dnl ************************
AC_ARG_ENABLE([xml2po], [AC_HELP_STRING([--enable-xml2po], [Use xml2po to translate documentation @<:@default=no@:>@])],, [enable_xml2po=no])
if test x"$enable_xml2po" = x"yes"; then
AC_PATH_PROG([XML2PO], [xml2po], [no])
if test x"$XML2PO" = x"no"; then
enable_xml2po=no
fi
AC_PATH_PROG([XMLLINT], [xmllint], [no])
if test x"$XML2PO" = x"no"; then
enable_gen_doc=no
fi
fi
AM_CONDITIONAL([ENABLE_XML2PO], [test x"$enable_xml2po" = x"yes"])
AM_CONDITIONAL([GENERATE_DOCUMENTATION], [test x"$enable_gen_doc" = x"yes"])
dnl ***********************************
dnl *** Check for debugging support ***
......@@ -251,45 +250,10 @@ Thunar.spec
docs/Makefile
docs/design/Makefile
docs/manual/Makefile
docs/manual/C/Makefile
docs/manual/C/Thunar.xml
docs/manual/C/images/Makefile
docs/manual/da/Makefile
docs/manual/da/Thunar.xml
docs/manual/da/images/Makefile
docs/manual/es/Makefile
docs/manual/es/Thunar.xml
docs/manual/es/images/Makefile
docs/manual/eu/Makefile
docs/manual/eu/Thunar.xml
docs/manual/eu/images/Makefile
docs/manual/fr/Makefile
docs/manual/fr/Thunar.xml
docs/manual/fr/images/Makefile
docs/manual/gl/Makefile
docs/manual/gl/Thunar.xml
docs/manual/gl/images/Makefile
docs/manual/it/Makefile
docs/manual/it/Thunar.xml
docs/manual/it/images/Makefile
docs/manual/ja/Makefile
docs/manual/ja/Thunar.xml
docs/manual/ja/images/Makefile
docs/manual/nl/Makefile
docs/manual/nl/Thunar.xml
docs/manual/nl/images/Makefile
docs/manual/pl/Makefile
docs/manual/pl/Thunar.xml
docs/manual/pl/images/Makefile
docs/manual/ru/Makefile
docs/manual/ru/Thunar.xml
docs/manual/ru/images/Makefile
docs/manual/tr/Makefile
docs/manual/tr/Thunar.xml
docs/manual/tr/images/Makefile
docs/manual/zh_TW/Makefile
docs/manual/zh_TW/Thunar.xml
docs/manual/zh_TW/images/Makefile
docs/manual/images/Makefile
docs/manual/images/fr/Makefile
docs/manual/images/ja/Makefile
docs/manual/images/pl/Makefile
docs/papers/Makefile
docs/reference/Makefile
docs/reference/thunarx/Makefile
......@@ -341,6 +305,7 @@ else
echo "* Startup Notification: no"
fi
echo "* Debug Support: $enable_debug"
echo "* Generate Documentation: $enable_gen_doc"
echo
echo "Additional Plugins:"
echo
......
......@@ -6,7 +6,6 @@ SUBDIRS = \
papers \
reference
docdir = $(datadir)/doc/Thunar
doc_DATA = \
README.gtkrc \
README.thunarrc \
......
SUBDIRS = \
C \
da \
es \
eu \
fr \
gl \
it \
ja \
nl \
pl \
ru \
tr \
zh_TW
cssdir = $(datadir)/doc/Thunar/html
css_DATA = \
SUBDIRS = \
images
STYLESHEET = $(PACKAGE)-html.xsl
DOCUMENT = $(PACKAGE).xml
LINGUAS = $(shell cd $(top_srcdir)/po-doc && echo `/bin/ls *.po | sed 's,[.]po,,g'`)
ALL_LINGUAS = C $(LINGUAS)
# install the html files to the destdir
install-data-local:
for lang in $(ALL_LINGUAS); do \
if test -d $(srcdir)/html/$$lang; then \
dest=$(DESTDIR)$(docdir)/html/$$lang; \
$(mkinstalldirs) $$dest; \
installfiles=`echo $(srcdir)/html/$$lang/*`; \
for file in $$installfiles; do \
echo "--- Installing "$$file; \
$(INSTALL_DATA) $$file $$dest; \
done; \
if test x"$$lang" != x"C" -a ! -d $(srcdir)/images/$$lang; then \
echo "--- Creating symlink to C images for $$lang"; \
ln -sf $(docdir)/html/C/images $(DESTDIR)$(docdir)/html/$$lang/images; \
fi \
fi \
done;
# remove installed files from the destdir
uninstall-local:
for lang in $(ALL_LINGUAS); do \
dest=$(DESTDIR)$(docdir)/html/$$lang; \
if test -d $$dest; then \
if test -L $$dest/images; then \
rm -rf $$dest; \
else \
rm -f $$dest/*.html; \
fi \
fi \
done
# remove generate html from the srcdir
clean-local:
rm -rf $(srcdir)/html
if GENERATE_DOCUMENTATION
# regenerate po(t) files
update-po:
rm -f $(top_srcdir)/po-doc/$(GETTEXT_PACKAGE).pot; \
$(XML2PO) -o $(top_srcdir)/po-doc/$(GETTEXT_PACKAGE).pot $(srcdir)/$(DOCUMENT); \
for lang in $(LINGUAS); do \
pofile=$(top_srcdir)/po-doc/$$lang.po; \
$(XML2PO) -u $(top_srcdir)/po-doc/$$lang.po $(srcdir)/$(DOCUMENT); \
done
# build the translated help files
doc-build.stamp: $(srcdir)/$(DOCUMENT) $(srcdir)/$(STYLESHEET)
@chmod -R u+w $(srcdir); \
rm -rf $(srcdir)/html; \
echo; \
for lang in $(ALL_LINGUAS); do \
pofile=$(top_srcdir)/po-doc/$$lang.po; \
echo "*** Generating $$lang documentation"; \
if test x"$$lang" = x"C"; then \
cp $(srcdir)/$(DOCUMENT) xgen-doc; \
else \
echo "Building the translated DocBook XML file"; \
$(XML2PO) -e -l $$lang -p $$pofile $(srcdir)/$(DOCUMENT) > xgen-doc; \
rm -f .xml2po.mo; \
fi; \
sed -e "s,\@PACKAGE_NAME\@,$(PACKAGE_NAME),g" \
-e "s,\@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g" \
-i xgen-doc; \
echo "Validating DocBook XML file"; \
$(XMLLINT) --noout --valid xgen-doc; \
echo "Creating the HTML pages"; \
$(XSLTPROC) --nonet -o $(srcdir)/html/$$lang/ $(srcdir)/$(STYLESHEET) xgen-doc; \
chmod -R u+w $(srcdir)/html/$$lang; \
rm -f xgen-doc; \
echo; \
done; \
touch doc-build.stamp
dist-check-doc: all
else
update-po:
@echo "*** You need to compile with --enable-gen-doc in order to make update-po"
@false
doc-build.stamp:
@if test ! -d $(srcdir)/html; then \
echo; \
echo "*** No generated documentation found. If you want to"; \
echo "*** generate the (translated) documentation, run configure"; \
echo "*** with --enable-gen-doc."; \
echo; \
fi
dist-check-doc:
@echo "*** You need to compile with --enable-gen-doc in order to make dist"
@false
endif
# always try to build (if compiling with --enable-build-doc) or print
# a message if no html files were found in the tarball
all: doc-build.stamp
# include the html and man files in the dist
dist-hook: dist-check-doc doc-build.stamp
for lang in $(ALL_LINGUAS); do \
if test -d $(srcdir)/html/$$lang; then \
mkdir -p $(distdir)/html/$$lang; \
cp $(srcdir)/html/$$lang/* $(distdir)/html/$$lang/; \
fi \
done
# css file
cssdir = $(docdir)/html
css_DATA = \
thunar.css
EXTRA_DIST = \
$(css_DATA) \
thunar.xsl
EXTRA_DIST = \
$(css_DATA) \
$(STYLESHEET) \
$(DOCUMENT)
CLEANFILES = \
xgen-doc \
doc-build.stamp
......@@ -37,10 +37,10 @@
<firstname>Benedikt</firstname>
<surname>Meurer</surname>
<affiliation>
<address><email>benny@xfce.org</email></address>
<jobtitle>Software developer</jobtitle>
<orgname>os-cillation</orgname>
<orgdiv>System development</orgdiv>
<jobtitle>Software developer</jobtitle>
<address><email>benny@xfce.org</email></address>
</affiliation>
</author>
</authorgroup>
......@@ -65,11 +65,11 @@
</para>
<itemizedlist>
<listitem>Create folders and documents.</listitem>
<listitem>Display your files and folders.</listitem>
<listitem>Manage your files and folders.</listitem>
<listitem>Run and manage custom actions.</listitem>
<listitem>Access Removable Media.</listitem>
<listitem><para>Create folders and documents.</para></listitem>
<listitem><para>Display your files and folders.</para></listitem>
<listitem><para>Manage your files and folders.</para></listitem>
<listitem><para>Run and manage custom actions.</para></listitem>
<listitem><para>Access Removable Media.</para></listitem>
</itemizedlist>
</sect1>
......@@ -1092,39 +1092,39 @@ X-Thumbnailer-Exec=your-thumbnailer %i %o %s</programlisting>
<varlistentry>
<term><varname>%i</varname></term>
<listitem>
The local path to the input file for which to create a thumbnail. May be either a path relative to the directory from which the
thumbnailer was invoked or an absolute path.
<para>The local path to the input file for which to create a thumbnail. May be either a path relative to the directory from which the
thumbnailer was invoked or an absolute path.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>%o</varname></term>
<listitem>
The local path to the output file where to store the generated thumbnail. The output file must be written as valid PNG file according
<para>The local path to the output file where to store the generated thumbnail. The output file must be written as valid PNG file according
to the thumbnail standard (see above). Note that the path may not end with <literal>.png</literal>, which matters if you invoke certain
third party tools.
third party tools.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>%s</varname></term>
<listitem>
The desired size of the generated thumbnail in pixels. This parameter is optional.
<para>The desired size of the generated thumbnail in pixels. This parameter is optional.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>%u</varname></term>
<listitem>
Similar to <literal>%i</literal>, but substituted with the URI of the file, rather than the path. This was added for compatibility with
GNOME.
<para>Similar to <literal>%i</literal>, but substituted with the URI of the file, rather than the path. This was added for compatibility with
GNOME.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>%%</varname></term>
<listitem>
Will be substituted with a single <literal>%</literal>.
<para>Will be substituted with a single <literal>%</literal>.</para>
</listitem>
</varlistentry>
</variablelist>
......@@ -1413,7 +1413,7 @@ $ sudo install eps-thumbnailer.desktop /usr/local/share/thumbnailers/eps-thumbna
a request</ulink>.
</para>
<sect3 id="faq-executables">
<sect2 id="faq-executables">
<title>Why doesn't Thunar execute files marked as executable?</title>
<para>
......@@ -1431,9 +1431,9 @@ $ sudo install eps-thumbnailer.desktop /usr/local/share/thumbnailers/eps-thumbna
type has a parent that matches one of the two types listed above, or if the MIME-type is an alias for
one of the above.
</para>
</sect3>
</sect2>
<sect3 id="faq-metadata">
<sect2 id="faq-metadata">
<title>Where does Thunar store the metadata associated with files?</title>
<para>
......@@ -1444,9 +1444,9 @@ $ sudo install eps-thumbnailer.desktop /usr/local/share/thumbnailers/eps-thumbna
using the <command>tdbtool</command>, which is part of the Thunar distribution
(located in the <filename role="directory">tdb/</filename> subdirectory).
</para>
</sect3>
</sect2>
<sect3 id="faq-thunarrc">
<sect2 id="faq-thunarrc">
<title>Where does Thunar store its preferences?</title>
<para>
......@@ -1456,9 +1456,9 @@ $ sudo install eps-thumbnailer.desktop /usr/local/share/thumbnailers/eps-thumbna
using a text editor. See <filename>docs/README.thunarrc</filename> for an
overview of the various preferences.
</para>
</sect3>
</sect2>
<sect3 id="faq-mouse-gestures">
<sect2 id="faq-mouse-gestures">
<title>How to use mouse gestures in Thunar?</title>
<para>
......@@ -1476,9 +1476,9 @@ $ sudo install eps-thumbnailer.desktop /usr/local/share/thumbnailers/eps-thumbna
<member><guilabel>Right</guilabel> - opens the next visited folder</member>
<member><guilabel>Down</guilabel> - reloads the current folder</member>
</simplelist>
</sect3>
</sect2>
<sect3 id="faq-assign-keyboard-shortcuts">
<sect2 id="faq-assign-keyboard-shortcuts">
<title>How do I assign different keyboard shortcuts?</title>
<para>
......@@ -1521,9 +1521,9 @@ $ sudo install eps-thumbnailer.desktop /usr/local/share/thumbnailers/eps-thumbna
</para>
</listitem>
</itemizedlist>
</sect3>
</sect2>
<sect3 id="faq-store-keyboard-shortcuts">
<sect2 id="faq-store-keyboard-shortcuts">
<title>Where does Thunar store the keyboard shortcuts?</title>
<para>
......@@ -1541,7 +1541,7 @@ $ sudo install eps-thumbnailer.desktop /usr/local/share/thumbnailers/eps-thumbna
(the default for most Linux distributions), you can install system wide defaults to
<filename>/etc/xdg/Thunar/accels.scm</filename>. Thunar will then load shortcuts from this file on first startup.
</para>
</sect3>
</sect2>
</sect1>
......
# $Id$
SUBDIRS = \
fr \
ja \
pl
imagesdir = $(datadir)/doc/Thunar/html/pl/images
imagesdir = $(docdir)/html/C/images
images_DATA = \
bulk-rename.png \
file-manager-window.png \
......
# $Id$
imagesdir = $(datadir)/doc/Thunar/html/C/images
imagesdir = $(docdir)/html/fr/images
images_DATA = \
bulk-rename.png \
file-manager-window.png \
......
# $Id$
imagesdir = $(datadir)/doc/Thunar/html/fr/images
imagesdir = $(docdir)/html/ja/images
images_DATA = \
bulk-rename.png \
file-manager-window.png \
......
# $Id$
imagesdir = $(datadir)/doc/Thunar/html/ja/images
imagesdir = $(docdir)/html/pl/images
images_DATA = \
bulk-rename.png \
file-manager-window.png \
......
## Makefile.am file for the XML documents translation.
##
## Copyright (C) 2006 The Xfce development team.
##
## Written by Daichi Kawahata <daichi@xfce.org>, 2006.
##
## This file 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, or (at your option)
## any later version.
##
## This file 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 this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
## 02111-1307, USA.
##
## Rules to auto-generate translated XML files
##
## At first, you need to install `xml2po' package maintained by
## GNOME team, too bad it's not a separated package (and depends
## libxml2 >= 2.5.11), to get a workable package, try the following
## steps:
##
## cvs -d:pserver:anonymous@anoncvs.gnome.org:/cvs/gnome login
## (RETURN)
## cvs -d:pserver:anonymous@anoncvs.gnome.org:/cvs/gnome co \
## gnome-doc-utils/xml2po
## cd gnome-doc-utils/xml2po && ./autogen.sh && make
##
## For developers: Nothing, you need nothing to do basically,
## however it's appreciated if you'll install the package above,
## keep updating POT, PO files when you'll update your documents.
##
## For translators: Just translate your PO file with your favorite
## editor, if you see no PO file for your language, then type
## `msginit' in this directory and enter your contact address.
##
## For maintainers: You're supposed to watch every changes made
## by the developers, translators; if POT, PO files are out-of-
## dated or generated XML files are committed properly.
##
## A problem could be the matter is, it takes a time to update
## entire files due to its size and processing method in general
## (comparing with the gettext PO files), also with the same
## reason, it costs a certain disk spaces against the repository.
##
srcdir = @srcdir@
top_srcdir = @top_srcdir@
docdir = $(top_srcdir)/docs/manual
langs=`cd $(srcdir) && ls *.po 2>/dev/null | sed 's/\(.*\)\.po/\1/'`
if ENABLE_XML2PO
all-local: $(PACKAGE).pot
$(PACKAGE).pot: $(docdir)/C/$(PACKAGE).xml.in
$(XML2PO) -o $(PACKAGE).pot $(docdir)/C/$(PACKAGE).xml.in