Elexis::Wiki::Interface
A Ruby Gem to allow pulling and pushing between Elexis source code repositories and the mediawiki installation
Use it at your own risk, as it is just a small utility gem to help for some release engineering for the Elexis-RCP. See http://elexis.info.
But I have an open ear for suggestions for improvements, especially if they come with a patch including specs.
License: GPLv3 or later
Copyright: 2014 © by Niklaus Giger <niklaus.giger@member.fsf.org>
Installation
Ensure that you use Ruby 1.9.2 or higher. Mediawiki 1.19 does not work. Mediawiki 1.25.2 works. Don’t know how the versions between score.
Add this line to your application’s Gemfile:
$ gem 'elexis-wiki-interface'
And then execute:
$ bundle
Or install it yourself as:
$ gem install elexis-wiki-interface
Usage
using some built-in helpers (mainly for the jenkins-CI)
Each of the helper script below should work if you have a ruby installation >= 1.9.2 and executed gem install bundler && bundle install
in directory where
wiki_pull
wiki_pull_and_commit
wiki_push
in a ruby script
require 'elexis/wiki/interface/workspace'
require 'pp'
workspace = Elexis::Wiki::Interface::Workspace.new('.')
workspace.pull # get actual mediawiki content and place it under doc inside the plugin
workspace.info.show
pp workspace.views_missing_documentation # returns an array of plugin-ids
pp workspace.perspectives_missing_documentation # returns an array of plugin-ids
workspace.push # push doc/*.mediwiki files to the wiki
Or you can inspire you from the spec/*_spec.rb files to see tested examples.
Username/password to access your wiki
The username and password is fetched from a config.yml, which may be either
- /etc/elexis-wiki-interface/config.yml
- /config.yml
Here is an example:
---
wiki: http://wiki.elexis.info/api.php
password: topsecrect
user: elexis
This user must have the privilege to access the wiki via the API interface.
Conventions
- You must create a directory config with a file hosts.yml containing the mediawiki-gateway configuration (host, username, password)
- Use tag File
We decided to use only the tag file as https://www.mediawiki.org/wiki/Help:Images/de recommends, even when the legacy tag Image is still supported.
Also we don’t use the tag Datei, as this one is not supported by the Mylin Wikitext extension of Eclipse.
- The push/pull methods use the convention
- in page names all ‘.’ are removed
- a plugin plugin.name has a page plugin.name
- a view view.name with a localized name localized_name has a page Views
- a perspective perspective.name with a localized name localized_name has a page P_
- an image file must be lowercase (files which differ only by the case will be deleted)
- use syntax
[[File:
, not [[Datei: or[[Image:
- png files should start with a name derived from their symbolic name, eg, molemax followed by ‘-’ by a name or a globally unique name
- png files resides inside the ‘doc’ sub-directory of each plugin/feature
Limitations/TODO
- Upload all perspectives/view images from a jubula run
- View-images were in doc_de/images/views/Artikelauswahl.png (localized_name) → http://wiki.elexis.info/Datei:Ch.elexis:Artikelauswahl.png
- https://srv.elexis.info/jenkins/view/3.0/job/Elexis-3.0-Jubula/118/artifact/test-results/screenshots/Other/https://srv.elexis.info/jenkins/view/3.0/job/Elexis-3.0-Jubula/118/artifact/test-results/screenshots/Other/Fixmedikation.png
- Bug ch.elexis → ch.elexis.core splitted. now you find it here
- ch.elexis.core.application/plugin_de.properties:elexis.articleSelectorView=Artikelauswahl
- ch.elexis.core.ui.laboratory/plugin_de.properties:elexis.articleSelectorView = Artikelauswahl
- ch.elexis.core.ui/plugin_de.properties:elexis.articleSelectorView = Artikelauswahl
- ch.elexis.core.application/plugin.xml: name=“%elexis.articleSelectorView”>
- Missing line [[Datei:Ch.elexis:Artikelauswahl.png]] in http://wiki.elexis.info/ChElexisViewsArtikelArtikelselektor
- Perspektives: were not uploaded to doc_de
- No multilingual support at the moment
Contributing
- Fork it ( http://github.com/ngiger/elexis-wiki-interface/fork )
- Create your feature branch (`git checkout -b my-new-feature`)
- Commit your changes (`git commit -am ‘Add some feature’`)
- Push to the branch (`git push origin my-new-feature`)
- Create new Pull Request