mediawiki-extensions-Visual.../modules/parser/mediawiki.wikitext.constants.js
Subramanya Sastry ba6a304102 Prettified Wikitext Constants hash
* Something to be said for code alignment - easier on the eye!
* Maybe a good case for breaking mediawiki coding guidelines.
* But, happy to abandon commit if not useful. :)

Change-Id: I1133af488f572ac7f8727be9108e08e14c4e6420
2012-06-28 19:08:48 -05:00

58 lines
1.5 KiB
JavaScript

/* -------------------------------------------------------------------
* The WikitextConstant structure holds "global constants" that
* capture properties about wikitext markup.
*
* Ex: Valid options for wikitext image markup
*
* This structure, over time, can come to serve as useful documentation
* about Wikitext itself. For now, this is barebones and sparse.
* ------------------------------------------------------------------- */
WikitextConstants = {
// Valid image options:
// * Prefix options are of the form "alt=foo"
// * Simple options are of the form "center"
//
// See http://en.wikipedia.org/wiki/Wikipedia:Extended_image_syntax
// for more information about how they are used.
Image: {
PrefixOptions: {
'link' : 'link',
'alt' : 'alt',
'page' : 'page',
'thumbnail': 'thumbnail',
'thumb' : 'thumb',
'upright' : 'aspect'
},
SimpleOptions: {
// halign
'left' : 'halign',
'right' : 'halign',
'center': 'halign',
'float' : 'halign',
'none' : 'halign',
// valign
'baseline' : 'valign',
'sub' : 'valign',
'super' : 'valign',
'top' : 'valign',
'text-top' : 'valign',
'middle' : 'valign',
'bottom' : 'valign',
'text-bottom': 'valign',
// format
'border' : 'format',
'frameless': 'format',
'frame' : 'format',
'thumbnail': 'format',
'thumb' : 'format'
}
}
};
if (typeof module == "object") {
module.exports.WikitextConstants = WikitextConstants;
}