fix: remove redundant class info for subclasses #87
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.
Before you open a pull request, note that this repository is forked from here.
Unless the issue you're trying to solve is unique to this specific repository,
please file an issue and/or send changes upstream to the original as well.
Previously when I simply concatenated the
parent_class
info toinsert_class
to combine the list and iterate through the combined list of the two, unfortunate things happened.insert_class
is a pointer reference toapp.env.docfx_yaml_classes[datam[CLASS]]
, so modifyinginsert_class
reflects the data stored inapp.env.docfx_yaml_classes
and we took advantage of that below.insert_class
withparent_class
, that's where the duplication happened by echoing theparent_class
data literally onto the correspondingapp.env.docfx_yaml_classes[datam[CLASS]]
.This is now avoided by handling them separately.
Also, when adding the
subclass
to its parent we only need to include its info in the reference and underchildren
section of the yaml, so we do not need to appenddatam
to the parent class, since this would be redundant information we echo onto the parent class.Fixes #86