Search Unity

"View documentation" button as a hyperlink

Discussion in 'Package Manager' started by kassskata, Jan 29, 2020.

  1. kassskata

    kassskata

    Joined:
    Sep 24, 2019
    Posts:
    16
    In Unity Input System and other Unity Technologies package manager packages when clicks on button "View documentation" opens a new page in default browser which leads to the Documentation page.
    That functionality can find it on other buttons too ("View changelog", "View license").
    I cannot "reverse-engineering" it properly how is made it and cannot find it in Package Manager documentation pages how to do it. My company needs that feature from me. Please help!

    upload_2020-1-29_13-16-53.png
     
    nikolicdarko likes this.
  2. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    This is hacked into packages currently as far as I'm aware. It's HARDCODED to open something like
    Code (CSharp):
    1. $"http://docs.unity3d.com/Packages/{upmVersion.shortVersionId}/index.html";
    which is obviously not a good idea for all but Unity's own packages.

    See https://github.com/Unity-Technologi...nagerUI/Editor/Services/Upm/UpmPackageDocs.cs (lines 90-130 if you're interested in hacky hardcoded internal code).

    I highly recommend using Package Manager Extensions for company-specific stuff, Unity does not really (currently) care for people developing their own packages and tooling. (sorry @okcompute_unity but that's the state it is.)
    https://docs.unity3d.com/Packages/c...ckageManager.UI.PackageManagerExtensions.html

    You can register your own package manager extension which can
    • draw a custom UI with everything you need
    • change the method that is called when you click "View documentation"
    • etc, really you can change Package Manager UI to work for you with this.
    EDIT:
    From what I can see, latest 2020 alpha versions do support a new property "documentationUrl" for package manifests, but for 2019 you'll probably have to stick to the above.
     
  3. kassskata

    kassskata

    Joined:
    Sep 24, 2019
    Posts:
    16
    Thank you fherbst ! I will look it :)
     
  4. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    151
    @fherbst is right,
    documentationUrl
    is supported as of 2020.1
     
  5. AdminOh

    AdminOh

    Joined:
    Feb 11, 2016
    Posts:
    23
    Will it be backported to Unity 2019.4 ?
     
  6. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    151
    There are currently no plans to backport
    documentationUrl
    so I have to give you our generic reply - if you have an account manager with Unity then please make the request through them. Sorry!