docgen-tool 3.4.0 → 3.6.0

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 (35) hide show
  1. package/dist/include/require/styles/framework.css +214 -0
  2. package/dist/include/require/styles/framework.js +19 -0
  3. package/dist/include/templates/main.html +2 -76
  4. package/dist/include/templates/pdfCover.html +3 -118
  5. package/dist/include/templates/pdfFooter.html +1 -36
  6. package/dist/include/templates/pdfHeader.html +1 -14
  7. package/dist/package.json +6 -4
  8. package/dist/src/docgen/docgen.js +36 -61
  9. package/dist/src/docgen/fs/fs.js +9 -9
  10. package/dist/src/docgen/fs/markdown.js +11 -11
  11. package/dist/src/docgen/fs/meta.js +10 -7
  12. package/dist/src/docgen/fs/templates.js +13 -16
  13. package/dist/src/docgen/fs/write-pages.js +45 -34
  14. package/dist/src/docgen/meta/derive-parameters.js +29 -0
  15. package/dist/src/docgen/meta/sort-pages.js +26 -9
  16. package/dist/src/docgen/pdf/wkhtmltopdf/wkhtmltopdf.js +16 -16
  17. package/dist/src/docgen/scaffold/scaffold.js +2 -2
  18. package/dist/src/docgen/validation/validation.js +4 -3
  19. package/dist/src/docgen/views/components/copyright/copyright.js +17 -0
  20. package/dist/src/docgen/views/components/footer/footer.js +22 -0
  21. package/dist/src/docgen/views/components/logo/logo.js +12 -0
  22. package/dist/src/docgen/views/components/pdf-footer/pdf-footer.js +30 -0
  23. package/dist/src/docgen/views/components/pdf-header/pdf-header.js +14 -0
  24. package/dist/src/docgen/views/components/web-table-of-contents/web-table-of-contents.js +41 -0
  25. package/dist/src/docgen/views/html.js +11 -0
  26. package/dist/src/docgen/views/pages/cover/cover.js +71 -0
  27. package/dist/src/docgen/views/pages/cover/pdf-cover.js +21 -0
  28. package/dist/src/docgen/views/pages/main/main.js +59 -0
  29. package/dist/src/docgen/views/pages/process-pages.js +168 -0
  30. package/dist/src/docgen/{html → views}/redirect.js +9 -9
  31. package/package.json +6 -4
  32. package/dist/include/require/docgen.css +0 -136
  33. package/dist/include/templates/webCover.html +0 -73
  34. package/dist/src/docgen/html/process-pages.js +0 -287
  35. package/dist/src/docgen/html/web-table-of-contents.js +0 -51
@@ -1040,3 +1040,217 @@ button .icon svg,
1040
1040
  td.center {
1041
1041
  display: table-cell;
1042
1042
  }
