Open segfaultxavi opened 5 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.
I am still interested in a solution to this problem. Plus, this looks like there's a bug somewhere...
Hi @segfaultxavi , Sorry for the late reply.
The reason is that the derived class lacks fullName
information. The mustache template has a weird behavior: if it cannot find the property in current level, it will look up in parent level...
You can try appending --exportRawModel --exportViewModel
to see the model feeded into template. You will find the derivedClassess
lacks fullName, while inheritance
and current class has.
So this is like a bug that YAML file lacks information of derived classes in reference
section, which makes it not self-contained.
Ok, understood. Is there any workaround you can suggest?
I am already postprocessing yml files to add ?displayProperty=fullName
to links, so I can add more things if I need to.
I can only think of a dirty workaround to fix YAML:
If you have a class have a derived class, you will find this in YAML file:
derivedClasses:
- CatLibrary.TomFromBaseClass
The data fix is to add the missing reference to reference section, like:
references:
- uid: CatLibrary.TomFromBaseClass
name: TomFromBaseClass
nameWithType: TomFromBaseClass
fullName: CatLibrary.TomFromBaseClass
Thank try it again. With this YAML change, your custom template should work.
Thank you very much, with a bit of grep
and sed
I added:
references:
- uid: $fullClassName
fullName: $fullClassName
To every entry in the derivedClasses:
list. Now I can use {{fullName}}
in the template without issues.
DocFX Version Used: 2.40.4.0
Template used:
default
trying to customize itSteps to Reproduce: I would like the names in the
Inheritance
andImplements
sections to be fully-qualified. I have tried with a custom template like this (inpartials/class.header.tmpl.partial
):This works for parent classes, but I am hitting very weird behavior in the child classes, where instead of the full name of the children I get the full name of the current class. The
default
template usesspecName
instead offullName
and everything works as expected, but I lose the namespace.Why is that?
Is there another way to get fully-qualified
Inheritance
andImplements
sections?