A generalized data labeling system for use in MediaWiki wikis
Project description
# Wiki Labels
This package provides the components of a generalized labeling service for
MediaWiki. There are two primary components, a user script to be used on
MediaWiki and a flask server for the gadget to converse with.
## Server
The flask server is intended to be hosted by a web server, but a dev server can
be started locally with
wikilabels dev_server
### Installation
#### Dependencies
Installation will require some additional packages to be available.
`sudo apt-get install postgresql-server-dev-all postgresql libffi-dev npm g++ python3-dev libmemcached-dev`
#### Database setup
You'll need to create a `wikilabels` user and database. Here's a sequence of
commands that works on a fresh install of postgres (note that `sudo` rights
will be required).
Create a wikilabels user
$ sudo useradd wikilabels
Switch to `postgres` user to run commands
$ sudo su postgres
$ psql
postgres=# CREATE USER wikilabels WITH PASSWORD 'something secure';
postgres=# CREATE DATABASE wikilabels;
postgres=# GRANT ALL PRIVILEGES ON DATABASE wikilabels to wikilabels;
postgres=# \q
$ exit
Switch to `wikilabels` user to load schema
$ sudo su wikilabels
$ psql
Copy-paste config/schema.sql into the command prompt.
Optionally, you can also load sample data into the database by copy-pasting config/schema-testdata.sql into the command prompt
### Installing javascript dependencies
$ npm install codemirror jquery oojs oojs-ui strftime yamljs
### Starting the dev server
$ wikilabels dev_server --config config-localdev.yaml
## Gadget
1. Go to one of the js subpages of your user page. You can choose a page such as these:
* [meta:User:`<Name>`/global.js](https://meta.wikimedia.org/wiki/Special:MyPage/global.js), which will be loaded in all wikis, in all skins
* [meta:User:`<Name>`/common.js](https://meta.wikimedia.org/wiki/Special:MyPage/common.js), which will be loaded only on Meta-wiki, in all skins
* [meta:User:`<Name>`/vector.js](https://meta.wikimedia.org/wiki/Special:MyPage/vector.js), which will be loaded only on Meta-wiki, in the vector skin
2. Copy the following to the page you have chosen:
```javascript
// [[File:User:EpochFail/WikiLabels.js]] (workaround for [[phab:T35355]])
mw.loader.load( '//labels.wmflabs.org/gadget/loader.js' );
```
3. Clear the cache of your browser.
This will import a live copy of the javascript.
## See also
* [meta:Wiki labels](https://meta.wikimedia.org/wiki/Wiki labels)
This package provides the components of a generalized labeling service for
MediaWiki. There are two primary components, a user script to be used on
MediaWiki and a flask server for the gadget to converse with.
## Server
The flask server is intended to be hosted by a web server, but a dev server can
be started locally with
wikilabels dev_server
### Installation
#### Dependencies
Installation will require some additional packages to be available.
`sudo apt-get install postgresql-server-dev-all postgresql libffi-dev npm g++ python3-dev libmemcached-dev`
#### Database setup
You'll need to create a `wikilabels` user and database. Here's a sequence of
commands that works on a fresh install of postgres (note that `sudo` rights
will be required).
Create a wikilabels user
$ sudo useradd wikilabels
Switch to `postgres` user to run commands
$ sudo su postgres
$ psql
postgres=# CREATE USER wikilabels WITH PASSWORD 'something secure';
postgres=# CREATE DATABASE wikilabels;
postgres=# GRANT ALL PRIVILEGES ON DATABASE wikilabels to wikilabels;
postgres=# \q
$ exit
Switch to `wikilabels` user to load schema
$ sudo su wikilabels
$ psql
Copy-paste config/schema.sql into the command prompt.
Optionally, you can also load sample data into the database by copy-pasting config/schema-testdata.sql into the command prompt
### Installing javascript dependencies
$ npm install codemirror jquery oojs oojs-ui strftime yamljs
### Starting the dev server
$ wikilabels dev_server --config config-localdev.yaml
## Gadget
1. Go to one of the js subpages of your user page. You can choose a page such as these:
* [meta:User:`<Name>`/global.js](https://meta.wikimedia.org/wiki/Special:MyPage/global.js), which will be loaded in all wikis, in all skins
* [meta:User:`<Name>`/common.js](https://meta.wikimedia.org/wiki/Special:MyPage/common.js), which will be loaded only on Meta-wiki, in all skins
* [meta:User:`<Name>`/vector.js](https://meta.wikimedia.org/wiki/Special:MyPage/vector.js), which will be loaded only on Meta-wiki, in the vector skin
2. Copy the following to the page you have chosen:
```javascript
// [[File:User:EpochFail/WikiLabels.js]] (workaround for [[phab:T35355]])
mw.loader.load( '//labels.wmflabs.org/gadget/loader.js' );
```
3. Clear the cache of your browser.
This will import a live copy of the javascript.
## See also
* [meta:Wiki labels](https://meta.wikimedia.org/wiki/Wiki labels)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
wikilabels-0.1.0.zip
(2.5 MB
view details)
wikilabels-0.1.0.tar.gz
(1.9 MB
view details)
File details
Details for the file wikilabels-0.1.0.zip
.
File metadata
- Download URL: wikilabels-0.1.0.zip
- Upload date:
- Size: 2.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f7c1326a84c29a7102d40c9297e10f1c8e03ddf897bf429d959e68bd2e331a6 |
|
MD5 | c94d750165d2a20e260352aa9ed6c585 |
|
BLAKE2b-256 | 7a711f24e6d174cc2d5b243f8f62bdbeba98226d1afc9ffb6f22d753a30dde47 |
File details
Details for the file wikilabels-0.1.0.tar.gz
.
File metadata
- Download URL: wikilabels-0.1.0.tar.gz
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60f21e62b798f90ce841516c0075e51a1778841ec627a03b4bfe6cd0e75f4b25 |
|
MD5 | 77a8af29e32a8d22608ebb28e04e3f67 |
|
BLAKE2b-256 | 31ab304763c0c98d43f20e4de353c88d49d8c6685d80454c28ebbec25dd80fad |