How To Convert a UserBase Manual to Docbook/ca: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 43: | Line 43: | ||
* Elimineu tots els caràcters no imprimibles dels noms d'imatge. | * Elimineu tots els caràcters no imprimibles dels noms d'imatge. | ||
<span id="Export"></span>===Exportar=== | |||
===Exportar=== | |||
* Prepareu la llista de pàgines (elimineu les adreces de UserBase <nowiki>http://userbase.kde.org</nowiki>). Exemple per a '''Amarok''': | * Prepareu la llista de pàgines (elimineu les adreces de UserBase <nowiki>http://userbase.kde.org</nowiki>). Exemple per a '''Amarok''': | ||
Line 79: | Line 78: | ||
Amarok/Manual/Organization/TagEditor | Amarok/Manual/Organization/TagEditor | ||
Amarok/Manual/Organization/Transcoding | Amarok/Manual/Organization/Transcoding | ||
Amarok/Manual/Organization/ScriptManager | |||
Amarok/Manual/Playlist | Amarok/Manual/Playlist | ||
Amarok/Manual/Playlist/SavedPlaylists | Amarok/Manual/Playlist/SavedPlaylists | ||
Line 158: | Line 158: | ||
* Copieu <tt>index.docbook</tt> i les imatges a la vostra carpeta <tt>/doc</tt> i publiqueu-ho (commit) al repositori. | * Copieu <tt>index.docbook</tt> i les imatges a la vostra carpeta <tt>/doc</tt> i publiqueu-ho (commit) al repositori. | ||
[[File:K3b_docs.png|350px|center|thumb|La documentació de K3b a UserBase en Opera i la pàgina convertida en el Konqueror.]] | [[File:K3b_docs.png|350px|center|thumb|La documentació de K3b a UserBase en Opera i la pàgina convertida en el 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: | |||
{{Input|1= | |||
<syntaxhighlight lang="bash">#!/bin/bash | |||
export SGML_CATALOG_FILES=/usr/share/sgml/docbook/sqml-dtd-4.2/catalog:/usr/share/apps/ksgmltools2/customization/catalog.xml:/usr/share/sgml/docbook/xml-dtd-4.2/docbook | |||
# add -d to command below to keep the /tmp folder, so you can examine the generated tex. | |||
./dblatex-cvs-install/bin/dblatex -d -b pdftex --style \ | |||
kdestyle\ | |||
-o $(pwd | awk -F/ '{ print $NF }').pdf \ | |||
-P latex.output.revhistory=0 -P newtbl.use=1 \ | |||
-P imagedata.default.scale=pagebound \ | |||
-P literal.width.ignore=1 \ | |||
-I $KDEDIR/share/doc/HTML/en/ \ | |||
-X \ | |||
$1</syntaxhighlight>}} | |||
* Download KDE styles: | |||
{{Input|1=<nowiki>svn co svn://anonsvn.kde.org/home/kde/trunk/www/areas/docs/dblatex-cvs-install/</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>. | |||
* 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:Col·laboració/ca]] | [[Category:Col·laboració/ca]] |
Revision as of 13:51, 21 November 2011
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
python wiki2docbook.py Manual.xml
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), opython wiki2docbook.py -s Manual.xml
si no necessiteu descarregar les imatges.
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.
Updating Your DocBook from UserBase
To update your converted docbook please use the following procedure:
- 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.
Converting DocBook into Other Format
Converting into 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:
#!/bin/bash export SGML_CATALOG_FILES=/usr/share/sgml/docbook/sqml-dtd-4.2/catalog:/usr/share/apps/ksgmltools2/customization/catalog.xml:/usr/share/sgml/docbook/xml-dtd-4.2/docbook # add -d to command below to keep the /tmp folder, so you can examine the generated tex. ./dblatex-cvs-install/bin/dblatex -d -b pdftex --style \ kdestyle\ -o $(pwd | awk -F/ '{ print $NF }').pdf \ -P latex.output.revhistory=0 -P newtbl.use=1 \ -P imagedata.default.scale=pagebound \ -P literal.width.ignore=1 \ -I $KDEDIR/share/doc/HTML/en/ \ -X \ $1
- 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
#!/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 $*
(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 /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.
Converting into 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.