docfx icon indicating copy to clipboard operation
docfx copied to clipboard

How to Generate Docs with primitive type name

Open wistnki opened this issue 4 years ago • 9 comments

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?

wistnki avatar Mar 05 '20 20:03 wistnki

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.

wistnki avatar Mar 08 '20 09:03 wistnki

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.

superyyrrzz avatar Mar 09 '20 05:03 superyyrrzz

yeah, I can provide another xref map. But it looks the xref from microsoft's xrefService is used.

wistnki avatar Mar 15 '20 18:03 wistnki

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?

QFSW avatar Mar 29 '20 10:03 QFSW

When resolving an xref, docfx should read from xrefmap first, then query xref service.

superyyrrzz avatar Mar 30 '20 00:03 superyyrrzz

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.

wistnki avatar Mar 31 '20 02:03 wistnki

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.

superyyrrzz avatar Mar 31 '20 15:03 superyyrrzz

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

wistnki avatar Apr 01 '20 04:04 wistnki

Is there now a way to use the more familiar names for these types?

rhys-vdw avatar Jul 21 '22 19:07 rhys-vdw