NormandErwan / DocFxForUnity

DocFX usage example for Unity projects
https://normanderwan.github.io/DocFxForUnity/
MIT License
217 stars 31 forks source link

Unable to download xref map file #23

Closed AnomalousUnderdog closed 2 years ago

AnomalousUnderdog commented 2 years ago

For a brief time, I was able to make links to Unity API work. After some time continually testing and building my documentation, they just stopped working. My classes are recognized as inheriting from UnityEngine.MonoBehaviour, for example, but they are plain text, and have no link to the Unity docs. Any time I have a property, return value, parameter type, etc. that is in the Unity API, it doesn't have a link.

Even a simple

[Test MonoBehaviour Link](xref:UnityEngine.MonoBehaviour)

doesn't work.

I did notice this message from docfx:

[22-07-29 08:07:13.483]Warning:[BuildCommand.BuildCore.Build Document]Unable to download xref map file from https://normanderwan.github.io/UnityXrefMaps/xrefmap.yml, details: Unable to connect to the remote server

I can't access that website anymore (connection time out). I don't know if it's just with me. I did check with various website checkers such as https://downforeveryoneorjustme.com/normanderwan.github.io?proto=https and https://www.freshworks.com/website-monitoring/is-it-down/https%3A%2F%2Fnormanderwan.github.io%2F and it says the website is down.

I did manage to download a 12.9 MB yml file from that URL before, but I don't know how to use it. I'd rather just somehow be able to use that yml file offline rather than relying on a website that is down.

Changing the line in my docfx.json didn't seem to work (UnityXrefMap.yml is the filename I gave it, I placed it in the Documentation folder, same place where the docfx.json is).

-     "xref": [ "https://normanderwan.github.io/UnityXrefMaps/xrefmap.yml" ],
+     "xref": [ "UnityXrefMap.yml" ],
AnomalousUnderdog commented 2 years ago

Ok I figured it out. Turns out I had to delete the obj/.cache folder. I guess there was old data there that DocFx refused to recalculate. Now it works fine with the offline copy of UnityXrefMap.yml I have.

NormandErwan commented 2 years ago

Glad you find a solution!

Indeed, DocFX is a bit hard to figure out sometimes. Clean build is a good thing to try times to times.

About the link, it's still up and online: https://normanderwan.github.io/UnityXrefMaps/xrefmap.yml Maybe GitHub has a downtime at that moment?

Anyway, I will update the docs: An offline copy could be a preferred method over an online file.

AnomalousUnderdog commented 2 years ago

Thanks for the reply! I have a suspicion it was due to the 100 GB monthly bandwidth limit. I'm not sure, maybe the user viewing also has some sort of monthly bandwidth limit (not just the site)? I was testing it just 2 days away from a new month (July 30).

Checking it just now, I can indeed access it again, as well as any github.io site (it was a little frustrating cause I previously couldn't access the DocFx tutorials at https://dotnet.github.io/docfx/).

EDIT: This is weird, but the problem eventually happens again (even though I have been using an offline copy of the xrefmap.yml). But the good thing is that I just needed to delete obj/.cache folder again.

Using --cleanupCacheHistory, --force, and/or --forcePostProcess arguments when calling serve didn't work (at least, not for me). I really had to delete the obj/.cache folder manually.