pict-docuserve 0.0.1

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.
Files changed (36) hide show
  1. package/LICENSE +21 -0
  2. package/build-site.js +172 -0
  3. package/css/docuserve.css +73 -0
  4. package/dist/css/docuserve.css +73 -0
  5. package/dist/index.html +32 -0
  6. package/dist/js/pict.compatible.js +7793 -0
  7. package/dist/js/pict.compatible.js.map +1 -0
  8. package/dist/js/pict.compatible.min.js +12 -0
  9. package/dist/js/pict.compatible.min.js.map +1 -0
  10. package/dist/js/pict.js +7792 -0
  11. package/dist/js/pict.js.map +1 -0
  12. package/dist/js/pict.min.js +12 -0
  13. package/dist/js/pict.min.js.map +1 -0
  14. package/dist/pict-docuserve.compatible.js +5148 -0
  15. package/dist/pict-docuserve.compatible.js.map +1 -0
  16. package/dist/pict-docuserve.compatible.min.js +2 -0
  17. package/dist/pict-docuserve.compatible.min.js.map +1 -0
  18. package/dist/pict-docuserve.js +4670 -0
  19. package/dist/pict-docuserve.js.map +1 -0
  20. package/dist/pict-docuserve.min.js +2 -0
  21. package/dist/pict-docuserve.min.js.map +1 -0
  22. package/html/index.html +32 -0
  23. package/package.json +52 -0
  24. package/source/Pict-Application-Docuserve-Configuration.json +15 -0
  25. package/source/Pict-Application-Docuserve.js +246 -0
  26. package/source/cli/Docuserve-CLI-Program.js +16 -0
  27. package/source/cli/Docuserve-CLI-Run.js +3 -0
  28. package/source/cli/commands/Docuserve-Command-Inject.js +127 -0
  29. package/source/cli/commands/Docuserve-Command-Serve.js +135 -0
  30. package/source/providers/Pict-Provider-Docuserve-Documentation.js +1156 -0
  31. package/source/providers/PictRouter-Docuserve-Configuration.json +26 -0
  32. package/source/views/PictView-Docuserve-Content.js +208 -0
  33. package/source/views/PictView-Docuserve-Layout.js +105 -0
  34. package/source/views/PictView-Docuserve-Sidebar.js +362 -0
  35. package/source/views/PictView-Docuserve-Splash.js +264 -0
  36. package/source/views/PictView-Docuserve-TopBar.js +213 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Steven Velozo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/build-site.js ADDED
