railML3 Wiki:Autodoku/Skriptdokumentation

From railML 3 Wiki
< railML3 Wiki:Autodoku
Revision as of 11:16, 26 November 2024 by RailML Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


[DRAFT] Documentation XSD2MediaWiki Converter
 

Introduction

The XSD2MediaWiki Converter is an command line script written in python. It's purpose is to read the railML schema sources (XSD) and generate wiki documentation for each element found within the schema and all referenced subschemas.

Sources & Binary Packages

The sources can be found in the railML development system (non-public project): https://development.railml.org/tools/xsd2mediawiki

There are binary packages available for all major platforms (Windows, Linux, macOS). They can be found in the release section of the project: https://development.railml.org/tools/xsd2mediawiki/-/releases

Anatomy

The script will first collect all elements from the schema. It will then check with a configured MediaWiki installation (mainly the wiki for railML 3 under wiki3.railml.org) if

  • a main element documentation page does already exist
    • if it does exist: the script will do nothing with the main element page
    • if it does not exist: the script will create a new main element page
  • a robot element documentation page does exist
    • if it does exist: the script will update (replace) the existing robot element page
    • if it does not exist: the script will create a new robot element page

If an element does not exist in the currently processed railML schema, but did exist before, the script will not delete anything. Removed elements will just be ignored.

Preparation

Wiki

UserRights RailML Bot XSD2MediaWiki.jpg

For uploading the changes, a special (bot) user called RailML Bot XSD2MediaWiki is used.

This user has to be added to the bureaucrat group before running the script.

This can be done using the Special:UserRights page. The group assignment should be set to autoexpire after 1 day.

Script Configuration

...