How To Convert a UserBase Manual to Docbook/da: Difference between revisions

From KDE Wiki Sandbox
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 202: Line 202:
* Tweak <tt>dblatex-cvs-install/bin/dblatex</tt> in like this
* Tweak <tt>dblatex-cvs-install/bin/dblatex</tt> in like this


{{Input|1=
<!--}}-->{{Input|1=
<syntaxhighlight lang="bash">#!/bin/sh
<syntaxhighlight lang="bash">#!/bin/sh


Line 208: Line 208:
export TEXINPUTS
export TEXINPUTS


/path/to/your/dblatex-cvs-install/share/dblatex/scripts/dblatex  $*</syntaxhighlight>}}
/path/to/your/dblatex-cvs-install/share/dblatex/scripts/dblatex  $*</syntaxhighlight>}}<!--{{-->


(Change '''''/path/to/your/''''' as appropriate)
(Change '''''/path/to/your/''''' as appropriate)

Revision as of 17:31, 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 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
  • 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å Forhåndsvisning. Arrangér listen på samme måde som i manualens indholdsfortegnelse.


  • Kopiér sidelisten ind i det store tekstfelt.
  • Klik på Eksporter.
Eksport af Amaroks manualsider
  • 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), eller
    python 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.
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 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 Add books.
  • Select index.html in your DocBook folder. Wait until the book is loaded.
  • Choose Convert books.
  • Fill the metadata fields as appropriate.
Calibre conversion configuration page.
  • Press OK and wait until the work is done.
  • Copy the book from ~/Calibre Library on your ebook reader.