README for Publican

Publican is a DocBook publication system, not just a DocBook processing tool.
As well as ensuring your DocBook XML is valid, publican works to ensure
your XML is up to publishable standard.

Web:  http://publican.fedorahosted.org/
Mail: https://www.redhat.com/mailman/listinfo/publican-list
Source: http://svn.fedorahosted.org/svn/publican
Bugs: https://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Publican

Assumptions: DocBook xml, *nix, en-US source language.

Q: What actions are there?

A: publican --help

Q: How do I update the POT files for translation?

A: publican update_pot

Q: How do I add a language?

A: publican update_po --langs=<xx-YY>

This will create the language directory and the language specific po files.

Q: How do I update all po files?

A: publican update_po --langs=all

Q: What Book specific options can I use?

A: publican --help_config

Q: Where are the common files located?

A: By default they are in /usr/share/publican

Q: How do I profile publican?

A: Devel::NYTProf is a good option.

$ perl -d:NYTProf /usr/bin/publican build --langs en-US --formats html
$ nytprofhtml
$ firefox nytprof/index.html 

Q: How do I build publican from source?

A: It depends on your platform.

Get the source: svn co http://svn.fedorahosted.org/svn/publican/trunk/publican

CPAN
    cd publican
    Currently you have to manually install File::pushd from CPAN first
    $ perl Build.PL
        if this complains about missing deps run
        $ ./Build installdeps
    $ ./Build
    $ ./Build test
    $ ./Build install

RHEL/Fedora
    cd publican
    $ perl Build.PL
        if this complains about missing deps,  on Fedora 10+, and RHEL 6, run
        $ yum-builddep publican 
    $ ./Build rpm

Debian
    The publican package deb files are in the debian package repo
    http://packages.debian.org/search?keywords=publican
    $ cd publican
    $ sudo apt-get install \
libfile-pushd-perl \
libconfig-simple-perl \
libxml-treebuilder-perl \
libfile-find-rule-perl \
libmakefile-parser-perl \
liblocale-maketext-gettext-perl \
perlmagick \
libimage-size-perl \
libdatetime-perl \
liblocale-po-perl \
libxml-libxslt-perl \
libdatetime-format-dateparse-perl \
libsyntax-highlight-engine-kate-perl \
libtest-perl-critic-perl \
libtest-pod-coverage-perl \
libtest-exception-perl \
libdbd-sqlite-perl \
libdevel-cover-perl \
libdbd-sqlite3-perl

    $ ./Build dist
TODO: put the tgz where?
    $ debuild

Windows
    Install gitbash
    clone source repo
    Install Perl http://strawberryperl.com/
	cpan tool
	install Module::Build Config::Simple Perl::Critic XML::TreeBuilder Locale::Maketext::Gettext File::Inplace

	http://search.cpan.org/CPAN/authors/id/C/CH/CHIPT/File-Inplace-0.20.tar.gz
        https://rt.cpan.org/Public/Bug/Display.html?id=63940
	https://rt.cpan.org/Ticket/Attachment/869125/450100/win32.diff
	blah blah

	install Locale::PO String::Similarity DateTime::Format::DateParse Syntax::Highlight::Engine::Kate HTML::FormatText
	install HTML::FormatText::WithLinks::AndTables Test::Pod

    Install NSIS
        http://nsis.sourceforge.net/Download
        http://nsis.sourceforge.net/Environmental_Variables:_append,_prepend,_and_remove_entries
        http://nsis.sourceforge.net/NsUnzip_plugin
    
    $ cd publican
    $ perl win_build.pl

    C:\Perl\lib\HTML\Element.pm patch from cpan
    XML-TreeBuilder patch
    
TODO: detail building xml2

TODO: Complete details on building required LibXML and LibXSLT modules

    vcvars32.bat

    perl Makefile.PL INC=-ID:\Data\temp\Redhat\xml2\include LIBS=-LD:\Data\temp\Redhat\xml2\lib
    nmake
    copy D:\Data\temp\Redhat\xml2\bin\*.dll blib\arch\auto\XML\LibXML
    nmake test
    nmake install

    perl Makefile.PL INC=-ID:\Data\temp\Redhat\xml2\include LIBS=-LD:\Data\temp\Redhat\xml2\lib
    nmake
    copy D:\Data\temp\Redhat\xml2\libxslt-1.1.24.win32\bin\*.dll blib\arch\auto\XML\LibXSLT
    nmake test
    nmake install

    
TODO:

what about a real list of valid langauges?

    wget http://www.iana.org/assignments/language-subtag-registry

    grep -A 1 -B 0 -P '^Type: (language|redundant)' language-subtag-registry | grep -P '^(Subtag|Tag)' | perl -p -e 's/^(Subtag|Tag):\s*//gi' | wc -l

    sub valid_lang looks good
        http://cpansearch.perl.org/src/TOBYINK/XRD-Parser-0.101/lib/XRD/Parser.pm

