Is it possible to use local documentation, e.g. HTML files in the Assets folder of a project, as the Help URL for a component?
If so, what path should I put in the HelpURL annotation?
I tried the following annotations with a file at Assets/Documentation/Test.html, but all of them led to the same behavior of nothing happening when I click the help icon for the component in the inspector:
[HelpURL(“Assets/Documentation/Test.html”)]
[HelpURL(“/Assets/Documentation/Test.html”)]
[HelpURL(“…/Documentation/Test.html”)] // relative path to script
I’m not sure the answer here, I’m surprised file:// doesn’t work. Although not nice, have you perhaps tried a full path from the root. Granted that wouldn’t be useful but I’d be curious to know if it works.
I’m digging through the source here for that attribute but it’s not my area of expertise. It does check if it’s a well formed URL and an absolute (not relative) one but if not then has an automatic fallback to file although a the moment, I’m not sure if that’s a relative path or not; still trying to figure it out.
if (Uri.IsWellFormedUriString(url, UriKind.Absolute))
Application.OpenURL(url);
else
Application.OpenURL($"file://{url}");
create temporary redirect_comp1.html file in some fixed folder
open that file from help url (using absolute path [HelpURL("C:\\yourfolder\\redirect_comp1.html")]
that redirect file has one line to the correct path: <meta http-equiv="refresh" content="0; url=file:///D:/yourfolder/anything/project/docs/test1.html" />
*this is what it tries to run if use [HelpURL(("../../log.txt"))]