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

From KDE TechBase
(Created page with "* Supprimez tous les caractères non imprimables des noms d'images.")
(Created page with "{{Input/fr|1=Amarok Amarok/QuickStartGuide Amarok/QuickStartGuide/GettingStarted Amarok/QuickStartGuide/TheAmarokWindow Amarok/QuickStartGuide/TheMusicCollection Amarok/QuickS...")
Line 48: Line 48:
* 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''':


{{Input|1=Amarok
{{Input/fr|1=Amarok
Amarok/QuickStartGuide
Amarok/QuickStartGuide
Amarok/QuickStartGuide/GettingStarted
Amarok/QuickStartGuide/GettingStarted

Revision as of 00:41, 2 February 2019

Préface

Le processus actuel n'est pas peaufiné, le code du script n'est pas beau, pas assez intelligent, etc.. La seule excuse est qu'il fonctionne tout de même

.

Si vous voulez améliorer le processus, que vous avez une bonne expérience de Python, et que vous connaissez les principes d'utilisation de docbook, vous pouvez améliorer la procédure. Veuillez contacter Yurchor si vous vous sentez prêt à apporter votre aide.

Préparation des pages pour Conversion

  • Vérifiez que chaque page a son titre aligné avec le niveau de cette page dans la table des matières.
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).
  • Vérifiez que toutes les images sont au format PNG.
  • Supprimez tous les caractères non imprimables des noms d'images.

Exporter

  • Prepare the page list (strip from UserBase addresses http://userbase.kde.org). Example for Amarok:

Template:Input/fr

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/
  • Copier Manual.xml dans le dossier du script.
  • 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.