wmde/banner-toolkit

Name: banner-toolkit

Owner: Wikimedia Deutschland e.V.

Description: Command line tool for managing fundraising banners on wikis.

Created: 2016-11-22 10:58:02.0

Updated: 2016-11-22 11:14:52.0

Pushed: 2016-11-22 22:47:47.0

Homepage: null

Size: 31

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

WMDE Banner Toolkit

This command line tool is managing fundraising campaign banners on a wiki.

Installation

Install the command line tool as a global command

composer install -g wmde/banner-toolkit
Usage
Concepts and conventions

Banner names in the wiki should follow the Schema <CAMPAIGN>_<TEST_NAME>_<VARIANT>. Example name: C16WMDE_01_161224_ctrl

Create credentials and campaign configuration

Copy the files from the config-examples directory to the files .env and .campaign_config. Put the files in the directory where you will edit and upload the banners.

Uploading banners

Attention: If you're using CentralNotice, you must first create one or more banners in CentralNotice. This will create the banner text as wiki pages in the MediaWiki namespace. It does not work the other way around!

Create banner HTML files named after variants, e.g. Banner_ctrl.html and Banner_var.html.

Call the command like this (changing the placeholders):

banner-toolkit upload <TEST_NAME>

The command will then look for HTML files matching the Banner_<VARIANT>.html pattern and copy the file contents to the corresponding page. The command figures out the page name by combining the page prefix and campaign name from the configuration, the test name and the variant parts in the file names.

If you want to have an edit comment for the banners, use the -m Parameter:

banner-toolkit upload -m "banner redesign" <TEST_NAME>
Automatic upload

TODO: Describe how to integrate with Git commit hooks or automatic upload on saving in the editor, with Watchman.

Why use this tool instead of CentralNotice editor?

On CentralNotice you only have a textarea for entering banner code. That means you lose focus when you save, have no line numbers and syntax highlighting, no indentation tools except your spacebar.

Furthermore, this tool will probably expanded with cool stuff to further modularize the banner code and re-assemble it before uploading.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.