Search Unity

Feedback Make Unity's internal DocFX setup public

Discussion in 'Package Manager' started by CaseyHofland, May 26, 2021.

  1. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    613
    I love to divide my code up into packages, and I would love if I could easily generate Unity-themed documentation for it (by which I mean pages like this).

    Currently I use github wiki for my manual and doxygen for my API, but dream of the day where I can just put my .md files in a Documentation~ folder, click a button, and everything would just... work, and have pretty styling to booth.

    Please make this public: I'd like to figure out how to integrate it with github pages. That way documentation becomes easy, more people may do it, and we'll all live happily ever after.
     
    Last edited: May 29, 2021
  2. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,066
    DocFX is public, it's part of dotnet and not developed by Unity, you can find it here: https://dotnet.github.io/docfx/

    I've been using it to generate documentation like these for a long time and you can find the setup for it here. Though, it's not one-click and requires setup and tweaking.

    I would also appreciate an easier integration into the Unity editor and I believe Unity has an internal package that they might make public one day. But you'll always have to publish your documentation somewhere, DocFX documentation doesn't work with a
    file://
    url, so there's a limit to how much Unity can make the process transparent.
     
    mrwellmann likes this.
  3. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    613
    Ah yes, this internal package is what I meant, though I have worded it rather poorly.

    Even if it can't be run from
    file://
    , if we can get our hands on that package I could start exploring how to make it work with github pages.

    I have updated the title and my original comment to reflect these clarifications.

    And thanks for your example! If I understand correctly, you are using the trimmer-extras repository as a "wrapper" of sorts for either DocFxForUnity or your own implementation, correct? That's pretty clever, wish I'd thought of it.
     
    Last edited: May 29, 2021
  4. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,066
    AFAIK Unity is planning to add better package authoring tools, which could include ways to generate documentation. But with the current focus being on stability, I wouldn't expect them to become available very soon.

    I've set up this project before Unity's support for packages in git subfolders and, at the time, the only option to have a development Unity project and a git Unity package was to have two repositories. But I quite like the approach, it keeps the package repository focused and allows to put additional tangential stuff (documentation sources, tests and icon sources in this case) in the development project repository.
     
    CaseyHofland likes this.
  5. ExodusOTH

    ExodusOTH

    Joined:
    Nov 30, 2017
    Posts:
    45
    I'd love for their DocFx template to be public as well, so just a subtle bump from me
     
  6. frarees

    frarees

    Joined:
    Jun 8, 2012
    Posts:
    36
  7. frarees

    frarees

    Joined:
    Jun 8, 2012
    Posts:
    36
  8. Jonathan-Westfall-8Bits

    Jonathan-Westfall-8Bits

    Joined:
    Sep 17, 2013
    Posts:
    271
    I really hope the package itself becomes public though. It is cool to see that it allows building Mermaid Diagrams. That feature alone could save me so many hours of writing documentation for my projects.
     
  9. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    613
    I have made a GitHub Action to generate package documentation using GitHub Pages for anyone who’s interested

    https://github.com/CaseyHofland/docfx-unitypackage

    I haven’t made any mermaid diagrams myself, but that should be a docfx feature so it should work (emphasis on should).
     
  10. Jonathan-Westfall-8Bits

    Jonathan-Westfall-8Bits

    Joined:
    Sep 17, 2013
    Posts:
    271
    Casey I have a question about the DocFX package you linked to. Nothing too big, but it might be one better for a private DM message so I don't fill up this thread. Is it okay if I DM or email you a question about it related to it's documentation?

    And depending on the answer and tests I might be doing I will post the results in this thread to help out other Unity devs to make their lives easier.
     
  11. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    613
    Sure thing! You can send someone a DM on the Unity forums, just click my name and start a conversation
     
  12. KertoxElFantastico

    KertoxElFantastico

    Joined:
    Feb 25, 2020
    Posts:
    1
    Man, I cannot express with words how grateful I am. I've been looking for ages for a way to automate documentation generation in custom packages.

    You just saved me hours of documentation writing and formatting for a framework I'm developing for my final degree project, and you're definitely going into my acknowledgments section. Cheers!
     
    CaseyHofland likes this.
  13. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    613
    That's awesome to hear! It takes me back: I originally made this for my degree project as well (and it wasn't even part of my degree) so I understand your pain.

    I would greatly appreciate a small donation to show your support. Even if you don't have anything on hand right now, donating $0.01 would already make me really light up ^v^

    But I hate creators begging for donations too so don't feel pressured ;) In any case I'm already super grateful for the acknowledgement!

    https://github.com/sponsors/CaseyHofland