Com convertir un manual de UserBase a Docbook
Appearance
Prefaci
El procediment actual no està polit, el codi de l'script és lleig, no prou intel·ligent, etc. L'única excusa és que funciona d'alguna manera .
Si voleu millorar el procediment, teniu bones habilitats amb Python, i coneixeu els principis d'autoria de docbook, podeu millorar el procediment. Si us plau, poseu-vos en contacte amb Yurchor si sou capaç d'ajudar.
Preparar les pàgines per a la conversió
- Assegureu-vos que les pàgines del vostre manual segueixen les directrius d'autor de UserBase i les directrius tipogràfiques.
- Comproveu si cada pàgina conté la seva capçalera en funció al nivell d'aquesta pàgina a la taula de continguts.
Taula de referència UserBase Docbook Comentari ==Secció== <capítol> ===Secció=== <secció1> ====Secció==== <secció2> =====Secció===== <secció3> ======Secció====== <secció4> No utilitzeu aquest últim nivell, si és posible.
- Comproveu si totes les cel tenen espai després del caràcter de canonada. Aquesta norma s'ajusta al format wiki tradicional.
- Feu que el nom de l'aplicació tingui un format consistent (eviteu l'ús de Amaroks, feu Amarok's).
- Assegureu-vos que totes les imatges estan en format PNG.
- Elimineu tots els caràcters no imprimibles dels noms d'imatge.
===Exportar===
- Prepareu la llista de pàgines (elimineu les adreces de UserBase http://userbase.kde.org). Exemple per a Amarok:
Amarok/Manual/Introduction
Amarok/QuickStartGuide
Amarok/QuickStartGuide/GettingStarted
Amarok/QuickStartGuide/TheAmarokWindow
Amarok/QuickStartGuide/TheMusicCollection
Amarok/QuickStartGuide/Playlists
Amarok/QuickStartGuide/TheContextView
Amarok/QuickStartGuide/HowToDealWithProblems
Amarok/QuickStartGuide/Glossary
Amarok/Manual/AmarokWindow
Amarok/Manual/AmarokWindow/Toolbar
Amarok/Manual/AmarokWindow/MediaSources
Amarok/Manual/AmarokWindow/ContextPane
Amarok/Manual/AmarokWindow/PlaylistPane
Amarok/Manual/ConfiguringAmarok
Amarok/Manual/ConfiguringAmarok/ChangingLayout
Amarok/Manual/Organization
Amarok/Manual/Organization/Collection
Amarok/Manual/Organization/CollectionScanning
Amarok/Manual/Organization/Collection/SearchInCollection
Amarok/Manual/Organization/Collection/OrganizeCollection
Amarok/Manual/Organization/Collection/RemoteCollections
Amarok/Manual/Organization/Collection/RemoteCollections/Ampache
Amarok/Manual/Organization/Collection/RemoteCollections/DAAP
Amarok/Manual/Organization/Collection/RemoteCollections/Samba
Amarok/Manual/Organization/Collection/RemoteCollections/UPnP
Amarok/Manual/Organization/Collection/ExternalDatabase
Amarok/Manual/Organization/Collection/WorkingWithMediaDevices
Amarok/Manual/Organization/CoverManager
Amarok/Manual/Organization/TagEditor
Amarok/Manual/Organization/Transcoding
Amarok/Manual/Organization/ScriptManager
Amarok/Manual/Playlist
Amarok/Manual/Playlist/SavedPlaylists
Amarok/Manual/Playlist/PlaylistFiltering
Amarok/Manual/Playlist/QueueManager
Amarok/Manual/Playlist/DynamicPlaylists
Amarok/Manual/Playlist/AutomaticPlaylistGenerator
Amarok/Manual/Various
Amarok/Manual/Various/Moodbar
Amarok/Manual/Various/AmarokOnOtherPlatforms
Amarok/Manual/Various/AmarokOnOtherPlatforms/NonKDE Desktops
Amarok/Manual/Various/AmarokOnOtherPlatforms/Windows
Amarok/Manual/Various/AmarokOnOtherPlatforms/OSX
Amarok/Manual/Various/TroubleshootingAndCommonProblems
Amarok/Manual/Various/FAQ
Amarok/Manual/References
Amarok/Manual/References/MenuAndCommandReference
Amarok/Manual/References/MenuAndCommandReference/AmarokMenu
Amarok/Manual/References/MenuAndCommandReference/ViewMenu
Amarok/Manual/References/MenuAndCommandReference/Playlist
Amarok/Manual/References/MenuAndCommandReference/Tools
Amarok/Manual/References/MenuAndCommandReference/Settings
Amarok/Manual/References/MenuAndCommandReference/Help
Amarok/Manual/References/KeybindingReference
Amarok/Manual/References/KeybindingReference/GlobalShortcuts
Amarok/Manual/References/KeybindingReference/AmarokShortcuts
Amarok/Manual/References/Credits and License
- Aneu a la pàgina Exporta les pàgines.
- Enganxeu la llista de pàgines al camp de text .
- Feu clic a .

- Deseu el fitxer. El fitxer desat s'anomenarà Manual.xml en el que segueix.
Convertir
- Instal·leu el paquet Subversion pel vostre sistema.
- Obteniu l'última versió de l'script de la conversió:
svn checkout --depth=files svn://anonsvn.kde.org/home/kde/branches/work/doc/
- Copieu Manual.xml a la carpeta de l'script.
- Executeu si voleu descarregar totes les capture de pantalla (es necessita algun temps per a descarregar totes les imatges des de UserBase, grep i wget han d'estar instal·lats), o
python wiki2docbook.py Manual.xml
si no necessiteu descarregar les imatges.python wiki2docbook.py -s Manual.xml
Post-processament
- Canvieu el nom de Manual.xml.docbook a index.docbook.
- Comproveu si la conversió s'ha realitzat correctament:
checkXML index.docbook
- Corregiu els errors (millor sobre les pàgines de UserBase).
- Convertir docbook a HTML:
meinproc4 index.docbook
- Comproveu les pàgines HTML (totes les imatges han de ser visibles, els enllaços no han de donar lloc a pàgines 404).
- Substituïu les imatges grans per miniatures usant convert de ImageMagick.
- Arrangeu els enllaços a docbook, de manera que portin a la secció de docbook, no pàgines de UserBase.
- Arrangeu el nom de l'aplicació d'acord amb la llista d'entitats del KDE.
- Copieu index.docbook i les imatges a la vostra carpeta /doc i publiqueu-ho (commit) al repositori.

Actualitzar els DocBook des de UserBase
Per actualitzar els vostres docbook convertits si us plau utilitzeu el següent procediment:
- Re-export XML from UserBase. See Export section.
- Use the script to update the content (headers with abstract and keywords and footer will be kept):
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.
Convertir els DocBook a un altre format
Convertir-los a PDF
Usually, there is no need to convert DocBook manually. You can download the converted PDFs from 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 buildpdf.sh) in your DocBook directory:
'"`UNIQ--syntaxhighlight-00000017-QINU`"'
- Download KDE styles:
svn co svn://anonsvn.kde.org/home/kde/trunk/www/areas/docs/dblatex-cvs-install/
- Tweak dblatex-cvs-install/bin/dblatex in like this
'"`UNIQ--syntaxhighlight-0000001E-QINU`"'
(Canvieu /ruta/al/vostre/ segons el cas).
- 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 /usr/share/texmf-dist/tex/latex/kde).
- Update paths with
mktexlsr
from root.
- Run
./buildpdf.sh index.docbook
.
- Copy all files from /tmp/tpb-your_user-digits to the work directory.
- Customize and edit tex file in Kile as appropriate.
- Compile PDF file with Alt + 6.
Convertir-los a EPUB
- Make sure that Calibre is installed in your system.
- Convert your DocBook into HTML first. Use
meinproc4 index.docbook
for this.
- Start Calibre and choose .
- Select index.html in your DocBook folder. Wait until the book is loaded.
- Choose .
- Fill the metadata fields as appropriate.

- Press and wait until the work is done.
- Copy the book from ~/Calibre Library on your ebook reader.