Merge "Gallery: Use intrinsic width for gallery to center caption"
[lhc/web/wiklou.git] / docs / extension.schema.v1.json
1 {
2 "$schema": "http://json-schema.org/schema#",
3 "description": "MediaWiki extension.json schema",
4 "type": "object",
5 "properties": {
6 "manifest_version": {
7 "type": "integer",
8 "description": "Version of the extension.json schema the extension.json file is in.",
9 "required": true
10 },
11 "name": {
12 "type": "string",
13 "description": "The extension's canonical name.",
14 "required": true
15 },
16 "namemsg": {
17 "type": "string",
18 "description": "i18n message key of the extension's name."
19 },
20 "type": {
21 "type": "string",
22 "description": "The extension's type, as an index to $wgExtensionCredits.",
23 "default": "other"
24 },
25 "author": {
26 "type": [
27 "string",
28 "array"
29 ],
30 "description": "Extension's authors.",
31 "items": {
32 "type": "string"
33 }
34 },
35 "version": {
36 "type": "string",
37 "description": "The version of this release of the extension."
38 },
39 "url": {
40 "type": "string",
41 "description": "URL to the homepage for the extension.",
42 "format": "uri"
43 },
44 "description": {
45 "type": "string",
46 "description": "Raw description of the extension."
47 },
48 "descriptionmsg": {
49 "type": "string",
50 "description": "Message key for a i18n message describing the extension."
51 },
52 "license-name": {
53 "type": "string",
54 "description": "SPDX identifier for the license under which the extension is released."
55 },
56 "requires": {
57 "type": "object",
58 "description": "Indicates what versions of MediaWiki core are required. This syntax may be extended in the future, for example to check dependencies between other extensions.",
59 "properties": {
60 "MediaWiki": {
61 "type": "string",
62 "description": "Version constraint string against MediaWiki core."
63 }
64 }
65 },
66 "ResourceFileModulePaths": {
67 "type": "object",
68 "description": "Default paths to use for all ResourceLoader file modules",
69 "additionalProperties": false,
70 "properties": {
71 "localBasePath": {
72 "type": "string",
73 "description": "Base path to prepend to all local paths, relative to current directory"
74 },
75 "remoteExtPath": {
76 "type": "string",
77 "description": "Base path to prepend to all remote paths, relative to $wgExtensionAssetsPath"
78 },
79 "remoteSkinPath": {
80 "type": "string",
81 "description": "Base path to prepend to all remote paths, relative to $wgStylePath"
82 }
83 }
84 },
85 "ResourceModules": {
86 "type": "object",
87 "description": "ResourceLoader modules to register",
88 "patternProperties": {
89 "^[a-zA-Z0-9-\\.]+$": {
90 "type": "object",
91 "anyOf": [
92 {
93 "description": "A ResourceLoaderFileModule definition",
94 "additionalProperties": false,
95 "properties": {
96 "localBasePath": {
97 "type": "string",
98 "description": "Base path to prepend to all local paths in $options. Defaults to $IP"
99 },
100 "remoteBasePath": {
101 "type": "string",
102 "description": "Base path to prepend to all remote paths in $options. Defaults to $wgScriptPath"
103 },
104 "remoteExtPath": {
105 "type": "string",
106 "description": "Equivalent of remoteBasePath, but relative to $wgExtensionAssetsPath"
107 },
108 "skipFunction": {
109 "type": "string",
110 "description": "Path to a file containing a JavaScript \"skip function\", if desired."
111 },
112 "scripts": {
113 "type": ["string", "array"],
114 "description": "Scripts to always include (array of file paths)",
115 "items": {
116 "type": "string"
117 }
118 },
119 "languageScripts": {
120 "type": "object",
121 "description": "Scripts to include in specific language contexts (mapping of language code to file path(s))",
122 "patternProperties": {
123 "^[a-zA-Z0-9-]{2,}$": {
124 "type": [
125 "string",
126 "array"
127 ],
128 "items": {
129 "type": "string"
130 }
131 }
132 }
133 },
134 "skinScripts": {
135 "type": "object",
136 "description": "Scripts to include in specific skin contexts (mapping of skin name to script(s)",
137 "patternProperties": {
138 ".+": {
139 "type": [
140 "string",
141 "array"
142 ],
143 "items": {
144 "type": "string"
145 }
146 }
147 }
148 },
149 "debugScripts": {
150 "type": ["string", "array"],
151 "description": "Scripts to include in debug contexts",
152 "items": {
153 "type": "string"
154 }
155 },
156 "loaderScripts": {
157 "type": ["string", "array"],
158 "description": "Scripts to include in the startup module",
159 "items": {
160 "type": "string"
161 }
162 },
163 "dependencies": {
164 "type": ["string", "array"],
165 "description": "Modules which must be loaded before this module",
166 "items": {
167 "type": "string"
168 }
169 },
170 "styles": {
171 "type": ["string", "array", "object"],
172 "description": "Styles to always load",
173 "items": {
174 "type": "string"
175 }
176 },
177 "skinStyles": {
178 "type": "object",
179 "description": "Styles to include in specific skin contexts (mapping of skin name to style(s))",
180 "patternProperties": {
181 ".+": {
182 "type": [
183 "string",
184 "array"
185 ],
186 "items": {
187 "type": "string"
188 }
189 }
190 }
191 },
192 "messages": {
193 "type": ["string", "array"],
194 "description": "Messages to always load",
195 "items": {
196 "type": "string"
197 }
198 },
199 "group": {
200 "type": "string",
201 "description": "Group which this module should be loaded together with"
202 },
203 "deprecated": {
204 "type": ["object", "boolean"],
205 "description": "Whether the module is deprecated and usage is discouraged. Either a boolean or an object with key message can be used to customise deprecation message."
206 },
207 "position": {
208 "type": "string",
209 "description": "Position on the page to load this module at",
210 "enum": [
211 "bottom",
212 "top"
213 ]
214 },
215 "templates": {
216 "type": ["object", "array"],
217 "description": "Templates to be loaded for client-side usage"
218 },
219 "targets": {
220 "type": ["string", "array"],
221 "description": "ResourceLoader target the module can run on",
222 "items": {
223 "type": "string"
224 }
225 }
226 }
227 },
228 {
229 "description": "A ResourceLoaderWikiModule definition",
230 "additionalProperties": false,
231 "properties": {
232 "class": {
233 "enum": ["ResourceLoaderWikiModule"]
234 },
235 "group": {
236 "type": "string",
237 "description": "Group which this module should be loaded together with"
238 },
239 "position": {
240 "type": "string",
241 "description": "Position on the page to load this module at",
242 "enum": [
243 "bottom",
244 "top"
245 ]
246 },
247 "targets": {
248 "type": ["string", "array"],
249 "description": "ResourceLoader target the module can run on",
250 "items": {
251 "type": "string"
252 }
253 },
254 "scripts": {
255 "type": "array",
256 "items": {
257 "type": "string"
258 }
259 },
260 "styles": {
261 "type": "array",
262 "items": {
263 "type": "string"
264 }
265 }
266 }
267 },
268 {
269 "description": "A ResourceLoaderImageModule definition",
270 "additionalProperties": false,
271 "properties": {
272 "class": {
273 "enum": ["ResourceLoaderImageModule"]
274 },
275 "data": {
276 "type": "string"
277 },
278 "prefix": {
279 "type": "string"
280 },
281 "selector": {
282 "type": "string"
283 },
284 "selectorWithoutVariant": {
285 "type": "string"
286 },
287 "selectorWithVariant": {
288 "type": "string"
289 },
290 "variants": {
291 "type": "object"
292 },
293 "images": {
294 "type": "object"
295 },
296 "position": {
297 "enum": [
298 "top",
299 "bottom"
300 ]
301 }
302 }
303 },
304 {
305 "description": "An arbitrary ResourceLoaderModule definition",
306 "properties": {
307 "class": {
308 "type": "string",
309 "pattern": "^((?!ResourceLoader(File|Image)Module).)*$"
310 }
311 },
312 "required": ["class"]
313 }
314 ]
315 }
316 }
317 },
318 "ResourceModuleSkinStyles": {
319 "type": "object",
320 "description": "ResourceLoader modules for custom skin styles"
321 },
322 "ResourceLoaderSources": {
323 "type": "object",
324 "description": "ResourceLoader sources to register"
325 },
326 "ResourceLoaderLESSVars": {
327 "type": "object",
328 "description": "ResourceLoader LESS variables"
329 },
330 "ConfigRegistry": {
331 "type": "object",
332 "description": "Registry of factory functions to create Config objects"
333 },
334 "SessionProviders": {
335 "type": "object",
336 "description": "Session providers"
337 },
338 "AuthManagerAutoConfig": {
339 "type": "object",
340 "description": "AuthManager auto-configuration",
341 "additionalProperties": false,
342 "properties": {
343 "preauth": {
344 "type": "object",
345 "description": "Pre-authentication providers"
346 },
347 "primaryauth": {
348 "type": "object",
349 "description": "Primary authentication providers"
350 },
351 "secondaryauth": {
352 "type": "object",
353 "description": "Secondary authentication providers"
354 }
355 }
356 },
357 "CentralIdLookupProviders": {
358 "type": "object",
359 "description": "Central ID lookup providers"
360 },
361 "namespaces": {
362 "type": "array",
363 "description": "Method to add extra namespaces",
364 "items": {
365 "type": "object",
366 "properties": {
367 "id": {
368 "type": "integer"
369 },
370 "constant": {
371 "type": "string"
372 },
373 "name": {
374 "type": "string"
375 },
376 "gender": {
377 "type": "object",
378 "properties": {
379 "male": {
380 "type": "string"
381 },
382 "female": {
383 "type": "string"
384 }
385 }
386 },
387 "subpages": {
388 "type": "boolean",
389 "default": false
390 },
391 "content": {
392 "type": "boolean",
393 "default": false
394 },
395 "defaultcontentmodel": {
396 "type": "string"
397 },
398 "protection": {
399 "type": ["string", "array"],
400 "description": "Userright(s) required to edit in this namespace"
401 },
402 "capitallinkoverride": {
403 "type": "boolean",
404 "description": "Set $wgCapitalLinks on a per-namespace basis"
405 },
406 "conditional": {
407 "type": "boolean",
408 "description": "Whether the namespace is conditional upon configuration and should not be registered (requires separate registration via a hook)",
409 "default": false
410 }
411 },
412 "required": ["id", "constant", "name"]
413 }
414 },
415 "TrackingCategories": {
416 "type": "array",
417 "description": "Tracking category message keys",
418 "items": {
419 "type": "string"
420 }
421 },
422 "DefaultUserOptions": {
423 "type": "object",
424 "description": "Default values of user options"
425 },
426 "HiddenPrefs": {
427 "type": "array",
428 "description": "Preferences users cannot set",
429 "items": {
430 "type": "string"
431 }
432 },
433 "GroupPermissions": {
434 "type": "object",
435 "description": "Default permissions to give to user groups",
436 "patternProperties": {
437 "^[a-z]+$": {
438 "type": "object",
439 "patternProperties": {
440 "^[a-z]+$": {
441 "type": "boolean"
442 }
443 }
444 }
445 }
446 },
447 "RevokePermissions": {
448 "type": "object",
449 "description": "Default permissions to revoke from user groups",
450 "patternProperties": {
451 "^[a-z]+$": {
452 "type": "object",
453 "patternProperties": {
454 "^[a-z]+$": {
455 "type": "boolean"
456 }
457 }
458 }
459 }
460 },
461 "GrantPermissions": {
462 "type": "object",
463 "description": "Map of permissions granted to authorized consumers to their bundles, called 'grants'",
464 "patternProperties": {
465 "^[a-z]+$": {
466 "type": "object",
467 "patternProperties": {
468 "^[a-z]+$": {
469 "type": "boolean"
470 }
471 }
472 }
473 }
474 },
475 "GrantPermissionGroups": {
476 "type": "object",
477 "description": "Map of grants to their UI grouping",
478 "patternProperties": {
479 "^[a-z]+$": {
480 "type": "string"
481 }
482 }
483 },
484 "ImplicitGroups": {
485 "type": "array",
486 "description": "Implicit groups"
487 },
488 "GroupsAddToSelf": {
489 "type": "object",
490 "description": "Groups a user can add to themselves"
491 },
492 "GroupsRemoveFromSelf": {
493 "type": "object",
494 "description": "Groups a user can remove from themselves"
495 },
496 "AddGroups": {
497 "type": "object",
498 "description": "Groups a user can add to users"
499 },
500 "RemoveGroups": {
501 "type": "object",
502 "description": "Groups a user can remove from users"
503 },
504 "AvailableRights": {
505 "type": "array",
506 "description": "User rights added by the extension",
507 "items": {
508 "type": "string"
509 }
510 },
511 "ContentHandlers": {
512 "type": "object",
513 "description": "Mapping of model ID to class name",
514 "patternProperties": {
515 "^[A-Za-z]+$": {
516 "type": "string"
517 }
518 }
519 },
520 "RateLimits": {
521 "type": "object",
522 "description": "Rate limits"
523 },
524 "RecentChangesFlags": {
525 "type": "object",
526 "description": "Flags (letter symbols) shown on RecentChanges pages"
527 },
528 "MediaHandlers": {
529 "type": "object",
530 "description": "Plugins for media file type handling. Each entry in the array maps a MIME type to a PHP class name."
531 },
532 "ExtensionFunctions": {
533 "type": [
534 "array",
535 "string"
536 ],
537 "description": "Function to call after setup has finished",
538 "items": {
539 "type": "string"
540 }
541 },
542 "ExtensionMessagesFiles": {
543 "type": "object",
544 "description": "File paths containing PHP internationalization data"
545 },
546 "MessagesDirs": {
547 "type": "object",
548 "description": "Directory paths containing JSON internationalization data"
549 },
550 "ExtensionEntryPointListFiles": {
551 "type": "object"
552 },
553 "SpecialPages": {
554 "type": "object",
555 "description": "SpecialPages implemented in this extension (mapping of page name to class name)"
556 },
557 "AutoloadClasses": {
558 "type": "object"
559 },
560 "Hooks": {
561 "type": [ "string", "object" ],
562 "description": "Hooks this extension uses (mapping of hook name to callback)"
563 },
564 "JobClasses": {
565 "type": "object",
566 "description": "Job types this extension implements (mapping of job type to class name)"
567 },
568 "LogTypes": {
569 "type": "array",
570 "description": "List of new log types this extension uses"
571 },
572 "LogRestrictions": {
573 "type": "object"
574 },
575 "FilterLogTypes": {
576 "type": "object"
577 },
578 "ActionFilteredLogs": {
579 "type": "object",
580 "description": "List of log types which can be filtered by log actions",
581 "patternProperties": {
582 "^[a-z-]+$": {
583 "type": "object",
584 "patternProperties": {
585 "^[a-z-]+$": {
586 "type": "array",
587 "items": {
588 "type": "string"
589 }
590 }
591 }
592 }
593 }
594 },
595 "LogNames": {
596 "type": "object"
597 },
598 "LogHeaders": {
599 "type": "object"
600 },
601 "LogActions": {
602 "type": "object"
603 },
604 "LogActionsHandlers": {
605 "type": "object"
606 },
607 "Actions": {
608 "type": "object"
609 },
610 "APIModules": {
611 "type": "object"
612 },
613 "APIFormatModules": {
614 "type": "object"
615 },
616 "APIMetaModules": {
617 "type": "object"
618 },
619 "APIPropModules": {
620 "type": "object"
621 },
622 "APIListModules": {
623 "type": "object"
624 },
625 "ValidSkinNames": {
626 "type": "object"
627 },
628 "FeedClasses": {
629 "type": "object",
630 "description": "Available feeds objects"
631 },
632 "SkinOOUIThemes": {
633 "type": "object"
634 },
635 "callback": {
636 "type": [
637 "array",
638 "string"
639 ],
640 "description": "A function to be called right after MediaWiki processes this file"
641 },
642 "config": {
643 "type": "object",
644 "description": "Configuration options for this extension",
645 "properties": {
646 "_prefix": {
647 "type": "string",
648 "default": "wg",
649 "description": "Prefix to put in front of configuration settings when exporting them to $GLOBALS"
650 }
651 },
652 "patternProperties": {
653 "^[a-zA-Z_\u007f-\u00ff][a-zA-Z0-9_\u007f-\u00ff]*$": {
654 "properties": {
655 "_merge_strategy": {
656 "type": "string",
657 "enum": [
658 "array_merge_recursive",
659 "array_plus_2d",
660 "array_plus",
661 "array_merge"
662 ],
663 "default": "array_merge"
664 }
665 }
666 }
667 }
668 },
669 "ParserTestFiles": {
670 "type": "array",
671 "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
672 },
673 "ServiceWiringFiles": {
674 "type": "array",
675 "description": "List of service wiring files to be loaded by the default instance of MediaWikiServices"
676 },
677 "load_composer_autoloader": {
678 "type": "boolean",
679 "description": "Load the composer autoloader for this extension, if one is present"
680 }
681 }
682 }