Search Unity

Create documentation from source code

Discussion in 'Editor & General Support' started by kenshin, Aug 8, 2012.

  1. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Hi all,

    how can I generate documentation from c# unity3d scipt files?
    I use both visual studio and monodevelop.

    Normally I use visual studio xml generated file + sandcastle to build documentation, but with Unity3d I can't build the project and then xml file is not generated... then I can't use sandcastle to build my documentation.

    What is the best solution to create documentation for a unity3d project?

    Thanks in advance for any answer!
    KEnshin
     
  2. stimarco

    stimarco

    Joined:
    Oct 17, 2007
    Posts:
    721
    Hi Kenshin,

    Unity does support a post-processing feature for builds, here.
     
  3. Blazor-Ramone

    Blazor-Ramone

    Joined:
    Jan 10, 2011
    Posts:
    8
    I too was trying to see if I could generate a file based on the XML comments in my C#. It would seem that this is something that is built in to the usual visual studio and mono c# compilers, but there doesn't seem to be a way to turn this on when Unity builds. Also, I don't see how the post processing feature linked above could be used to turn this on.

    Is this something that is just not available to the unity c# compiler?
     
  4. stimarco

    stimarco

    Joined:
    Oct 17, 2007
    Posts:
    721
    The post-processing feature lets you call command-line tools (via scripting / batch scripts, depending on the OS) and have them build the documentation from the source code. Visual Studio includes a bunch of command-line tools that it uses under the hood, including the one that builds docs from C# source code, though it's been so long since I used it that I can't remember the details.

    I'm not sure if Xcode includes similar tools, as it's built around Objective-C, not C#, but Unity and MonoDevelop do install a Mono environment, which should include similar tools to those in Visual Studio.

    (Hey, I never said this would be easy!)
     
  5. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Hi Stimarco,

    thanks for the usefull answer.

    Just for info, currently I am using doxygen to create project documentation.

    Grazie!
    Kenshin
     
  6. WidmerNoel

    WidmerNoel

    Joined:
    Jun 3, 2014
    Posts:
    66
    For everyone that might come agross this topic.
    I was able to use Sandcastle 2015.5.2.0 and Visual Studio 2015 RC to build my documentation.
    I took about 4h to configure all the settings but I'm almost there now.
    You should be able to build the project in VS but not to run it.
    If you have the build xml docs option enabled in your project settings (VS) it will also bild the xml documentation which you need in order for Sandcastle to work properly. Now I just gotta figure out how I can etablish links to the Unity API if this is even possible in a decent ammount of time.
     
  7. bigoMay

    bigoMay

    Joined:
    Sep 14, 2013
    Posts:
    6