Hi devs,
Right now a Syntax format is <id>/<version>
. And you can call Syntax#getType()#getId()
and Syntax#getVersion()
.
Note that we also have a qualifier but it’s used only for when displaying the syntax into string and we introduced it to mark a syntax as experimental.
What we are missing is the concept of syntax variants. This can be useful for example if you wish to list all syntaxes that exist for a base syntax (e.g. all Markdown syntaxes or all XWiki syntaxes).
For example:
- Markdown:
- Base syntax id =
markdown
- Variants =
github
(github-flavored),commonmark
, etc
- Base syntax id =
So far, we’ve used the notation +
in the id part to separate the base and variant part. For example: confluence+xhtml
, xdom+xml
, etc.
The only problem is that this is not semantic/typed. It’s just a convention. We don’t have a getVariant()
API.
This proposal is about adding such as a variant or variants.
Proposal:
- Allow zero, one or several variants
- Keep the same syntax format as now, with the “+” to separate the variants
- Introduce a new constructor in Syntax to be a
List<String> variants
. - Introduce a
List<String> Syntax#getVariants()
method. - Modify the
toString()
to display the variants + change equals/hashcode ofc - Modify the well-known syntax types to use the constructor with the variant
WDYT?