Jump to content

Translate

AllHow To Convert a UserBase Manual to Docbook
Translate to tolışi

Translation of the wiki page How To Convert a UserBase Manual to Docbook from English (en) to tolışi (tly)

This tool does not work without JavaScript. JavaScript is disabled, failed to work, or this browser is unsupported.
How To Convert a UserBase Manual to Docbook
Translations:How To Convert a UserBase Manual to Docbook/Page display title/tly
How To Convert a UserBase Manual to Docbook
You need translation rights to translate messages.Get permission
Latest updatesAll changes
Suggestions
In other languages
==Preface==
Translations:How To Convert a UserBase Manual to Docbook/1/tly
==Preface==
You need translation rights to translate messages.Get permission
Latest updatesAll changes
Suggestions
In other languages
The current process is not polished, the script code is ugly, not intelligent enough, etc.. The only excuse is that it works somehow {{Smiley}}.
If you want to improve the process, have good Python skills, and know the docbook authoring principles, you can improve the procedure. Please contact [[User_talk:Yurchor|Yurchor]] if you are able to help.
==Preparing Pages for Conversion==
* Check that the pages of your manual follow the [[Special:myLanguage/Tasks_and_Tools|author guidelines of UserBase]] and [[Special:myLanguage/Typographical_Guidelines|typographical guidelines]].
* Check if every page has its header according to the level of this page in the table of contents.
:{| |+Reference table |- ! UserBase ! Docbook ! Comment |- | ==Section== | <chapter> |- | ===Section=== | <sect1> |- | ====Section==== | <sect2> |- | =====Section===== | <sect3> |- | ======Section====== | <sect4> | ''Avoid using this last level if possible'' |}
* Check if all table cells have space after the pipe character. This rule conforms with [http://en.wikipedia.org/wiki/Help:Table traditional wiki formatting].
* Make application name formatting consistent (avoid using '''Amarok'''s, do use '''Amarok's''').
* Ensure that ''all'' images are in PNG format.
* Remove all non-printable characters from image names.
===Export===
* Prepare the page list (strip from UserBase addresses <nowiki>http://userbase.kde.org</nowiki>). Example for '''Amarok''':
{{Tip|1=You can obtain the full list of pages for your application with the following script:<!--}}-->
{{Input|1=<nowiki><DPL> nottitlematch = %/__|%/zh-%|%pt-%|%(%) titlematch = Appname/Manual% namespace = columns = 1 format = ,\n* [[%PAGE%|%TITLE%]],, </DPL></nowiki>}}
<!--{{-->Replace '''''Amarok''''' with the name of your application, put it on your user page, and click on <menuchoice>Preview</menuchoice>. Rearrange the list according to the ToC of your manual. }}
{{Note|1=If You are working with the Amarok manual be aware that it does not fully conform to manual page naming conventions. You can use {{Input|1= titlematch = Amarok/Manual%{{!}}Amarok/QuickStartGuide%}} (Note: No space characters in title pattern!) }}
* Go to the [[Special:Export|export page]].
* Paste the page list into the <menuchoice>bigger</menuchoice> text field.
* Click on <menuchoice>Export</menuchoice>. [[File:XML_export.png|350px|center|thumb|Export of Amarok manual pages]]
* Save the file. The saved file will be called <tt>Manual.xml</tt> in what follows.
===Conversion===
* Install Subversion package for your system.
* Checkout the latest version of conversion script: {{Input|1=svn checkout --depth=files <nowiki>svn://anonsvn.kde.org/home/kde/branches/work/doc/</nowiki>}}
* Copy <tt>Manual.xml</tt> to the script folder.
* Run {{Input|1=python wiki2docbook.py Manual.xml}} if you want to download all screenshots (it takes some time to download all images from UserBase, grep and wget should be installed), or {{Input|1=python wiki2docbook.py -s Manual.xml}} if you need not to download images.
{{Warning|1=At some point in the past it became necessary to add a line containing <br /><code>144.76.227.197 userbase.kde.org</code><br /> to <tt>/etc/hosts</tt> in order to access UserBase from the script. This is no longer the case. If you already added such a line to your <tt>/etc/hosts</tt>, then you should remove it again.}}
===Post-processing===
* Rename <tt>Manual.xml.docbook</tt> to <tt>index.docbook</tt>.
* Check if conversion was done correctly: {{Input|1=checkXML index.docbook}}
* Fix the errors (better on UserBase pages).
* Convert docbook to HTML: {{Input|1=meinproc4 index.docbook}}
* Check HTML pages (all images should be visible, links should not lead to 404-pages).
* Replace big images by thumbnails using '''convert''' from '''ImageMagick'''
* Fix links in docbook, so they lead to docbook section, not UserBase pages.
* Fix application name according to KDE entity list.
* Copy <tt>index.docbook</tt> and images to your <tt>/doc</tt> folder and commit them to repository. [[File:K3b_docs.png|350px|center|thumb|K3b docs on UserBase in Opera and converted page in Konqueror.]]
== Updating Your DocBook from UserBase ==
To update your converted docbook please use the following procedure:
* Re-export XML from UserBase. See [[Special:myLanguage/How_To_Convert_a_UserBase_Manual_to_Docbook#Export|Export]] section.
* Use the script to update the content (headers with abstract and keywords and footer will be kept): {{Input|1= python wiki2docbook.py -r index.docbook Manual.xml}}
* Check the docbook, rename the file into index.docbook and commit it with screenshots into your repository.
== Converting DocBook into Other Format ==
=== Converting into PDF===
Usually, there is no need to convert DocBook manually. You can download the converted PDFs from [http://docs.kde.org/ KDE Documentation] site.
Should you need additional customization please do as follows:
* Make sure that you have some '''LaTeX''' distribution installed (usually, TeXLive).
* Create the following script file (named <tt>buildpdf.sh</tt>) in your DocBook directory:
* Download KDE styles: {{Input|1=<nowiki>git clone git://anongit.kde.org/websites/docs-kde-org.git</nowiki>}}
* Tweak <tt>dblatex-cvs-install/bin/dblatex</tt> in like this
<!--}}-->{{Input|1= <syntaxhighlight lang="bash">#!/bin/sh
TEXINPUTS=:/path/to/your/dblatex-cvs-install/share/dblatex/latex//:$TEXINPUTS export TEXINPUTS
/path/to/your/dblatex-cvs-install/share/dblatex/scripts/dblatex $*</syntaxhighlight>}}<!--{{-->
(Change '''''/path/to/your/''''' as appropriate)
* Copy KDE styles (/dblatex-cvs-install/share/dblatex/latex/contrib/) to some TeX dir where it can be found by '''LaTeX''' installation (I have copied them to <tt>/usr/share/texmf-dist/tex/latex/kde</tt>).
* Update paths with <code>mktexlsr</code> from root.
* Run <code>./buildpdf.sh index.docbook</code>. This should create ready-to-use PDF file for you. You can stop on this step if you do not want to tweak it.
* Copy all files from <tt>/tmp/tpb-'''''your_user'''''-'''''digits'''''</tt> to the work directory.
* Customize and edit <tt>tex</tt> file in [[Special:MyLanguage/Kile|Kile]] as appropriate.
* Compile PDF file with <keycap>Alt + 6</keycap>.
=== Converting into EPUB ===
* Make sure that '''Calibre''' is installed in your system.
* Convert your DocBook into HTML first. Use <code>meinproc4 index.docbook</code> for this.
* Start '''Calibre''' and choose <menuchoice>Add books</menuchoice>.
* Select <tt>index.html</tt> in your DocBook folder. Wait until the book is loaded.
* Choose <menuchoice>Convert books</menuchoice>.
* Fill the metadata fields as appropriate.
[[File:calibre.png|350px|center|thumb|Calibre conversion configuration page.]]
* Press <menuchoice>OK</menuchoice> and wait until the work is done.
* Copy the book from <tt>~/Calibre Library</tt> on your ebook reader.
[[Category:Contributing]]
Loading messages...
0% translated, 0% reviewed
All