Documentation on how to structure package samples

I saw in Unite Copanhagen that you can put a special .json file in a Sample folder and then they show up as import buttons in Unity Package Manager. Is the official documentation of how to properly do this out yet?

Additionally I want to know how to make it so that there is a view documentation link appearing in UPM and when clicking it, it could go to my own website.

Already checked :

No mention of Samples.

It mentioned Documentation~ folder, but it is just documentation files and not a website target. Also I think we should use .documentation instead as ~ folder is also excluded from Git. (A maintenance problem)

Perhaps there’s no documentation for them but there is a sticky thread.

1 Like

Hi @5argon ,

No there is no official documentation for this feature yet as it is still a work-in-progress. The thread posted by @npatch1 is the way to go for now.

This feature is on our road map!

Had to do a little investigating into this one! The ~ character has no special meaning in terms of the .gitignore file, however I verified that folders ending with ~ were not tracked by git for me locally. Turns out I had the following pattern in my .gitignore_global file: “*~”. You can verify where this ignore rule is coming from on your machine by using the “git check-ignore -v” command. I’m not sure how I ended up with this rule in my global ignore file but at least you know you can modify/remove it now to track the Documentation~ and other such tilde folders used by Unity

2 Likes

Hi, I just checked and for some reason there is one on my machine with that rule too… fixed it now! Thanks a lot.

I have also accidentally discovered that view documentation/changelog/license link are hardwired to :

/Documentation~/index.md
/CHANGELOG.md
/LICENSE.md

I think this will work for now. But I would like to suggest to allow also LICENSE (without .md) because GitHub auto generated MIT license is without .md. Plus VSCode show a special license key icon when the file name is exactly LICENSE so I think that maybe a mostly accepted convention.