1043
+
1044
+ #dg-coverInfo {
1045
+ margin-top: 100px;
1046
+ margin-bottom: 50px;
1047
+ width: 100%;
1048
+ }
1049
+
1050
+ #dg-coverInfo {
1051
+ border-collapse: separate; /*http://stackoverflow.com/questions/7625586/*/
1052
+ }
1053
+
1054
+ #dg-coverInfo th {
1055
+ background-color: rgb(46, 113, 225);
1056
+ color: white;
1057
+ font-size: 34px;
1058
+ padding: 20px;
1059
+ border: 1px solid rgb(46, 113, 225);
1060
+ border-radius: 10px 10px 0 0;
1061
+ }
1062
+
1063
+ #dg-coverInfo tr td {
1064
+ border-top: 2px solid rgb(46, 113, 225);
1065
+ border-left: 2px solid rgb(46, 113, 225);
1066
+ border-bottom: none;
1067
+ border-right: none;
1068
+ padding-top: 20px;
1069
+ padding-bottom: 20px;
1070
+ }
1071
+
1072
+ #dg-coverInfo td:last-child {
1073
+ border-right: 2px solid rgb(46, 113, 225);
1074
+ }
1075
+
1076
+ #dg-coverInfo .dg-finalRow td {
1077
+ border-bottom: 2px solid rgb(46, 113, 225);
1078
+ }
1079
+
1080
+ #dg-summary {
1081
+ margin-bottom: 100px;
1082
+ }
1083
+
1084
+ /*
1085
+ PDF header
1086
+ */
1087
+ #dg-pdf-header {
1088
+ text-align: right;
1089
+ }
1090
+
1091
+ /*
1092
+ PDF cover
1093
+ */
1094
+ #dg-pdfLogo {
1095
+ display: inline-block;
1096
+ float: right;
1097
+ }
1098
+
1099
+ #dg-pdf-cover-footer {
1100
+ width: 100%;
1101
+ text-align: center;
1102
+ }
1103
+
1104
+ /*
1105
+ PDF footer
1106
+ */
1107
+ #dg-pdf-footer {
1108
+ border-top: 1px solid #385691;
1109
+ padding-top: 10px;
1110
+ }
1111
+
1112
+ #dg-pdf-footer table {
1113
+ width: 100%;
1114
+ text-align: center;
1115
+ table-layout: fixed;
1116
+ word-wrap: break-word;
1117
+ }
1118
+
1119
+ #dg-pdf-footer a {
1120
+ text-decoration: none;
1121
+ color: #444;
1122
+ }
1123
+
1124
+ pre {
1125
+ font-size: 12px; /*todo - move to base styles*/
1126
+ }
1127
+
1128
+ section blockquote p,
1129
+ section li p {
1130
+ margin: 0;
1131
+ }
1132
+
1133
+ .w-table {
1134
+ width: 100%;
1135
+ }
1136
+
1137
+ /******************************** TABLE OF CONTENTS ****************************/
1138
+ /*Table of contents button to initiate show/hide*/
1139
+ #dg-navigator {
1140
+ float: right;
1141
+ background-color: rgb(26, 34, 49);
1142
+ color: white;
1143
+ text-align: right;
1144
+ padding: 10px 20px 10px 20px;
1145
+ margin-right: 200px;
1146
+ border-radius: 0 0 10px 10px;
1147
+ cursor: pointer;
1148
+ font-weight: bold;
1149
+ }
1150
+
1151
+ /*Table of contents container*/
1152
+ #dg-toc {
1153
+ color: white;
1154
+ background-color: rgb(26, 34, 49);
1155
+ }
1156
+
1157
+ #dg-toc table {
1158
+ table-layout: auto;
1159
+ width: 100%;
1160
+ }
1161
+
1162
+ #dg-toc div {
1163
+ padding: 15px 0 15px 0;
1164
+ }
1165
+
1166
+ /*Columns in table of contents*/
1167
+ #dg-toc td {
1168
+ border-right: 1px solid #666;
1169
+ vertical-align: top;
1170
+ text-align: left;
1171
+ padding: 0 20px 0 20px;
1172
+ }
1173
+
1174
+ #dg-toc ul {
1175
+ padding: 0;
1176
+ list-style-type: none;
1177
+ }
1178
+
1179
+ #dg-toc li {
1180
+ font-weight: bold;
1181
+ }
1182
+
1183
+ #dg-toc table td a {
1184
+ color: white;
1185
+ font-weight: normal;
1186
+ text-decoration: none;
1187
+ margin-left: 10px;
1188
+ }
1189
+
1190
+ #dg-toc table td a:hover {
1191
+ text-decoration: underline;
1192
+ }
1193
+
1194
+ #dg-tocFixedColumn {
1195
+ border-right: none;
1196
+ }
1197
+
1198
+ #dg-toc table #dg-tocFixedColumn a {
1199
+ vertical-align: middle;
1200
+ margin-left: 4px;
1201
+ }
1202
+
1203
+ .dg-tocGroup {
1204
+ width: 22%;
1205
+ }
1206
+
1207
+ .dg-tocHeading {
1208
+ font-size: 16px;
1209
+ }
1210
+
1211
+ .dg-tocIcon {
1212
+ width: 18px;
1213
+ height: 18px;
1214
+ float: left;
1215
+ }
1216
+
1217
+ .dg-tocIcon svg {
1218
+ fill: white;
1219
+ }
1220
+
1221
+ /*
1222
+ Page table of contents
1223
+ */
1224
+ .dg-pageToc {
1225
+ list-style: none;
1226
+ padding: 10px;
1227
+ border: 1px solid #999;
1228
+ background-color: #eee;
1229
+ }
1230
+
1231
+ /*
1232
+ Class to make a heading look invisible in web page, but still appear in the PDF table of contents
1233
+ - display:none, visibily: hidden, zero dimensions, and offscreen positioning don't work
1234
+ - so instead take it out of the flow and make it small and translucent
1235
+ */
1236
+ .dg-hiddenTitle {
1237
+ display: block;
1238
+ border: none;
1239
+ margin: 0;
1240
+ padding: 0;
1241
+ width: 1px;
1242
+ height: 1px;
1243
+ overflow: hidden;
1244
+ position: absolute;
1245
+ background-color: transparent;
1246
+ }
1247
+
1248
+ .dg-fakeHeading {
1249
+ text-decoration: none;
1250
+ font-weight: bold;
1251
+ color: #385691;
1252
+ border-bottom: 1px solid #999;
1253
+ margin: 20px 0 20px 0;
1254
+ font-size: 16px;
1255
+ padding-bottom: 4px;
1256
+ }
@@ -5418,3 +5418,22 @@ function svgInject() {
5418
5418
  });
