Create dedicated html outputShortcut #2769
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@Gerrit0 Thanks for the great work on the beta release. I have been working against it to prepare typedoc-plugin-markdown when it lands. I hope this PR makes sense but let me know what you think.
Summary / Purpose
While updating typedoc-plugin-markdown to properly utilize the "outputs" implementation as per #2597 (which is fantastic by the way) I have stumbled upon a bit on an issue.
The issue is that the "html" outputShortcut is bound to the "out" declaration. By reading the above thread I think the initial intention was perhaps to rename the option?
I understand that this is a significant breaking change, so I see the importance of preserving the out option. Ideally, though, I would prefer to avoid introducing a plugin breaking change of requiring a "markdown" option to be specified (instead of the generic "out" option) in order to generate the markdown docs. As it stands there is no way around this.
Proposal
I propose to preserve the existing "out" option as a basic path declaration and to introduce a dedicated "html" outputShortcut. To the end user this will have no effect, as the Outputs class will assume that no shortcut has been specified and apply the html output as the default output.
However this also means that I can create a markdown output and set it as the default and preserve the existing behaviour of the "out" option.
ie something like this:
Then when outputs are specified in config, the dedicated shortcuts will be picked up so the existing behaviour is preserved here too:
Changes
The changes are pretty simple: