Search Unity

Free Plugin for Automatic Documentation of your project through Doxygen

Discussion in 'Assets and Asset Store' started by JacobPennock, Mar 19, 2012.

  1. JacobPennock

    JacobPennock

    Joined:
    Jul 7, 2011
    Posts:
    31
    Hey Unity dev's I just wanted to announce that I am releasing a free plugin that allows you to automatically generate documentation for all your C# scripts right from within the editor, through Doxygen.

    Check out the Video:


    I have not submitted it to the asset store yet, but you can download it now on my blog:

    Unity Automatic Documentation Generation (An Editor Plugin)
     
  2. hdswb

    hdswb

    Joined:
    Nov 3, 2011
    Posts:
    11
    just tried, it would be very helpful for beginner! thanks
     
  3. JacobPennock

    JacobPennock

    Joined:
    Jul 7, 2011
    Posts:
    31
    Thanks for trying out my plugin. I'm glad you liked it.

    Having nice documentation is not just for beginners though. Its a life saver for working in teams and a number of other situations.

    For instance say you are an excellent programmer and have just finished your newsiest, most awesome, set of scripts and want to submit them for sale to the asset store. But now you are faced with the laborious task of trying to create a website or pdf file that explains to all the other programmers, who might buy your scripts, how they work and how to use them.

    With this plugin you can skip that whole step. Just nicely comment your scripts as you go, or go back through adding some comments once your are finished. Click one button and Done! Nice website completely documenting all your work for others is made.
     
  4. diddykonga

    diddykonga

    Joined:
    Jun 9, 2011
    Posts:
    151
    Could there be a possible choice for the defualt style layout, but still keep the dark and colorful theme?
     
  5. JacobPennock

    JacobPennock

    Joined:
    Jul 7, 2011
    Posts:
    31
    Most everything from the default layout is included in the dark theme, just compacted down and cleaned up a bit. The only thing missing is the tree view sidebar of the default theme. Are you saying that you would like to have the option of using the tree view with the dark theme? Or what specifics of the default layout would you like to see as optional parameters for all the themes?
     
    Last edited: Mar 20, 2012
  6. JacobPennock

    JacobPennock

    Joined:
    Jul 7, 2011
    Posts:
    31
    If there are more requests for it, I will work on an update that provides more styling options.

    For the time being you can access many of the more advanced Doxygen configuration options by editing the "BaseDoxyfile.txt" included in the resources directory of the plugin.

    Through editing this file you can get the plugin to generate Latex files (which you can use to make pdf documentations) You can also get it to output makefiles that build docsets for inclusion in Xcode. You can have it build your documentation as a rich text file, as a man page, or as a plain xml format for including in other programs. There are a number of options available to you by editing this base configuration file.
     
    Last edited: Mar 20, 2012
    rakkarage likes this.
  7. sfj

    sfj

    Joined:
    Oct 7, 2011
    Posts:
    4
    Looks sweet..although it seems to get stuck..the progress bar stops in the middle.. Has anybody manage to run this on a mac?
     
  8. JacobPennock

    JacobPennock

    Joined:
    Jul 7, 2011
    Posts:
    31
    Thats a bit strange. I do not have a mac to test on. If you click away from the window and click back does it finish? Also are you able to run the same directory through doxygen's own tools without any errors?


    Looks like it's not executing your copy of doxygen. I just tried putting a wrong address where it says Doxygen.exe, and it does what you describe, progress bar stuck half way and then nothing happens.
     
    Last edited: May 9, 2012
  9. sfj

    sfj

    Joined:
    Oct 7, 2011
    Posts:
    4
    It seems like that the progress bar jumps one step if I click away from the window and come back..

    I tried moving the oxygen app to another place..I'm using this location now:
    /Volumes/Dev/Doxygen/Doxygen.app

    Tried also to point to the folder:

    /Volumes/Dev/Doxygen/

    No luck..though... :(
     
  10. dgutierrezpalma

    dgutierrezpalma

    Joined:
    Dec 22, 2009
    Posts:
    404
    I think this problem is caused because this plugin doesn't use multi-platform-friendly file paths. I have made a test on a Mac and I have exactly the same problem, so I have opened the project folder in the file browser (Finder) and I have found this:

    • An empty folder called Docs
    • A file called Docs\Doxyfile (the file isn't inside the Docs folder, it is outside but it has that name)
    • The progress bar stops after generating that file.

    I haven't examined the source code, but I bet you have build the file path concatenating the "\" character instead of using the fields and methods from the Path class.
     
    Last edited: May 10, 2012
  11. JacobPennock

    JacobPennock

    Joined:
    Jul 7, 2011
    Posts:
    31
    I think you are maybe correct in thinking the problem is caused by not having multi-platform-friendly file paths.

    I have built an update that fixes the paths. You can download it from the original link: Unity Automatic Documentation Generation (An Editor Plugin)

    Before installing it please delete the old version from your project, i.e. remove the Editor -> Doxygen folder.

    Please try this new version out and let me know if it works.
     
  12. sfj

    sfj

    Joined:
    Oct 7, 2011
    Posts:
    4
    Awesome..I'll give it a try this evening..I'll keep you posted! :)
     
  13. sfj

    sfj

    Joined:
    Oct 7, 2011
    Posts:
    4
    It made a little bit of difference...the progress bar went a step further and started flickering... I'm also getting this message now:


    NullReferenceException: Object reference not set to an instance of an object
    DoxygenWindow.Update () (at Assets/Doxygen/Editor/DoxygenWindow.cs:105)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj)
    UnityEditor.HostView.Invoke (System.String methodName)
    UnityEditor.HostView.SendUpdate ()
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions ()
     
  14. JacobPennock

    JacobPennock

    Joined:
    Jul 7, 2011
    Posts:
    31
    Yeah sorry I noticed that too. You might have to close and reopen the window to avoid that null exception bug until I get a minute to fix it. Sorry for the slow update I've been working on my other new plugin
     
  15. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,048
    Hi Jacob, Thanks for this nice plugin.

    FYI .... You cannot just point it to the Doxygen.app as that is a gui front end for Doxygen. The path I am using is "/Applications/Doxygen.app/Contents/Resources/doxygen". It's working fine on the Mac.

    A nice enhancement would be to able to specify a file or folder exclude list so that certain script files are not included as part of the Doxygen output as I don't want to document other peoples code I have purchased from the Asset store for example.

    Cheers

    iByte
     
    rakkarage likes this.
  16. JacobPennock

    JacobPennock

    Joined:
    Jul 7, 2011
    Posts:
    31
    You can specify the folder to search through so if you only want docs for your scripts set to only the folder holding your own.
     
    rakkarage likes this.
  17. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,048
    Hi Jacob, I started looking through the config file and found that as well as the EXCLUDE param.

    Thanks

    iByte
     
    rakkarage likes this.
  18. bradmarxmoosepi

    bradmarxmoosepi

    Joined:
    Jul 24, 2012
    Posts:
    3
    Hi,

    Just downloaded this very useful plugin. Would it be possible to get it to generate UML diagrams with GraphViz as well? I managed to this using doxygen by itself (not your unity plugin).

    Great job though!

    Thanks,
    Brad
     
  19. Karsnen_2

    Karsnen_2

    Joined:
    Nov 28, 2011
    Posts:
    89
    Well the file I download from your website is said to be a zip file which in turn contains a lots of metadata files on numerous folders.

    I did go through you tutorial video wherein you happen to import *.unitypackage file.

    I am using a mac and can someone help me on this issue. It is little weird for me to see things completely different.


    Thanks!!!
     
  20. hiphish

    hiphish

    Joined:
    Nov 13, 2010
    Posts:
    626
    I just discovered this thread and ran into the same issue. I don't think you'll read this, but in case anyone else finds it: if you extract the ZIP with "The Unarchiver" (free on the App Store) instead of the OS default it extracts correctly to a Unity package. Now to get Doxygen and try out this extension...

    BTW, here is the website of The Unarchiver, it's a great little tool that supports various formats. It just extracts the file and then disappears instead of having you to go through a worthless UI
    http://wakaba.c3.cx/s/apps/unarchiver.html
     
  21. bitomule

    bitomule

    Joined:
    Oct 27, 2008
    Posts:
    173
    Thanks Jacob,

    Working on Mac with Unity4.
     
  22. vorkas

    vorkas

    Joined:
    Mar 19, 2013
    Posts:
    27
    can anyone tell me if this works with java script?
     
  23. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Id really like to know that too please
     
  24. Karsnen_2

    Karsnen_2

    Joined:
    Nov 28, 2011
    Posts:
    89
    I am using a mac and these are the steps I did.

    I already had a project folder. I downloaded the package from your blog and I imported that custom package.

    Then I opened up the settings panel.
    I fed in the location as

    /Applications/Doxygen.app/Contents/Resources/doxygen

    Then rest remained as default. Now I "Run Doxygen" and I get the following error.

    ERROR :

    Error: configuration file /Users/narenkeshav/Dev/Unity Projects/NewPluginsTestBest/TouchInputPackage/Docs/Doxyfile not found!

    Now when I get into Docs folder there is no file. but outside that folder there is a file by the name "Docs/Doxyfile". I rename that file as "Doxyfile" and put it inside the Docs folder.

    But the progress bar stalls at over 75%.

    I am not what I did wrong. can someone help me here?

    Thanks.
     
  25. JohanHoltby

    JohanHoltby

    Joined:
    Feb 10, 2013
    Posts:
    89
    One thing I did find some what bothering is that you have to have the documentation outside the folder since it contains .js meant for web (ising jquary).
    So what I did was setting doxygen to plain HTML without any search option. And then I did add a boll variable to the script that was set when the doxygen html was generated. Finally I did add this update function to the DoxygenWindow.cs file:

    void Update(){
    if(RemoveJSFiles){
    RemoveJSFiles=false;
    FileUtil.DeleteFileOrDirectory(Config.DocDirectory+"/html/jquery.js");
    FileUtil.DeleteFileOrDirectory(Config.DocDirectory+"/html/dynsections.js");
    }
    }

    FileUtil.DeleteFileOrDirectory is not allowed out of main scope.

    If you want to have the js script a work around is to put the documentation in a base folder called "WebPlayerTemplates" since that folder is not complied by Unity. This however I find some what confusing if you whip a asset to the asset store and should be avoided (The reasons for the workaround above).

    Hope this help some one out there since i did spend about 6h fighting this beast ;)
     
  26. Rasronin

    Rasronin

    Joined:
    Apr 1, 2014
    Posts:
    1
    On line 351 change the code to the following.


    StreamWriter NewDoxyfile = new StreamWriter(config.DocDirectory + "Doxyfile");
     
  27. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    944
    On a Mac I had to replace the line 351 of the DoxygenWindow.cs file with this:

    Code (CSharp):
    1. StreamWriter NewDoxyfile = new StreamWriter(config.DocDirectory + "/Doxyfile");
     
  28. HunterHunter150

    HunterHunter150

    Joined:
    Mar 9, 2019
    Posts:
    2
  29. fabioColombini

    fabioColombini

    Joined:
    Dec 9, 2013
    Posts:
    30
    2019.1.2f1

    I click on "Window-> documentation with Doxygen" and nothing happens.

    Any help?
     
  30. JuanPabloHdz

    JuanPabloHdz

    Joined:
    Apr 16, 2019
    Posts:
    2
    Hi Fabio. Yeah, I had the same problem. You have to modify the script that comes with the package, in the Init function you have to add Instance.Show().
    [Edited]
    Also, you have to change GetWindow for CreateInstance
     
    Last edited: Jul 9, 2019
  31. Brogrammist

    Brogrammist

    Joined:
    Jan 30, 2016
    Posts:
    1
    Bumping this old thread one more time, I incorporated everyone's recommended changes from above and made a few fixes of my own, the attached Doxygen package should work for Unity 2019.1.7f1, you can also download it here

    Thanks for 7 years of Unity integrated documentation Jacob!
     

    Attached Files:

    _TheFuture_, kdeger, nuverian and 6 others like this.
  32. studio1000realities

    studio1000realities

    Joined:
    Jul 25, 2017
    Posts:
    1
    Wow, just tried this on Linux Ubuntu 16.04 LTS with Unity 2018.03. Works like a charm, no problems! Thanks for the excellent package.
     
  33. UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    Joined:
    Jan 9, 2017
    Posts:
    152
    @Brogrammar bro the custom themes seems broken? I'm using chrome to view the docs also using Unity 2019.4
     
  34. VirtualPierogi

    VirtualPierogi

    Joined:
    Sep 3, 2012
    Posts:
    54
    deus0 likes this.
  35. ashleyhenson654

    ashleyhenson654

    Joined:
    May 6, 2021
    Posts:
    3
    This is broken now

    *Edit Just download Doxygen it works fine with Unity projects.
     
    Last edited: Nov 23, 2021
    IS_Twyker, VirtualPierogi and deus0 like this.