Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player class does not include Unity documentation #14

Open
marwie opened this issue May 31, 2020 · 2 comments
Open

Player class does not include Unity documentation #14

marwie opened this issue May 31, 2020 · 2 comments

Comments

@marwie
Copy link

marwie commented May 31, 2020

Hello, thanks for the project.

Ive been trying to figure out how to get the full name of Unity type namespaces for package code. I tried running docfx but the Player class does not include Unity documentation either:
image
the log output is as follows:
image

As for my own project I tried using the csproj of my package as metadata provider but I get an error in UnityEngine.Rendering.yml using "ManagedReference.html.primary.js" saying something like "error running Transform function inside template preprocessor: type if undefined". It's a 7000ish raw data json. Do you happen to have any knowledge about errors like this one and maybe a hint on how to debug? (Using the default template)

@shreyanshanchlia
Copy link

Same issue here as well. Can't refer to Unity Documentation.

@NormandErwan
Copy link
Owner

NormandErwan commented Feb 19, 2021

DocFX requires two conditions to generate xref links:

  1. Generating metadata from .csproj not from .cs files.
  2. Building the documentation with a valid Unity installation on the machine.

Therefore it requires to install and activate Unity before generating the docs to : (1) generate the .csproj and (2) allow DocFX to generate xref links.

This is similar to #18 but here on a local machine, there on GitHub workflows.

On a local machine, you need to :

  1. Edit your docfx.json to generate metadata from .csproj

    "metadata": [
         {
             "src": [
                 {
                     "src": "..",
                     "files": [
    -                    "**.cs"
    +                    "*.csproj"
                     ]
                 }
             ],
             "globalNamespaceId": "Global",
             "filter": "filterConfig.yml",
             "dest": "api"
         }
     ],
    
  2. Make sure Unity has generated the .csproj files.

    • Either, inside the editor, click Assets > Open C# Project.
    • Or, in a terminal, type: "C:\Program Files\Unity\Hub\Editor\<version>\Editor\Unity.exe" -batchmode -nographics -quit -executeMethod UnityEditor.SyncVS.SyncSolution.
  3. Finally generate your docs!

I'll update the FAQ of this repo with these instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants