Exemple #1
0
        /// <summary>
        /// Generate the all the necessary documentation sites.
        ///
        /// The documentation folders will be generated in
        ///     /Users/<USER NAME>/Library/Application Support/Unity/Editor/documentation/packages on Mac
        ///     C:\Users\<USER NAME>\AppData\Local\Unity\Editor\documentation\packages on Windows
        ///
        /// This will generate two folder, one which contains the documentation website, and another wich will contain a page to re-direct to the
        /// latest documentation website address.
        /// </summary>
        /// <param name="packageName">eg: com.unity.package-manager-ui</param>
        /// <param name="shortVersionId">eg: [email protected] (note: not @1.2.0)</param>
        /// <param name="isEmbedded">If the package is embedded</param>
        /// <param name="latestShortVersionId">Short version id of the latest available package. This is used when creating the redirect page to latest version.</param>
        /// <param name="absoluteLatestShortVersionId">Short version id of the latest available package, including preview. Used to link to latest preview version of a package. eg: 1.4.0-preview</param>
        internal void GenerateFullSite(string packageName, string shortVersionId, bool isEmbedded, string latestShortVersionId = "", string absoluteLatestShortVersionId = "",
                                       bool revealInFinder = true, bool openWebsite = true)
        {
            if (!Builder.TryBuildRedirectToManual(packageName, shortVersionId))
            {
                Builder.BuildWithProgress(packageName, shortVersionId);                    // Always re-build
            }
            if (string.IsNullOrEmpty(latestShortVersionId))
            {
                latestShortVersionId = shortVersionId;
            }

            Builder.BuildRedirectToLatestPage(packageName, latestShortVersionId, absoluteLatestShortVersionId);

            if (revealInFinder)
            {
                EditorUtility.RevealInFinder(Builder.GetPackageSiteFolder(shortVersionId));
            }

            if (openWebsite)
            {
                Builder.OpenLocalPackageUrl(packageName, shortVersionId, isEmbedded, "index.html", true);
            }
        }