5419
5419
  };
5420
5420
  }
5421
+
5422
+ $(document).ready(() => {
5423
+ $('#dg-toc').hide(); //hide the table of contents
5424
+
5425
+ //instantiate svg injector to show SVG icons
5426
+ const injector = new svgInject();
5427
+ injector.inject();
5428
+
5429
+ //code syntax highlighting
5430
+ $('pre code, .w-inline-code').each((i, block) => {
5431
+ hljs.highlightBlock(block);
5432
+ });
5433
+
5434
+ //toggle visibility of table of contents
5435
+ $('#dg-navigator').click(() => {
5436
+ $('#dg-toc').slideToggle('fast');
5437
+ $(this).toggleClass('active');
5438
+ });
5439
+ });
@@ -1,49 +1,17 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
- <meta http-equiv="X-UA-Compatible" content="IE=edge" ><!--Prevent IE using compatibility mode on local or intranet pages. Do not put scripts before this line.-->
5
- <meta name="viewport" content="width=device-width, user-scalable=yes"><!--Mobile device scaling-->
6
4
  <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, user-scalable=yes">
7
6
  <title></title>
8
7
 
9
- <!--load stylesheets first (rationale: https://developers.google.com/speed/docs/best-practices/rtt#PutStylesBeforeScripts)-->
10
8
  <link rel="stylesheet" href="require/styles/framework.css" type="text/css" />
11
9
  <link rel="stylesheet" href="require/styles/highlight.min.css" type="text/css" />
12
- <link rel="stylesheet" href="require/docgen.css" type="text/css" />
13
10
  <link rel="stylesheet" href="require/print.css" media="print" />
14
-
15
- <!--load scripts second-->
16
-
17
11
  <script src="require/styles/framework.js"></script>
18
12
  <script src="require/styles/framework.icons.js"></script>
19
13
  <script src="require/styles/highlight.min.js"></script>
20
14
 
21
- <!--inline scripts last-->
22
-
23
- <script type="text/javascript">
24
-
25
- $(document).ready( function () {
26
- $("#dg-toc").hide(); //hide the table of contents
27
-
28
- //instantiate an svg injector to show SVG icons
29
- var injector = new svgInject();
30
- injector.inject();
31
-
32
- //code syntax highlighting
33
- $('pre code, .w-inline-code').each(function(i, block) {
34
- hljs.highlightBlock(block);
35
- });
36
-
37
- //toggle visibility of table of contents
38
- $("#dg-navigator").click(function()
39
- {
40
- $("#dg-toc").slideToggle("fast");
41
- $(this).toggleClass("active");
42
- });
43
-
44
- });
45
- </script>
46
-
47
15
  <script type="text/x-mathjax-config">
48
16
  //MathJax configuration is the same as used by math.stackexchange.com
49
17
  MathJax.Hub.Config({"HTML-CSS": { preferredFont: "TeX", availableFonts: ["STIX","TeX"], linebreaks: { automatic:true }, EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50) },
@@ -54,47 +22,5 @@ MathJax.Hub.Config({"HTML-CSS": { preferredFont: "TeX", availableFonts: ["STIX",
54
22
  </script>
55
23
 
56
24
  </head>
57
-
58
- <body>
59
-
60
- <div id="dg-toc"></div>
61
- <div id="dg-navigator">Table of contents</div>
62
-
63
- <header>
64
- <div class="w-fixed-width header-container">
65
- <div class="header">
66
- <div class="headerLeftBlock">
67
- <a class="dg-homelink" href="#">
68
- <div id="dg-logo"></div>
69
- </a>
70
- <div id="headerLeftText">
71
- <a class="dg-homelink" href="#">
72
- <span id="dg-title"></span> <span id="dg-web-title-version" style="font-weight:normal;"></span>
73
- </a>
74
- </div>
75
- </div>
76
- <div id="headerRightBlock">
77
- <span id="dg-backlink"></span>
78
- </div>
79
- </div>
80
- </div>
81
- </header>
82
-
83
- <section id="dg-content">
84
-
85
- </section>
86
-
87
- <footer>
88
- <div><p class="w-fixed-width"><span id="dg-web-footer">.</p></div>
89
- <div class="w-fixed-width">
90
- <p><span id="dg-copyright"></span></p>
91
- <p>
92
- <span id="dg-marking"></span>
93
- <span id="dg-legalese"></span>
94
- <span id="dg-attribution"></span>
95
- </p>
96
- </div>
97
- </footer>
98
-
99
- </body>
25
+ <body></body>
100
26
  </html>
@@ -1,128 +1,13 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
- <meta http-equiv="X-UA-Compatible" content="IE=edge" ><!--Prevent IE using compatibility mode on local or intranet pages. Do not put scripts before this line.-->
5
- <meta name="viewport" content="width=device-width, user-scalable=yes"><!--Mobile device scaling-->
6
4
  <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, user-scalable=yes">
7
6
  <title>DocGen</title>
8
7
 
9
- <!--load stylesheets first (rationale: https://developers.google.com/speed/docs/best-practices/rtt#PutStylesBeforeScripts)-->
10
8
  <link rel="stylesheet" href="../require/styles/framework.css" type="text/css" />
11
- <link rel="stylesheet" href="../require/docgen.css" type="text/css" />
12
9
  <link rel="stylesheet" href="../require/print.css" media="print" />
13
10
 
14
- <style>
15
-
16
- html {
17
- background: none;
18
- min-height: 100%;
19
- }
20
-
21
- #dg-pdfLogo {
22
- display: inline-block;
23
- float: right;
24
-
25
- }
26
-
27
- #dg-coverInfo {
28
- margin-top: 100px;
29
- margin-bottom: 50px;
30
- width: 100%;
31
- }
32
-
33
- #dg-coverInfo {
34
- border-collapse: separate; /*http://stackoverflow.com/questions/7625586/*/
35
- }
36
-
37
- #dg-coverInfo th {
38
- background-color: rgb(46, 113, 225);
39
- color: white;
40
- font-size: 34px;
41
- padding: 20px;
42
- border: 1px solid rgb(46, 113, 225);
43
- border-radius: 10px 10px 0 0;
44
- }
45
-
46
- #dg-coverInfo tr td {
47
- border-top: 2px solid rgb(46, 113, 225);
48
- border-left: 2px solid rgb(46, 113, 225);
49
- border-bottom: none;
50
- border-right: none;
51
- padding-top: 20px;
52
- padding-bottom: 20px;
53
- }
54
-
55
- #dg-coverInfo td:last-child {
56
- border-right: 2px solid rgb(46, 113, 225);
57
- }
58
-
59
- #dg-coverInfo .dg-finalRow td {
60
- border-bottom: 2px solid rgb(46, 113, 225);
61
- }
62
-
63
- #dg-summary {
64
- margin-bottom: 100px;
65
- }
66
-
67
- #dg-footer {
68
- /*position: fixed;*/
69
- /*bottom: 0px;*/
70
- width: 100%;
71
- text-align: center;
72
- }
73
-
74
- #footnote {
75
- font-size: 9px;
76
- }
77
-
78
-
79
- </style>
80
-
81
- <script src="../require/styles/framework.js"></script>
82
-
83
- </head>
84
- <body>
85
-
86
- <div class="w-clear-after"><div id="dg-pdfLogo"><img src="../files/images/logo.svg" /></div></div>
87
-
88
- <table class="w-table w-fixed" id="dg-coverInfo">
89
- <thead>
90
- <tr>
91
- <th colspan="3" id="dg-title"></th>
92
- </tr>
93
- </thead>
94
- <tfoot>
95
- </tfoot>
96
- <tbody>
97
- <tr>
98
- <td><strong>Owner: </strong> <span id="dg-owner"></span></td>
99
- <td><strong>Version: </strong> <span id="dg-version"></span></td>
100
- <td><strong>Released: </strong> <span id="dg-release-date"></span></td>
101
- </tr>
102
- <tr>
103
- <td><strong>Author: </strong> <span id="dg-author"></span></td>
104
- <td colspan="2"><strong>Contributors: </strong> <span id="dg-contributors"></span></td>
105
- </tr>
106
- <tr class="dg-finalRow">
107
- <td><strong>Module: </strong> <span id="dg-module"></span></td>
108
- <td><strong>ID: </strong> <span id="dg-id"></span></td>
109
- <td><strong>Link: </strong> <span id="dg-website"></span></td>
110
- </tr>
111
- <tr>
112
- </tbody>
113
- </table>
114
-
115
- <h1>Summary</h1>
116
- <p id="dg-summary"></p>
117
-
118
- <div id="dg-footer">
119
- <p><span id="dg-copyright"></span></p>
120
- <p id="footnote">
121
- <span id="dg-marking"></span>
122
- <span id="dg-legalese"></span>
123
- <span id="dg-attribution"></span>
124
- </p>
125
- </div>
126
-
127
- </body>
11
+ <script src="../require/styles/framework.js"></script>
12
+ </head>
128
13
  </html>
