Proposed: Add a "default value" badge

I think we should add a badge to be used similarly to the existing {{deprecated_inline}} and {{ReadOnlyInline}} badges called {{DefaultInline}}, which would present a little badge indicating that the item it’s attached to is the default value in the set of values being documented.

This would make it easy to standardize and to visually represent the default value when documenting the permitted values for properties or parameters.

Aside:

This also makes me think that we should long ago have switched to an {{InlineBadges}} macro that took as input a list of badge names, so one macro would insert them all.

propertyName {{InlineBadges("non-standard"}}
...
propertyName {{InlineBadges("readonly", "obsolete", "non-standard")}}

That would have enforced a specific order for the badges, made sure spacing was tidy, etc.

2 Likes

I’d also like to point to the mdn/kumascript#986 meta‑issue and its dependencies, which apply some fixes to the badges:


That could be used as a base for the InlineBadges macro.

I’ve now created implemented the {{InlineBadges}} macro in mdn/kumascript#1220: