63 | UnityDocGenerator
64 |
65 | A helper to make docfx based document in Unity3D
66 | Features
67 |
68 | - Document generate based on Docfx in Unity3D
69 | - Generate document depend on Unity Assembly definitions (.asmdef) files.
70 | - Document web preview hosting in Unity3D.
71 | - Tested on Windows Editor, OSX Editor.
72 |
73 | Pre-requisites
74 | UnityDocGenerator require the package manager ui extension mechanism, which is available from version 1.9.3 or later, or remove PackageManager/DocGeneratorPackageManagerExtension.cs to break the Package Manger UI supportion.
75 | Installtion
76 | Add the following line to Packages/manifest.json:
77 | "com.macacagames.docgenerator": "https://github.com/MacacaGames/UnityDocGenerator.git#1.0.0",
78 |
79 | Environment Setup
80 | macOS, Linux
81 | Make sure Mono Framework runtime is installed in your computer.
82 | Download Here
83 | Windows
84 | Make sure MSBuild >= 1.5 is installed in your computer.
85 | One of the easiest way is Install the Visual Studio >= 2013.
86 | Get Visual Studio
87 | Getting Started
88 | 1. Open Editor
89 |
90 | - Option 1 (recommend): You can press the Open with Unity Doc Generator button on an installed packages to open the UnityDocGenerator.
91 |
92 |
93 |
94 | - Option 2: In Project window you can use Assets Menu to open a folder directly by click Open with Unity Doc Generator (This method may not work corrrectly if the folder name contains the "." char)
95 |
96 |
97 |
98 | - Option 3: Open the editor via Unity's toolbar, MacacaGames > UnityDocGenerator
99 |
100 | 2. Get the full path of your mono install.
101 | macOS, Linux only! Windows user can skip this step.
102 | which mono
103 |
104 | If the Mono Framework is install correctlly, you may got the return like this.
105 | /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono
106 |
107 | Then paste the value to the Mono Path field on Editor.
108 |
109 | 3. Select your working folder
110 | Type the working folder path or use Select Folder select via dialog.
111 | (If the Editor is open via Option 1. or Option 2. the value will fill-up automatically)
112 |
113 | UnityDocGenerator will find out all Unity Assembly definitions (.asmdef) files inside the folder (include all sub folder) as the DocFx target.
114 | For example, the screeshot shows there will be 2 files set to DocFx target.
115 |
116 | 4. Generate!!
117 | Click Generate Document and wait for the task complete.
118 | The Unity Editor may hangs during the docfx runing, it is normal and usually resume in 1 min (Based on your project size).
119 | You can see the DocFx result in Unity Editor Console.
120 |
121 | 5. Hosting and preview (Optional)
122 | You can preview you generated document via UnityDocGenerator.
123 | Click Start Hosting to enable hosting, navigate to http://127.0.0.1:18080/index to view your generated document.
124 | Hosgint power by sableangle/UnityHTTPServer
125 |
126 | 6. Next Step?
127 | Upload your document to your web server.
128 | The generated html document is in /docs~
folder
129 | Project Struction
130 | UnityDocGenerator will generate two folders in your working folder.
131 | Only modify them if you understand what you're doing, eg.. more custom modify for docfx.
132 | UnityDocGenerator use .docfx_project/docfx.json as the DocFx setting to generate document.
133 | ─ root (The working folder you select)
134 | └─ /your sub folders...
135 | └─ your files...
136 | └─ /.docfx_project (The DocFx project generate by UnityDocGenerator)
137 | └─ docfx.json (DocFx setting file)
138 | └─ other docfx project files...
139 | └─ /docs~ (The generated html document)
140 | └─ /Documentation~ (The generated document)
141 | └─ udg_setting.json (The UnityDocGenerator setting file)
142 |
143 | Customize
144 | You can make your change on DocFx project. The DocFx project is under "{ProjectRoot}/.docfx_project" folder.
145 | See DocFx document for more detail to modify.
146 | Troubleshooting
147 |
148 | - Try to find the error message in Unity Editor Console.
149 | - Make sure you Mono Framework is install correctlly.
150 | - Open an issue on Github if there is any bug, and provide the project which reproduce the issue (if possiable).
151 | - Linux Editor is supported in theory but not tested.
152 |
153 | TODO
154 |
155 | - More custom setting for docfx.
156 |
157 |