How To Convert a UserBase Manual to Docbook/da: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 43: | Line 43: | ||
* Fjern alle ikke-printbare tegn fra billednavne. | * Fjern alle ikke-printbare tegn fra billednavne. | ||
<span id="Export"></span>=== Eksport === | |||
=== Eksport === | |||
* Forbered sidelisten (fjern UserBase-adressedelen <nowiki>http://userbase.kde.org</nowiki>). Eksempel for '''Amarok''': | * Forbered sidelisten (fjern UserBase-adressedelen <nowiki>http://userbase.kde.org</nowiki>). Eksempel for '''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: | ||
* Kopiér <tt>index.docbook</tt> og billeder til din <tt>/doc</tt>-mappe og commit dem til arkivet. | * Kopiér <tt>index.docbook</tt> og billeder til din <tt>/doc</tt>-mappe og commit dem til arkivet. | ||
[[File:K3b_docs.png|350px|center|thumb|Dokumentation for K3b på UserBase i Opera og den konverterede side i Konqueror.]] | [[File:K3b_docs.png|350px|center|thumb|Dokumentation for K3b på UserBase i Opera og den konverterede side i 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:Bidrag/da]] | [[Category:Bidrag/da]] |
Revision as of 13:51, 21 November 2011
Forord
Den aktuelle proces er ikke finslebet, skriptkoden er grim og ikke intelligent nok osv. Den eneste undskyldning er, at det kræver noget arbejde .
Hvis du ønsker at forbedre processen, er vel bekendt med Python og kender principperne for at skrive docbook-dokumenter, så kan du forbedre proceduren. Kontakt Yurchor, hvis du kan hjælpe.
Forbered en side for konvertering
- Tjek, at manualsiden følger UserBases retningslinjer for forfattere og de typograpfiske retningslinjer.
- Tjek, at hver side har en overskrift svarende til sidens niveau i indholdsfortegnelsen.
Referencetabel UserBase Docbook Kommentar ==Section== <chapter> ===Section=== <sect1> ====Section==== <sect2> =====Section===== <sect3> ======Section====== <sect4> Undgå så vidt muligt at bruge dette sidste niveau
- Tjek, at alle tabelceller har mellemrum efter 'pipe'-tegnet. Denne regel er i overensstemmelse med traditionel wiki-formattering.
- Sørg for, at formatteringen af programnavne er konsistent (undgå at bruge Amaroks, brug Amarok's — i danske oversættelser skal apostroffen dog normalt ikke være der).
- Sørg for, at alle billeder er i PNG-format.
- Fjern alle ikke-printbare tegn fra billednavne.
=== Eksport ===
- Forbered sidelisten (fjern UserBase-adressedelen http://userbase.kde.org). Eksempel for 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
Tip
Du kan få din manuals fulde sideliste med følgende skript:
<DPL> nottitlematch = %/__|%/zh-%|%(%) titlematch = Amarok% namespace = Main columns = 1 format = ,\n* [[%PAGE%|%TITLE%]],, </DPL>Erstat Amarok med navnet på dit program, Skriv det ind på din brugerside og klik på . Arrangér listen på samme måde som i manualens indholdsfortegnelse.
- Gå til eksportsiden.
- Kopiér sidelisten ind i det tekstfelt.
- Klik på .
- Gem filen. Den gemte fil vil blive kaldt Manual.xml i det følgende.
Konvertering
- Installér pakken Subversion på dit system.
- For at udtjekke den seneste udgave af konverteringsskriptet kører du:
svn checkout --depth=files svn://anonsvn.kde.org/home/kde/branches/work/doc/
- Kopiér Manual.xml til skriptmappen.
- Kør
python wiki2docbook.py Manual.xml
hvis du ønsker at downloade alle skærmbilleder (det tager nogen tid at hente alle billeder fra UserBase; du skal have grep og wget installeret), ellerpython wiki2docbook.py -s Manual.xml
hvis du ikke behøver at downloade billederne.
Efterbehandling
- Omdøb Manual.xml.docbook til index.docbook.
- Tjek, at konverteringen er foretaget korrekt:
checkXML index.docbook
- Ret fejlene (det er bedst at gøre det på UserBase siderne).
- Konvertér docbook til HTML:
meinproc4 index.docbook
- Tjek HTML-siderne (alle billeder skal kunne ses, links må ikke føre til 404-sider).
- Erstat store billeder med miniaturer ved at bruge convert fra ImageMagic
- Ret links i docbook'en, sådan at de fører til afsnit i docbook'en, ikke til UserBase-sider.
- Ret programnavnet så det stemmer overens med KDE's "entity list".
- Kopiér index.docbook og billeder til din /doc-mappe og commit dem til arkivet.
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.