I’ve brought this up in the past, and the result was kind of a “let’s see how things go” of a thing. I still feel that we should in many if not most cases document dictionaries just like we do interfaces, with an overview page for the dictionary itself and subpages for its properties.
The simple reason is logistics: we have a macro for creating links to API terms (our old friend
domxref), which we can’t use to link to dictionary documentation right now. This leaves creating links to information about dictionaries and their members as a weird stand-out – dictionary related reference information is the only thing on all of MDN you can’t get at through macros right now.
While, yes, some dictionaries are very limited in use or are only used as input to a single method, this is more and more often not the case as newer APIs make increasing use of dictionaries (not to mention cases where specifications get updated to change interfaces into dictionaries, as recently happened with some of the RTP interfaces in WebRTC).
Even in cases where the dictionary is used only as input to one parameter (such as when calling a constructor, for example), there are frequently times where you have to refer back to them. For instance, “The behavior of this method varies depending on the value specified as the
someDictionaryThing option when setting up your
I propose that we document all dictionaries exactly as we do interfaces, except for calling them dictionaries (of course), that we add “Dictionary” to our standard set of tags, and that we update the
APIRef and any other relevant macros so they find and include dictionaries in lists they generate.
I further propose that we come up with a plan and a solution for embedding inline the information about a dictionary that we currently present when describing parameters that take a dictionary as input, in scenarios where historically we’ve documented the dictionary inline.
The current situation of documenting dictionaries differently in different situations, and the consequent problems with generating links that results from this, is making the documentation more difficult to maintain and to read than necessary. Let’s fix it!