Commit graph

20 commits

Author SHA1 Message Date
Thiemo Kreuz e0582842b4 Minor fixes & improvements to Specification.md
Change-Id: Ic2dfeaa12f1e9249dfafd641a8eabfa5ce208d8a
2022-06-27 12:08:59 +02:00
Arlo Breault 03d838ab4a Omit the newline from EndFormat if no parameters are present
Bug: T282031
Change-Id: I631ca08e6e7717e72978debc496ac2ebac21133f
2021-06-29 13:49:49 -04:00
Arlo Breault 920dd0c438 Update FormatString spec to match Parsoid's implementation
This should have been done following
T128319 / I24aa1b7eda6103f54371aca7249d46c3e8bf7349

Note that if the format string specifies indentation before each
paramater (ex. `{{_\n |_ = _\n}}`) that's going to be added in addition
to the whitespace/comments preserved.  That doesn't seem great.  Maybe
everything up to the pipe should be removed?

Change-Id: I2186a09cd8ed4c6b1698a5707de0f22c8207d516
2021-06-29 13:47:50 -04:00
Adam Wight 7b32bcefb4 Add suggested values parameter
Parameters may include a `suggestedvalues` property, which is rendered
in the UI for some parameter types.

TemplateData editor UI elements are implemented behind the
TemplateDataSuggestedValuesEditor feature flag.

Bug: T271897
Change-Id: I14012c79b3fa0d48c58fd8999584cc03ec03575e
2021-04-09 12:05:37 +02:00
Thiemo Kreuz 09f4c90e48 Replace HTML with Markdown in Specification.md
I suggest this change because this file is not rendered
correctly at
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/TemplateData/+/refs/heads/master/Specification.md

Change-Id: Iacaba86cfda4ca5d4c68e22fd0368e58693be3aa
2020-12-11 10:29:49 +01:00
Timo Tijhof d71bdf2f08 Specification: Fix "properties" typo in § 3.2.8
Change-Id: I07d12cc759224474bf631ae5ab50d5819fe60756
2019-01-01 16:59:07 -08:00
Zach e96cfab0d1 git.wikimedia.org -> phab
Bug: T139089
Change-Id: Ib15adc6af6bf1e0c158154c1bd032a5641967ac4
2017-11-05 11:25:29 -09:00
Arlo Breault 7759c1ede2 Update grammar to yield the results in the examples
Change-Id: I5c546e8b80cd7668dce5867b5cabd7940765410e
2017-09-20 13:07:37 -04:00
C. Scott Ananian 86ed0465f8 Further "custom format" spec tweaks.
Change how newlines are handled in the EndFormat production.

Change-Id: Iae5181e65c7afe25810406a39f387f0c1f3cb1b3
2017-01-26 16:29:44 +00:00
Roan Kattouw d9e16f9f06 Update list of spec authors based on git shortlog -n Specification.md
Change-Id: Ifc4741c9d18ae10b44b7f224a000e1d04f6c9462
2017-01-24 10:30:28 +11:00
C. Scott Ananian 5812413f11 Extend 'format' spec to include custom format strings.
Thanks to Thiemo Mättig for the suggestion and specification at
Wikimania 2016 in Esino Lario.

This is an extended version of Thiemo's original specification.  This
version also allows specification of "own line" properties for
templates; that is, whether the template should be preceded/followed
by a newline, as requested by James Forrester.

Bug: T138492
Bug: T135667
Change-Id: Idc6b2680330e6bf5caec2bf6fc86a705d25bc649
2016-09-01 14:14:47 -07:00
Bartosz Dziewoński 8e55adab59 [BREAKING CHANGE] Change default format to null instead of 'inline'
Don't enforce 'inline' as the default format if none is specified.
Instead preserve the unspecified value as 'null'. This allows
third-party tools to provide a better default experience when changing
existing content (e.g. by using smart detection to follow the format
already used).

Bug: T128337
Change-Id: I911c7999e3731c0125fc058118f8d7287d8f88f4
2016-03-01 22:53:27 +00:00
eranroz 01821eae64 Introduce new 'format' template property
Adding format data, which defines the preferred source format
to use when using templates.

Possible formats:
* Inline - all parameters in a single line
* Block - each parameter is in its own line

Bug: T64147
Change-Id: Id856c4a38890526060d0619432f06174d66f7792
2015-11-11 23:52:17 +00:00
James D. Forrester 017fa53e65 Add a url type for URLs
Bug: T54880
Change-Id: I722fcbc957825c2aaea32d9350480d29a388bb68
2015-09-30 22:15:19 +00:00
James D. Forrester 62d3138216 Add a wiki-template-name type for template names
Bug: T88900
Change-Id: Ia1c87072f453df4b756de6725c4b3ab1dda84497
2015-09-17 12:28:11 -07:00
Moriel Schottlender ec0467c65a Add an example property to parameters
The example is optional and can be translated.

Bug: T53049
Change-Id: I9e2d66a805e25409532a742521886233ce3de569
2015-04-09 19:23:42 +01:00
Moriel Schottlender ff77f32e38 [BREAKING CHANGE] Change "default" property to InterfaceText
Default should be InterfaceText and support languages.

Bug: T54966
Change-Id: I7be3a8be72df3e5d80300bd72fcd7197e43155aa
2015-04-02 08:53:51 +01:00
Marielle Volz d6cac31082 Implement new "maps" property in Root
Add "maps" as an allowed root value to template data JSON.

Maps allow applications to map equivalencies between their
application-specific parameters and valid template parameters.

Each Map has arbitrary keys (from the consuming application) that
are mapped to one or more template parameters.

* Added root.maps to TemplateDataBlob
  * Validates that values are strings or arrays
  * Validates that values are valid params
* Added templatedata-invalid-param to i18n/en.json
  * Richer error message for when invalid value is a param
* Fixed existing tests to work with new "maps" property
* Added two new tests for maps
  * Test for invalid value (!string or !array)
  * Test for invalid parameter
* Added specification for root.maps property and Map object

Change-Id: I3bf5e002ad6c1632e02c4c2e393b244c51f77177
2014-11-08 20:29:51 +00:00
Timo Tijhof 9dd5cb4087 spec: Fix Markdown syntax to be compatible with gitblit
It requires void tags to be XML-compatible.

Change-Id: Ic785424b6586b3757e1b7883308a54e7275499e4
2014-09-24 14:11:50 -07:00
Timo Tijhof c5dfe5b2a9 spec: Rewrite, reshape, reform! (Markdown)
Change-Id: I4eae6e6719242524d9d9f770e2701f302dd40cd8
2014-09-24 14:06:42 -07:00