TSDocConfigFile.loadFromParser() generates a tsdoc.json file from the API object, which can be used to produce a single file that rolls up another tsdoc.json file, plus its "extends" references, plus the predefined standard tags for the current TSDoc version. This is useful for serializing the exact TSDoc configuration for later usage.
However, normally tsdoc.json files are loaded with a set of predefined standard tags, which would conflict with the serialized copy of those definitions. This PR solves that problem by adding a "noStandardTags" that instructs the loader not to predefine any tags.
It might also be useful for a custom tsdoc.json configuration that wants to be substantially different from the standard tags. Or for example, if we wanted to publish tsdoc.json config files that represent previous versions of the TSDoc standard. So this feature can be generally useful.
Design note
I initially approached this by moving the standard definitions into a standard-tsdoc.json file (rather than having them declared in code). The idea was that a custom tsdoc.json file would always have a line like this:
This seemed elegant, because the predefined values are now in a nice JSON file, and their existence is explicitly specified using the familiar "extends" mechanism. But I realized that it would be clunky in practice:
Every project that has a tsdoc.json file must now have a direct dependency on the @microsoft/tsdoc package
Its version needs to be coordinated the indirect dependency from your documentation tool
99% of developers will always want the defaults, so opting out is more convenient than opting in
TSDocConfigFile.loadFromParser()
generates a tsdoc.json file from the API object, which can be used to produce a single file that rolls up another tsdoc.json file, plus its"extends"
references, plus the predefined standard tags for the current TSDoc version. This is useful for serializing the exact TSDoc configuration for later usage.However, normally tsdoc.json files are loaded with a set of predefined standard tags, which would conflict with the serialized copy of those definitions. This PR solves that problem by adding a
"noStandardTags"
that instructs the loader not to predefine any tags.It might also be useful for a custom tsdoc.json configuration that wants to be substantially different from the standard tags. Or for example, if we wanted to publish tsdoc.json config files that represent previous versions of the TSDoc standard. So this feature can be generally useful.
Design note
I initially approached this by moving the standard definitions into a standard-tsdoc.json file (rather than having them declared in code). The idea was that a custom tsdoc.json file would always have a line like this:
This seemed elegant, because the predefined values are now in a nice JSON file, and their existence is explicitly specified using the familiar
"extends"
mechanism. But I realized that it would be clunky in practice:@microsoft/tsdoc
package