@@ -3,31 +3,9 @@
3
3
  <head>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
  <link rel="stylesheet" href="../require/styles/framework.css" type="text/css" />
6
- <link rel="stylesheet" href="../require/docgen.css" type="text/css" />
7
6
  <link rel="stylesheet" href="../require/print.css" media="print" />
8
7
 
9
- <style>
10
-
11
- #dg-footer {
12
- border-top: 1px solid #385691;
13
- padding-top: 10px;
14
- }
15
-
16
- #dg-footer table {
17
- width: 100%;
18
- text-align: center;
19
- table-layout: fixed;
20
- word-wrap: break-word;
21
- }
22
-
23
- a {
24
- text-decoration: none;
25
- color: #444;
26
- }
27
-
28
- </style>
29
-
30
- <script> /*from wkhtmltopdf documenation - substitutes in parameters like page numbers at runtime*/
8
+ <script> /*from wkhtmltopdf documentation - substitutes in parameters like page numbers at runtime*/
31
9
  function subst() {
32
10
  var vars={};
33
11
  var x=document.location.search.substring(1).split('&');
@@ -42,18 +20,5 @@ function subst() {
42
20
 
43
21
  </head>
44
22
  <body onload="subst()">
45
-
46
- <div id="dg-footer">
47
- <table><thead></thead><tfoot></tfoot><tbody>
48
- <tr>
49
- <td><span id="dg-title"></span> <span id="dg-web-title-version"></span></td>
50
- <td><span id="dg-copyright"></span></td>
51
- <td>Page <span class="page"></span> of <span class="topage"></span></td>
52
- </tr>
53
- </tbody></table>
54
- </div>
55
-
56
23
  </body>
57
24
  </html>
58
-
59
-
@@ -1,21 +1,8 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
-
5
4
  <link rel="stylesheet" href="../require/styles/framework.css" type="text/css" />
6
- <link rel="stylesheet" href="../require/docgen.css" type="text/css" />
7
5
  <link rel="stylesheet" href="../require/print.css" media="print" />
8
-
9
- <style>
10
- #dg-header {
11
- text-align:right;
12
- }
13
-
14
- </style>
15
6
  </head>
16
- <body>
17
- <div id="dg-header">
18
- <img src="../files/images/logo.svg" />
19
- </div>
20
- </body>
7
+ <body />
21
8
  </html>
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docgen-tool",
3
- "version": "3.4.0",
3
+ "version": "3.6.0",
4
4
  "description": "A tool for creating HTML and PDF documentation",
5
5
  "main": "dist/docgen.ts",
6
6
  "bin": {
@@ -34,21 +34,23 @@
34
34
  "docgen": "prettier --write"
35
35
  },
36
36
  "dependencies": {
37
- "chalk": "^4.1.0",
38
37
  "cheerio": "^1.0.0-rc.12",
39
38
  "cli-spinner": "^0.2.10",
40
39
  "commander": "^11.0.0",
41
40
  "fs-extra": "^11.1.1",
42
41
  "husky": "^4.3.0",
43
- "image-size": "^1.0.2",
44
42
  "lint-staged": "^10.5.1",
43
+ "lodash": "^4.17.21",
45
44
  "markdown-it": "^13.0.1",
46
- "moment": "^2.29.4",
45
+ "picocolors": "^1.0.0",
46
+ "react": "^18.2.0",
47
+ "react-dom": "^18.2.0",
47
48
  "spawn-args": "^0.2.0",
48
49
  "z-schema": "^6.0.1"
49
50
  },
50
51
  "devDependencies": {
51
52
  "@types/node": "^20.3.1",
53
+ "@types/react": "^18.2.37",
52
54
  "eslint": "^8.43.0",
53
55
  "eslint-config-prettier": "^8.8.0",
54
56
  "ncp": "^2.0.0",