1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 17:42:17 +00:00
mpv/DOCS/xml
diego 713284ea26 build: Rename configure.log file to config.log
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31415 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:08:56 +02:00
..
cs build: Rename configure.log file to config.log 2010-11-02 04:08:56 +02:00
de build: Rename configure.log file to config.log 2010-11-02 04:08:56 +02:00
en build: Rename configure.log file to config.log 2010-11-02 04:08:56 +02:00
es build: Rename configure.log file to config.log 2010-11-02 04:08:56 +02:00
fr build: Rename configure.log file to config.log 2010-11-02 04:08:56 +02:00
hu build: Rename configure.log file to config.log 2010-11-02 04:08:56 +02:00
it build: Rename configure.log file to config.log 2010-11-02 04:08:56 +02:00
pl build: Rename configure.log file to config.log 2010-11-02 04:08:56 +02:00
ru build: Rename configure.log file to config.log 2010-11-02 04:08:56 +02:00
xsl the great MPlayer tab removal: part I 2010-04-12 10:56:17 +00:00
zh_CN build: Rename configure.log file to config.log 2010-11-02 04:08:56 +02:00
configure the great MPlayer tab removal: part I 2010-04-12 10:56:17 +00:00
default.css the great MPlayer tab removal: part I 2010-04-12 10:56:17 +00:00
html-common.xsl Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
ldp.dsl the great MPlayer tab removal: part I 2010-04-12 10:56:17 +00:00
Makefile 10l: Use the directory part of the stylesheet path to create a directory. 2010-05-11 22:31:47 +00:00
README Merge both XML documentation README files into one. 2010-05-11 21:25:12 +00:00

Tools required for building the documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* GNU make 3.80 or later
* DocBook 4.1.2 or later
* The DocBook XML DTD (also known as DocBk XML)
* DocBook XSL stylesheets -- version 1.50.0 or later is recommended.

I am not quite sure which tools work, but I used the following
ones successfully, so they are required:

* xmllint (part of libxml2) is used for validation.
* xsltproc (part of libxslt1) is used for transforming XML files into HTML
  files. Version 1.0.18 or later is recommended.

It's also possible to use the Saxon XSLT Processor. The Russian translator
used it (version 6.4.4) for a while. If you have a suitable JavaVM and a
saxon.jar installed somewhere, configure will try to detect them. If
autodetection fails, try to tweak DOCS/xml/configure to get it working and
send us a patch :)

On Red Hat systems you need the following packages:
libxml2, libxslt, docbook-dtds, docbook-style-xsl

On Debian Sarge you will need these packages:
docbook-xml, docbook-xsl, xsltproc, libxml2-utils


Installing the required tools from source
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1) Download libxslt AND libxml2 packages from
   http://xmlsoft.org/XSLT/downloads.html

   Installing them should be straightforward, execute the usual "./configure"
   and "make" then "make install" commands.


2) Download the docbook-xml package from http://www.oasis-open.org/docbook/xml/
   Use the newest version. The URL will be something like this:

    http://www.oasis-open.org/docbook/xml/4.2/docbook-xml-4.2.zip

   Extract this package into a directory, enter it, and execute the following
   commands:

    mkdir -p /usr/share/sgml/docbook/dtd/xml/4.2/
    cp -r * /usr/share/sgml/docbook/dtd/xml/4.2/


3) Download the docbook-xsl package from
   http://prdownloads.sourceforge.net/docbook/

   Use the newest version. The URL will be something like this:

    http://prdownloads.sourceforge.net/docbook/docbook-xsl-1.62.0.tar.gz

   Extract this package into a directory, enter it, and execute the following
   commands:

    mkdir -p /usr/share/sgml/docbook/stylesheet/xsl/nwalsh
    cp -r VERSION common html lib /usr/share/sgml/docbook/stylesheet/xsl/nwalsh


Building the documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~

Before trying to build the documentation, run

  make help

to see all available build targets and make your choice. If something goes
wrong, check the Configuration section of the toplevel Makefile and adjust
the variables.

The documentation and its translations reside in subdirectories.
When building the documentation, the generated HTML files are
placed in subdirectories of the 'HTML' directory.

IMPORTANT: Do NOT place sensitive files under 'HTML'!
           It is for generated documentation only.
           The whole directory tree is wiped out by the Makefile
           when running 'make distclean' or 'make clean'.


Adding new translations
~~~~~~~~~~~~~~~~~~~~~~~

1) Create a new subdirectory and copy the XML files there. main.xml must not be
   copied, it is autogenerated.

2) In each translated file after the <?xml ... ?> tag you must put a note
   like <!-- synced with r2 -->, where 2 is the revision of corresponding
   English file (see comment at the top of file).

That's all, in theory.


A few words about SGML catalog files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As far as I know, the document type declaration in XML files requires
both a public and a system identifier. For example:

<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
  "/usr/share/sgml/docbook/dtd/xml/4.1.2/docbookx.dtd">

where

  "-//OASIS//DTD DocBook XML V4.1.2//EN"

is the public, and

  "/usr/share/sgml/docbook/dtd/xml/4.1.2/docbookx.dtd"

is the system identifier.

The problem is that the system identifier is most probably system-dependent.
To avoid the need to manually fix the system identifiers before building the
documentation, I've decided to use SGML catalogs. If you have your catalogs
set up correctly, xmllint and xsltproc will use them to find the DTDs
based on the public identifiers.

Note that this works only if public identifiers override system identifiers
(i.e. the catalog file must contain 'OVERRIDE YES'). (I had no problem with
these on my system, since the Debian people took care of everything. ;-))