pict-docuserve 1.4.13 → 1.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pict-docuserve",
3
- "version": "1.4.13",
3
+ "version": "1.4.14",
4
4
  "description": "Pict Documentation Server - A single-page documentation viewer built on Pict",
5
5
  "main": "source/Pict-Application-Docuserve.js",
6
6
  "bin": {
@@ -1610,7 +1610,22 @@ class DocuserveDocumentationProvider extends libPictProvider
1610
1610
  */
1611
1611
  resolveGitHubRepoURL(pGroup, pModule)
1612
1612
  {
1613
- if (!this._Catalog || !this._Catalog.Groups)
1613
+ if (!this._Catalog)
1614
+ {
1615
+ return null;
1616
+ }
1617
+
1618
+ // Module-mode catalog: a single Module field, Groups is empty. On a
1619
+ // per-module docs site the route handlers leave CurrentModule blank, so
1620
+ // pModule may be empty -- the single Module is the answer either way.
1621
+ if (this._Catalog.Module && this._Catalog.Module.Name && (!pModule || this._Catalog.Module.Name === pModule))
1622
+ {
1623
+ let tmpModuleModeModule = this._Catalog.Module;
1624
+ let tmpModuleModeOrg = tmpModuleModeModule.Org || this._Catalog.GitHubOrg || 'stevenvelozo';
1625
+ return 'https://github.com/' + tmpModuleModeOrg + '/' + (tmpModuleModeModule.Repo || tmpModuleModeModule.Name);
1626
+ }
1627
+
1628
+ if (!this._Catalog.Groups)
1614
1629
  {
1615
1630
  return null;
1616
1631
  }
@@ -121,12 +121,16 @@ class DocuserveTopBarUserView extends libPictView
121
121
  // per-module site, follows the current module on the aggregate).
122
122
  let tmpGroup = tmpDocuserve.CurrentGroup;
123
123
  let tmpModule = tmpDocuserve.CurrentModule;
124
- if (tmpGroup && tmpModule)
124
+ let tmpDocProvider = this.pict.providers['Docuserve-Documentation'];
125
+ // On a per-module (module-mode) site the route handlers leave
126
+ // CurrentModule blank; the single documented module lives on the catalog.
127
+ if ((!tmpModule) && tmpDocProvider && tmpDocProvider._Catalog && tmpDocProvider._Catalog.Module)
125
128
  {
126
- let tmpDocProvider = this.pict.providers['Docuserve-Documentation'];
127
- let tmpRepoURL = (tmpDocProvider && (typeof tmpDocProvider.resolveGitHubRepoURL === 'function'))
128
- ? tmpDocProvider.resolveGitHubRepoURL(tmpGroup, tmpModule)
129
- : null;
129
+ tmpModule = tmpDocProvider._Catalog.Module.Name;
130
+ }
131
+ if (tmpModule && tmpDocProvider && (typeof tmpDocProvider.resolveGitHubRepoURL === 'function'))
132
+ {
133
+ let tmpRepoURL = tmpDocProvider.resolveGitHubRepoURL(tmpGroup, tmpModule);
130
134
  if (tmpRepoURL)
131
135
  {
132
136
  let tmpIcon = this.pict.icon('GitHub', { class: 'docuserve-octocat', ariaLabel: 'View source on GitHub' });