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

From KDE UserBase Wiki
No edit summary
m (update the list + remove it from the translation domain)
Line 58: Line 58:
<!--T:13-->
<!--T:13-->
* Prepare the page list (strip from UserBase addresses <nowiki>http://userbase.kde.org</nowiki>). Example for '''Amarok''':
* Prepare the page list (strip from UserBase addresses <nowiki>http://userbase.kde.org</nowiki>). Example for '''Amarok''':
</translate>


<!--T:14-->
{{Input|1=Amarok/Manual/Introduction
{{Input|1=Amarok
Amarok/QuickStartGuide
Amarok/QuickStartGuide
Amarok/QuickStartGuide/GettingStarted
Amarok/QuickStartGuide/GettingStarted
Line 75: Line 75:
Amarok/Manual/AmarokWindow/PlaylistPane
Amarok/Manual/AmarokWindow/PlaylistPane
Amarok/Manual/ConfiguringAmarok
Amarok/Manual/ConfiguringAmarok
Amarok/Manual/ConfiguringAmarok/ChangingLayout
Amarok/Manual/AdvancedFeatures
Amarok/Manual/AdvancedFeatures
Amarok/Manual/AdvancedFeatures/CollectionScanning
Amarok/Manual/Organization
Amarok/Manual/AdvancedFeatures/CoverManager
Amarok/Manual/Organization/Collection
Amarok/Manual/AdvancedFeatures/DynamicPlaylists
Amarok/Manual/Organization/CollectionScanning
Amarok/Manual/AdvancedFeatures/AutomaticPlaylistGenerator
Amarok/Manual/Organization/Collection/SearchInCollection
Amarok/Manual/AdvancedFeatures/ExternalDatabase
Amarok/Manual/Organization/Collection/OrganizeCollection
Amarok/Manual/AdvancedFeatures/AFT
Amarok/Manual/Organization/Collection/RemoteCollections
Amarok/Manual/AdvancedFeatures/Moodbar
Amarok/Manual/Organization/Collection/RemoteCollections/Ampache
Amarok/Manual/AdvancedFeatures/WorkingWithMediaDevices
Amarok/Manual/Organization/Collection/RemoteCollections/DAAP
Amarok/Manual/AdvancedFeatures/SavedPlaylists
Amarok/Manual/Organization/Collection/RemoteCollections/Samba
Amarok/Manual/AdvancedFeatures/PlaylistFiltering
Amarok/Manual/Organization/Collection/RemoteCollections/UPnP
Amarok/Manual/AdvancedFeatures/QueueManager
Amarok/Manual/Organization/Collection/ExternalDatabase
Amarok/Manual/AdvancedFeatures/SearchInCollection
Amarok/Manual/Organization/Collection/WorkingWithMediaDevices
Amarok/Manual/AdvancedFeatures/TagEditor
Amarok/Manual/Organization/CoverManager
Amarok/Manual/AdvancedFeatures/OrganizeCollection
Amarok/Manual/Organization/TagEditor
Amarok/Manual/AdvancedFeatures/Transcoding
Amarok/Manual/Organization/Transcoding
Amarok/Manual/AdvancedFeatures/ScriptManager
Amarok/Manual/Playlist
Amarok/Manual/AdvancedFeatures/RemoteCollections
Amarok/Manual/Playlist/SavedPlaylists
Amarok/Manual/AdvancedFeatures/RemoteCollections/Ampache
Amarok/Manual/Playlist/PlaylistFiltering
Amarok/Manual/AdvancedFeatures/RemoteCollections/DAAP
Amarok/Manual/Playlist/QueueManager
Amarok/Manual/AdvancedFeatures/RemoteCollections/Samba
Amarok/Manual/Playlist/DynamicPlaylists
Amarok/Manual/AdvancedFeatures/RemoteCollections/UPnP
Amarok/Manual/Playlist/AutomaticPlaylistGenerator
Amarok/Manual/MenuAndCommandReference/AmarokMenu
Amarok/Manual/Various
Amarok/Manual/MenuAndCommandReference/ViewMenu
Amarok/Manual/Various/Moodbar
Amarok/Manual/MenuAndCommandReference/Playlist
Amarok/Manual/Various/AmarokOnOtherPlatforms
Amarok/Manual/MenuAndCommandReference/Tools
Amarok/Manual/Various/AmarokOnOtherPlatforms/NonKDE Desktops
Amarok/Manual/MenuAndCommandReference/Settings
Amarok/Manual/Various/AmarokOnOtherPlatforms/Windows
Amarok/Manual/MenuAndCommandReference/Help
Amarok/Manual/Various/AmarokOnOtherPlatforms/OSX
Amarok/Manual/KeybindingReference
Amarok/Manual/Various/TroubleshootingAndCommonProblems
Amarok/Manual/KeybindingReference/GlobalShortcuts
Amarok/Manual/Various/FAQ
Amarok/Manual/KeybindingReference/AmarokShortcuts
Amarok/Manual/References
Amarok/Manual/TroubleshootingAndCommonProblems
Amarok/Manual/References/MenuAndCommandReference
Amarok/Manual/AmarokOnOtherPlatforms/Non-KDE Desktops
Amarok/Manual/References/MenuAndCommandReference/AmarokMenu
Amarok/Manual/AmarokOnOtherPlatforms/Windows
Amarok/Manual/References/MenuAndCommandReference/ViewMenu
Amarok/Manual/AmarokOnOtherPlatforms/OSX
Amarok/Manual/References/MenuAndCommandReference/Playlist
Amarok/Manual/FAQ
Amarok/Manual/References/MenuAndCommandReference/Tools
Amarok/Manual/Credits_and_License}}
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}}


<translate>
<!--T:15-->
<!--T:15-->
{{Tip|1=You can obtain the full list of pages for your application with the following script:<!--}}-->
{{Tip|1=You can obtain the full list of pages for your application with the following script:<!--}}-->

Revision as of 17:00, 21 September 2011

Preface

The current process is not polished, the script code is ugly, not intelligent enough, etc.. The only excuse is that it works somehow .

If you want to improve the process, have good Python skills, and know the docbook authoring principles, you can improve the procedure. Please contact Yurchor if you are able to help.

Preparing Pages for Conversion

  • Check if every page has its header according to the level of this page in 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
  • Make application name formatting consistent (avoid using Amaroks, 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 http://userbase.kde.org). Example 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/AdvancedFeatures
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/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

You can obtain the full list of pages for your application with the following script:
<DPL>
  nottitlematch = %/__|%/zh-%|%(%)
  titlematch = Amarok%
  namespace = Main
  columns = 1
  format = ,\n* [[%PAGE%|%TITLE%]],,
</DPL>
Replace Amarok with the name of your application, put it on your user page, and click on Preview. Rearrange the list according to the ToC of your manual.


  • Paste the page list into the bigger text field.
  • Click on Export.
Export of Amarok manual pages
  • Save the file. The saved file will be called Manual.xml in what follows.

Conversion

  • Install Subversion package for your system.
  • Checkout the latest version of conversion script:
    svn checkout --depth=files svn://anonsvn.kde.org/home/kde/branches/work/doc/
  • Copy Manual.xml to the script folder.
  • Run
    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
    python wiki2docbook.py -s Manual.xml
    if you need not to download images.

Post-processing

  • Rename Manual.xml.docbook to index.docbook.
  • Check if conversion was done correctly:
    checkXML index.docbook
  • Fix the errors (better on UserBase pages).
  • Convert docbook to HTML:
    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 index.docbook and images to your /doc folder and commit them to repository.
K3b docs on UserBase in Opera and converted page in Konqueror.