@@ -0,0 +1,172 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * build-site.js
4
+ *
5
+ * Assembles the pict-docuserve dist output together with the retold documentation
6
+ * content into a single folder suitable for GitHub Pages deployment.
7
+ *
8
+ * Usage:
9
+ * node build-site.js [--docs-path PATH] [--output-path PATH]
10
+ *
11
+ * Defaults:
12
+ * --docs-path ../../../docs (the retold /docs/ folder)
13
+ * --output-path ./site (output folder)
14
+ */
15
+ 'use strict';
16
+
17
+ const libFS = require('fs');
18
+ const libPath = require('path');
19
+
20
+ // ---------------------------------------------------------------------------
21
+ // Parse arguments
22
+ // ---------------------------------------------------------------------------
23
+ let tmpDocsPath = libPath.resolve(__dirname, '..', '..', '..', 'docs');
24
+ let tmpOutputPath = libPath.resolve(__dirname, 'site');
25
+ let tmpDistPath = libPath.resolve(__dirname, 'dist');
26
+
27
+ let tmpArgs = process.argv.slice(2);
28
+ for (let i = 0; i < tmpArgs.length; i++)
29
+ {
30
+ if (tmpArgs[i] === '--docs-path' && tmpArgs[i + 1])
31
+ {
32
+ tmpDocsPath = libPath.resolve(tmpArgs[i + 1]);
33
+ i++;
34
+ }
35
+ else if (tmpArgs[i] === '--output-path' && tmpArgs[i + 1])
36
+ {
37
+ tmpOutputPath = libPath.resolve(tmpArgs[i + 1]);
38
+ i++;
39
+ }
40
+ }
41
+
42
+ // ---------------------------------------------------------------------------
43
+ // Helpers
44
+ // ---------------------------------------------------------------------------
45
+
46
+ /**
47
+ * Recursively create a directory if it does not exist.
48
+ */
49
+ function ensureDir(pPath)
50
+ {
51
+ if (!libFS.existsSync(pPath))
52
+ {
53
+ libFS.mkdirSync(pPath, { recursive: true });
54
+ }
55
+ }
56
+
57
+ /**
58
+ * Recursively copy a directory's contents into a destination.
59
+ */
60
+ function copyDir(pSource, pDest)
61
+ {
62
+ ensureDir(pDest);
63
+ let tmpEntries = libFS.readdirSync(pSource, { withFileTypes: true });
64
+
65
+ for (let i = 0; i < tmpEntries.length; i++)
66
+ {
67
+ let tmpEntry = tmpEntries[i];
68
+ let tmpSourcePath = libPath.join(pSource, tmpEntry.name);
69
+ let tmpDestPath = libPath.join(pDest, tmpEntry.name);
70
+
71
+ if (tmpEntry.isDirectory())
72
+ {
73
+ copyDir(tmpSourcePath, tmpDestPath);
74
+ }
75
+ else
76
+ {
77
+ libFS.copyFileSync(tmpSourcePath, tmpDestPath);
78
+ }
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Copy a single file, creating parent directories as needed.
84
+ */
85
+ function copyFile(pSource, pDest)
86
+ {
87
+ ensureDir(libPath.dirname(pDest));
88
+ libFS.copyFileSync(pSource, pDest);
89
+ }
90
+
91
+ // ---------------------------------------------------------------------------
92
+ // Validate inputs
93
+ // ---------------------------------------------------------------------------
94
+ if (!libFS.existsSync(tmpDistPath))
95
+ {
96
+ console.error('Error: dist/ folder not found. Run `npm run build` first.');
97
+ process.exit(1);
98
+ }
99
+
100
+ if (!libFS.existsSync(tmpDocsPath))
101
+ {
102
+ console.error('Error: docs folder not found at ' + tmpDocsPath);
103
+ console.error('Use --docs-path to specify the retold docs/ folder location.');
104
+ process.exit(1);
105
+ }
106
+
107
+ // ---------------------------------------------------------------------------
108
+ // Assemble the site
109
+ // ---------------------------------------------------------------------------
110
+ console.log('Assembling site...');
111
+ console.log(' dist: ' + tmpDistPath);
112
+ console.log(' docs: ' + tmpDocsPath);
113
+ console.log(' output: ' + tmpOutputPath);
114
+
115
+ // Clean and create output directory
116
+ if (libFS.existsSync(tmpOutputPath))
117
+ {
118
+ libFS.rmSync(tmpOutputPath, { recursive: true, force: true });
119
+ }
120
+ ensureDir(tmpOutputPath);
121
+
122
+ // 1. Copy the entire dist/ folder contents as the base
123
+ console.log(' Copying dist/ build artifacts...');
124
+ copyDir(tmpDistPath, tmpOutputPath);
125
+
126
+ // 2. Copy markdown content files from docs/
127
+ console.log(' Copying documentation markdown files...');
128
+ let tmpDocsEntries = libFS.readdirSync(tmpDocsPath, { withFileTypes: true });
129
+ let tmpCopiedFiles = [];
130
+
131
+ for (let i = 0; i < tmpDocsEntries.length; i++)
132
+ {
133
+ let tmpEntry = tmpDocsEntries[i];
134
+ let tmpSourcePath = libPath.join(tmpDocsPath, tmpEntry.name);
135
+ let tmpDestPath = libPath.join(tmpOutputPath, tmpEntry.name);
136
+
137
+ // Copy markdown files (including cover.md and _sidebar.md which drive the splash and sidebar views)
138
+ if (tmpEntry.isFile() && tmpEntry.name.match(/\.md$/))
139
+ {
140
+ copyFile(tmpSourcePath, tmpDestPath);
141
+ tmpCopiedFiles.push(tmpEntry.name);
142
+ }
143
+
144
+ // Copy the catalog JSON
145
+ if (tmpEntry.isFile() && tmpEntry.name === 'retold-catalog.json')
146
+ {
147
+ copyFile(tmpSourcePath, tmpDestPath);
148
+ tmpCopiedFiles.push(tmpEntry.name);
149
+ }
150
+
151
+ // Copy the keyword index if it exists (for future search support)
152
+ if (tmpEntry.isFile() && tmpEntry.name === 'retold-keyword-index.json')
153
+ {
154
+ copyFile(tmpSourcePath, tmpDestPath);
155
+ tmpCopiedFiles.push(tmpEntry.name);
156
+ }
157
+ }
158
+
159
+ // 3. Create .nojekyll for GitHub Pages
160
+ console.log(' Creating .nojekyll marker...');
161
+ libFS.writeFileSync(libPath.join(tmpOutputPath, '.nojekyll'), '');
162
+
163
+ // 4. Report
164
+ console.log('');
165
+ console.log('Site assembled successfully!');
166
+ console.log(' Files copied from docs/: ' + tmpCopiedFiles.join(', '));
167
+ console.log(' Output: ' + tmpOutputPath);
168
+ console.log('');
169
+ console.log('To preview locally:');
170
+ console.log(' npx http-server ' + tmpOutputPath);
171
+ console.log('');
172
+ console.log('To deploy to GitHub Pages, push the contents of ' + tmpOutputPath + '/ to your gh-pages branch.');
@@ -0,0 +1,73 @@
1
+ /* ============================================================================
2
+ Pict Docuserve - Base Styles
3
+ ============================================================================ */
4
+
5
+ /* Reset and base */
6
+ *, *::before, *::after {
7
+ box-sizing: border-box;
8
+ }
9
+
10
+ html, body {
11
+ margin: 0;
12
+ padding: 0;
13
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
14
+ font-size: 16px;
15
+ line-height: 1.5;
16
+ color: #333;
17
+ background-color: #fff;
18
+ -webkit-font-smoothing: antialiased;
19
+ -moz-osx-font-smoothing: grayscale;
20
+ }
21
+
22
+ /* Typography */
23
+ h1, h2, h3, h4, h5, h6 {
24
+ margin-top: 0;
25
+ line-height: 1.3;
26
+ }
27
+
28
+ a {
29
+ color: #42b983;
30
+ text-decoration: none;
31
+ }
32
+
33
+ a:hover {
34
+ color: #38a373;
35
+ }
36
+
37
+ /* Application container */
38
+ #Docuserve-Application-Container {
39
+ min-height: 100vh;
40
+ }
41
+
42
+ /* Utility: scrollbar styling */
43
+ ::-webkit-scrollbar {
44
+ width: 8px;
45
+ }
46
+
47
+ ::-webkit-scrollbar-track {
48
+ background: #f1f1f1;
49
+ }
50
+
51
+ ::-webkit-scrollbar-thumb {
52
+ background: #bdc3c7;
53
+ border-radius: 4px;
54
+ }
55
+
56
+ ::-webkit-scrollbar-thumb:hover {
57
+ background: #95a5a6;
58
+ }
59
+
60
+ /* Responsive adjustments */
61
+ @media (max-width: 768px) {
62
+ html {
63
+ font-size: 14px;
64
+ }
65
+
66
+ #Docuserve-Sidebar-Container {
67
+ display: none;
68
+ }
69
+
70
+ .docuserve-body {
71
+ flex-direction: column;
72
+ }
73
+ }
@@ -0,0 +1,73 @@
1
+ /* ============================================================================
2
+ Pict Docuserve - Base Styles
3
+ ============================================================================ */
4
+
5
+ /* Reset and base */
6
+ *, *::before, *::after {
7
+ box-sizing: border-box;
8
+ }
9
+
10
+ html, body {
11
+ margin: 0;
12
+ padding: 0;
13
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
14
+ font-size: 16px;
15
+ line-height: 1.5;
16
+ color: #333;
17
+ background-color: #fff;
18
+ -webkit-font-smoothing: antialiased;
19
+ -moz-osx-font-smoothing: grayscale;
20
+ }
21
+
22
+ /* Typography */
23
+ h1, h2, h3, h4, h5, h6 {
24
+ margin-top: 0;
25
+ line-height: 1.3;
26
+ }
27
+
28
+ a {
29
+ color: #42b983;
30
+ text-decoration: none;
31
+ }
32
+
33
+ a:hover {
34
+ color: #38a373;
35
+ }
36
+
37
+ /* Application container */
38
+ #Docuserve-Application-Container {
39
+ min-height: 100vh;
40
+ }
41
+
42
+ /* Utility: scrollbar styling */
43
+ ::-webkit-scrollbar {
44
+ width: 8px;
45
+ }
46
+
47
+ ::-webkit-scrollbar-track {
48
+ background: #f1f1f1;
49
+ }
50
+
51
+ ::-webkit-scrollbar-thumb {
52
+ background: #bdc3c7;
53
+ border-radius: 4px;
54
+ }
55
+
56
+ ::-webkit-scrollbar-thumb:hover {
57
+ background: #95a5a6;
58
+ }
59
+
60
+ /* Responsive adjustments */
61
+ @media (max-width: 768px) {
62
+ html {
63
+ font-size: 14px;
64
+ }
65
+
66
+ #Docuserve-Sidebar-Container {
67
+ display: none;
68
+ }
69
+
70
+ .docuserve-body {
71
+ flex-direction: column;
72
+ }
73
+ }
@@ -0,0 +1,32 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7
+ <meta name="description" content="Retold Documentation - A suite of JavaScript/Node.js modules for building web applications and APIs">
8
+
9
+ <title>Retold Documentation</title>
10
+
11
+ <!-- Application Stylesheet -->
12
+ <link href="css/docuserve.css" rel="stylesheet">
13
+ <!-- PICT Dynamic View CSS Container -->
14
+ <style id="PICT-CSS"></style>
15
+
16
+ <!-- Load the PICT library -->
17
+ <script src="./js/pict.min.js" type="text/javascript"></script>
18
+ <!-- Bootstrap the Application -->
19
+ <script type="text/javascript">
20
+ //<![CDATA[
21
+ Pict.safeOnDocumentReady(() => { Pict.safeLoadPictApplication(PictDocuserve, 2)});
22
+ //]]>
23
+ </script>
24
+ </head>
25
+ <body>
26
+ <!-- The root container for the Pict application -->
27
+ <div id="Docuserve-Application-Container"></div>
28
+
29
+ <!-- Load the Docuserve PICT Application Bundle -->
30
+ <script src="./pict-docuserve.min.js" type="text/javascript"></script>
31
+ </body>
32
+ </html>