docfx
docfx copied to clipboard
How to Generate Docs with primitive type name
Operation System: Windows
DocFX Version Used: 2.50.0.0
Template used: default and little customized
Steps to Reproduce:
just follow Quickstart to generate API doc
Expected Behavior:
In generated HTML, members whose type is primitive are written with primitive type names such as float.
Actual Behavior:
In generated HTML, they are shown with BCL names such as System.Single.
How can I get a document with primitive type names?
It looks written names of types are provided by xrefService. But it says the name of System.Single is 'Single'. Therefore the way to overwrite its displayed name with 'float' is needed.
You can provide an xref map to docfx to overwrite this default behavior. But you are right, there is no available config to switch it right now.
yeah, I can provide another xref map. But it looks the xref from microsoft's xrefService is used.
How would you overwrite the full name with the primitive name? (even if this needs to be done manually now)
Or is it not yet possible?
When resolving an xref, docfx should read from xrefmap first, then query xref service.
Thanks for your support.
I wrote xmap yaml file such as:
references:
- uid: System.Single
name: float
and added "xref": ["xrefmap.yml"]
in build section of docfx.json.
But It would not work.
Thank you for the information. I think this name should be already there with information extracted from Roslyn. I cannot think of an easy workaround for now.
Information extracted from Roslyn? Isn't the information used provided from xref map service? such as: https://xref.docs.microsoft.com/query?uid=System.Single
Is there now a way to use the more familiar names for these types?