# 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
### 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
### 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)
Release files for wikilabels 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wikilabels-0.4.0.tar.gz | 241.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wikilabels-0.4.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 539.0 kB
Release files / wikilabels-0.4.0.tar.gz
| Download URL | wikilabels-0.4.0.tar.gz |
|---|---|
| Size | 241.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8295403feebaf94fe7973b3e32ab18fecc147b5ce952d426d704325268161b4
|
|
BLAKE2b-256 checksum How to use checksums |
2f8e12c984a7dbd5668fc03e3fbd8a9c031bfb6b3e08a4bdeb20cea5325b4d27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / wikilabels-0.4.0-py2.py3-none-any.whl
| Download URL | wikilabels-0.4.0-py2.py3-none-any.whl |
|---|---|
| Size | 298.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
27ce460d08a0ca8f04b8f9ea674e4dc4af179348bb4d05a7caba0e5f31ecf70c
|
|
BLAKE2b-256 checksum How to use checksums |
9396e450e9f7cd53005e0d402a58cb81a0ee0ab82708dd0e75e3d7abdf9b132f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |