docgen-tool 3.5.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.
- package/dist/include/require/styles/framework.css +214 -0
- package/dist/include/require/styles/framework.js +19 -0
- package/dist/include/templates/main.html +1 -34
- package/dist/include/templates/pdfCover.html +4 -71
- package/dist/include/templates/pdfFooter.html +0 -22
- package/dist/include/templates/pdfHeader.html +1 -14
- package/dist/package.json +1 -1
- package/dist/src/docgen/fs/templates.js +7 -10
- package/dist/src/docgen/views/components/logo/logo.js +12 -0
- package/dist/src/docgen/views/components/pdf-footer/pdf-footer.js +1 -1
- package/dist/src/docgen/views/components/pdf-header/pdf-header.js +14 -0
- package/dist/src/docgen/views/pages/cover/pdf-cover.js +3 -6
- package/dist/src/docgen/views/pages/process-pages.js +7 -9
- package/package.json +1 -1
- package/dist/include/require/docgen.css +0 -136
- package/dist/include/templates/webCover.html +0 -43
|
@@ -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,50 +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
|
-
console.log('navigator click');
|
|
41
|
-
$("#dg-toc").slideToggle("fast");
|
|
42
|
-
$(this).toggleClass("active");
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
</script>
|
|
47
|
-
|
|
48
15
|
<script type="text/x-mathjax-config">
|
|
49
16
|
//MathJax configuration is the same as used by math.stackexchange.com
|
|
50
17
|
MathJax.Hub.Config({"HTML-CSS": { preferredFont: "TeX", availableFonts: ["STIX","TeX"], linebreaks: { automatic:true }, EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50) },
|
|
@@ -1,80 +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
|
-
<
|
|
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
|
-
#dg-coverInfo {
|
|
27
|
-
margin-top: 100px;
|
|
28
|
-
margin-bottom: 50px;
|
|
29
|
-
width: 100%;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
#dg-coverInfo {
|
|
33
|
-
border-collapse: separate; /*http://stackoverflow.com/questions/7625586/*/
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
#dg-coverInfo th {
|
|
37
|
-
background-color: rgb(46, 113, 225);
|
|
38
|
-
color: white;
|
|
39
|
-
font-size: 34px;
|
|
40
|
-
padding: 20px;
|
|
41
|
-
border: 1px solid rgb(46, 113, 225);
|
|
42
|
-
border-radius: 10px 10px 0 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
#dg-coverInfo tr td {
|
|
46
|
-
border-top: 2px solid rgb(46, 113, 225);
|
|
47
|
-
border-left: 2px solid rgb(46, 113, 225);
|
|
48
|
-
border-bottom: none;
|
|
49
|
-
border-right: none;
|
|
50
|
-
padding-top: 20px;
|
|
51
|
-
padding-bottom: 20px;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
#dg-coverInfo td:last-child {
|
|
55
|
-
border-right: 2px solid rgb(46, 113, 225);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
#dg-coverInfo .dg-finalRow td {
|
|
59
|
-
border-bottom: 2px solid rgb(46, 113, 225);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
#dg-summary {
|
|
63
|
-
margin-bottom: 100px;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
#dg-footer {
|
|
67
|
-
/*position: fixed;*/
|
|
68
|
-
/*bottom: 0px;*/
|
|
69
|
-
width: 100%;
|
|
70
|
-
text-align: center;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
#footnote {
|
|
74
|
-
font-size: 9px;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
</style>
|
|
78
|
-
|
|
79
|
-
<script src="../require/styles/framework.js"></script>
|
|
80
|
-
|
|
11
|
+
<script src="../require/styles/framework.js"></script>
|
|
12
|
+
</head>
|
|
13
|
+
</html>
|
|
@@ -3,30 +3,8 @@
|
|
|
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
8
|
<script> /*from wkhtmltopdf documentation - substitutes in parameters like page numbers at runtime*/
|
|
31
9
|
function subst() {
|
|
32
10
|
var vars={};
|
|
@@ -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
|
@@ -55,7 +55,7 @@ var loadTemplates = function (_a) {
|
|
|
55
55
|
console.log(picocolors_1.default.green('Loading templates'));
|
|
56
56
|
_c.label = 1;
|
|
57
57
|
case 1:
|
|
58
|
-
_c.trys.push([1,
|
|
58
|
+
_c.trys.push([1, 7, , 8]);
|
|
59
59
|
_b = {};
|
|
60
60
|
return [4 /*yield*/, (0, fs_1.readFile)(__dirname + '/../../include/templates/main.html')];
|
|
61
61
|
case 2:
|
|
@@ -63,17 +63,14 @@ var loadTemplates = function (_a) {
|
|
|
63
63
|
return [4 /*yield*/, (0, fs_1.readFile)(__dirname + '/../../include/templates/redirect.html')];
|
|
64
64
|
case 3:
|
|
65
65
|
_b.redirect = _c.sent();
|
|
66
|
-
return [4 /*yield*/, (0, fs_1.readFile)(__dirname + '/../../include/templates/webCover.html')];
|
|
67
|
-
case 4:
|
|
68
|
-
_b.webCover = _c.sent();
|
|
69
66
|
return [4 /*yield*/, (0, fs_1.readFile)(__dirname + '/../../include/templates/pdfCover.html')];
|
|
70
|
-
case
|
|
67
|
+
case 4:
|
|
71
68
|
_b.pdfCover = _c.sent();
|
|
72
69
|
return [4 /*yield*/, (0, fs_1.readFile)(__dirname + '/../../include/templates/pdfHeader.html')];
|
|
73
|
-
case
|
|
70
|
+
case 5:
|
|
74
71
|
_b.pdfHeader = _c.sent();
|
|
75
72
|
return [4 /*yield*/, (0, fs_1.readFile)(__dirname + '/../../include/templates/pdfFooter.html')];
|
|
76
|
-
case
|
|
73
|
+
case 6:
|
|
77
74
|
files = (_b.pdfFooter = _c.sent(),
|
|
78
75
|
_b);
|
|
79
76
|
for (key in files) {
|
|
@@ -84,15 +81,15 @@ var loadTemplates = function (_a) {
|
|
|
84
81
|
}
|
|
85
82
|
}
|
|
86
83
|
return [2 /*return*/, templates];
|
|
87
|
-
case
|
|
84
|
+
case 7:
|
|
88
85
|
error_1 = _c.sent();
|
|
89
86
|
console.log(picocolors_1.default.red('Error loading templates'));
|
|
90
87
|
if (options.verbose === true) {
|
|
91
88
|
console.log(picocolors_1.default.red(error_1));
|
|
92
89
|
}
|
|
93
90
|
mainProcess.exit(1);
|
|
94
|
-
return [3 /*break*/,
|
|
95
|
-
case
|
|
91
|
+
return [3 /*break*/, 8];
|
|
92
|
+
case 8: return [2 /*return*/];
|
|
96
93
|
}
|
|
97
94
|
});
|
|
98
95
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Logo = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var Logo = function (_a) {
|
|
9
|
+
var parameters = _a.parameters;
|
|
10
|
+
return ((parameters === null || parameters === void 0 ? void 0 : parameters.logoPath) && (react_1.default.createElement("img", { src: "../".concat(parameters === null || parameters === void 0 ? void 0 : parameters.logoPath) })));
|
|
11
|
+
};
|
|
12
|
+
exports.Logo = Logo;
|
|
@@ -8,7 +8,7 @@ var react_1 = __importDefault(require("react"));
|
|
|
8
8
|
var copyright_1 = require("../copyright/copyright");
|
|
9
9
|
var PdfFooter = function (_a) {
|
|
10
10
|
var parameters = _a.parameters;
|
|
11
|
-
return (react_1.default.createElement("div", { id: "dg-footer" },
|
|
11
|
+
return (react_1.default.createElement("div", { id: "dg-pdf-footer" },
|
|
12
12
|
react_1.default.createElement("table", null,
|
|
13
13
|
react_1.default.createElement("thead", null),
|
|
14
14
|
react_1.default.createElement("tfoot", null),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PdfHeader = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var logo_1 = require("../logo/logo");
|
|
9
|
+
var PdfHeader = function (_a) {
|
|
10
|
+
var parameters = _a.parameters;
|
|
11
|
+
return (react_1.default.createElement("div", { id: "dg-pdf-header" },
|
|
12
|
+
react_1.default.createElement(logo_1.Logo, { parameters: parameters })));
|
|
13
|
+
};
|
|
14
|
+
exports.PdfHeader = PdfHeader;
|
|
@@ -6,19 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.PdfCover = void 0;
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
8
|
var cover_1 = require("./cover");
|
|
9
|
+
var logo_1 = require("../../components/logo/logo");
|
|
9
10
|
var footer_1 = require("../../components/footer/footer");
|
|
10
|
-
var Logo = function (_a) {
|
|
11
|
-
var parameters = _a.parameters;
|
|
12
|
-
return ((parameters === null || parameters === void 0 ? void 0 : parameters.logoPath) && (react_1.default.createElement("img", { src: "../".concat(parameters === null || parameters === void 0 ? void 0 : parameters.logoPath) })));
|
|
13
|
-
};
|
|
14
11
|
var PdfCover = function (_a) {
|
|
15
12
|
var parameters = _a.parameters;
|
|
16
13
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
17
14
|
react_1.default.createElement("div", { className: "w-clear-after" },
|
|
18
15
|
react_1.default.createElement("div", { id: "dg-pdfLogo" },
|
|
19
|
-
react_1.default.createElement(Logo, { parameters: parameters }))),
|
|
16
|
+
react_1.default.createElement(logo_1.Logo, { parameters: parameters }))),
|
|
20
17
|
react_1.default.createElement(cover_1.Cover, { parameters: parameters }),
|
|
21
|
-
react_1.default.createElement("div", { id: "dg-footer" },
|
|
18
|
+
react_1.default.createElement("div", { id: "dg-pdf-cover-footer" },
|
|
22
19
|
react_1.default.createElement(footer_1.Footer, { parameters: parameters }))));
|
|
23
20
|
};
|
|
24
21
|
exports.PdfCover = PdfCover;
|
|
@@ -48,6 +48,7 @@ var main_1 = require("./main/main");
|
|
|
48
48
|
var cover_1 = require("./cover/cover");
|
|
49
49
|
var html_1 = require("../html");
|
|
50
50
|
var pdf_cover_1 = require("./cover/pdf-cover");
|
|
51
|
+
var pdf_header_1 = require("../components/pdf-header/pdf-header");
|
|
51
52
|
var pdf_footer_1 = require("../components/pdf-footer/pdf-footer");
|
|
52
53
|
var processTemplates = function (_a) {
|
|
53
54
|
var parameters = _a.parameters, mathMathjax = _a.mathMathjax, mathKatex = _a.mathKatex, rawTemplates = _a.templates;
|
|
@@ -81,7 +82,7 @@ exports.processTemplates = processTemplates;
|
|
|
81
82
|
var processPages = function (_a) {
|
|
82
83
|
var templates = _a.templates, rawPages = _a.pages, sortedPages = _a.sortedPages, parameters = _a.parameters, options = _a.options, contents = _a.contents;
|
|
83
84
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
84
|
-
var hydratedTemplates, pages, pageTableOfContentsEnabled, tableOfContents, mainTemplate, pdfCoverTemplate,
|
|
85
|
+
var hydratedTemplates, pages, pageTableOfContentsEnabled, tableOfContents, mainTemplate, pdfCoverTemplate, pdfHeaderTemplate, pdfFooterTemplate, pdfEnabled, webCoverHtml, $, pdfCoverHtml, $Pdf, pdfHeaderHtml, $PdfHeader, pdfFooterHtml, $PdfFooter;
|
|
85
86
|
return __generator(this, function (_b) {
|
|
86
87
|
hydratedTemplates = (0, exports.processTemplates)({
|
|
87
88
|
parameters: parameters,
|
|
@@ -94,8 +95,8 @@ var processPages = function (_a) {
|
|
|
94
95
|
tableOfContents = contents;
|
|
95
96
|
mainTemplate = hydratedTemplates.main;
|
|
96
97
|
pdfCoverTemplate = hydratedTemplates.pdfCover;
|
|
98
|
+
pdfHeaderTemplate = hydratedTemplates.pdfHeader;
|
|
97
99
|
pdfFooterTemplate = hydratedTemplates.pdfFooter;
|
|
98
|
-
webCover = hydratedTemplates.webCover;
|
|
99
100
|
pdfEnabled = options.pdf;
|
|
100
101
|
console.log(picocolors_1.default.green('Generating the static web content'));
|
|
101
102
|
tableOfContents.forEach(function (section) {
|
|
@@ -143,25 +144,22 @@ var processPages = function (_a) {
|
|
|
143
144
|
webCoverHtml = (0, html_1.toHTML)(react_1.default.createElement(main_1.Main, { parameters: parameters, sortedPages: sortedPages, pdfEnabled: pdfEnabled },
|
|
144
145
|
react_1.default.createElement(cover_1.Cover, { parameters: parameters })));
|
|
145
146
|
$ = cheerio_1.default.load(mainTemplate.html());
|
|
146
|
-
webCoverStyles = cheerio_1.default.load(webCover.html());
|
|
147
|
-
$('head').append(webCoverStyles('head').html());
|
|
148
147
|
$('body').html(webCoverHtml);
|
|
149
148
|
pdfCoverHtml = (0, html_1.toHTML)(react_1.default.createElement(pdf_cover_1.PdfCover, { parameters: parameters }));
|
|
150
149
|
$Pdf = cheerio_1.default.load(pdfCoverTemplate.html());
|
|
151
|
-
pdfCoverStyles = cheerio_1.default.load(pdfCoverTemplate.html());
|
|
152
|
-
$Pdf('head').append(pdfCoverStyles('head').html());
|
|
153
150
|
$Pdf('body').html(pdfCoverHtml);
|
|
151
|
+
pdfHeaderHtml = (0, html_1.toHTML)(react_1.default.createElement(pdf_header_1.PdfHeader, { parameters: parameters }));
|
|
152
|
+
$PdfHeader = cheerio_1.default.load(pdfHeaderTemplate.html());
|
|
153
|
+
$PdfHeader('body').html(pdfHeaderHtml);
|
|
154
154
|
pdfFooterHtml = (0, html_1.toHTML)(react_1.default.createElement(pdf_footer_1.PdfFooter, { parameters: parameters }));
|
|
155
155
|
$PdfFooter = cheerio_1.default.load(pdfFooterTemplate.html());
|
|
156
|
-
pdfFooterStyles = cheerio_1.default.load(pdfFooterTemplate.html());
|
|
157
|
-
$PdfFooter('head').append(pdfFooterStyles('head').html());
|
|
158
156
|
$PdfFooter('body').html(pdfFooterHtml);
|
|
159
157
|
return [2 /*return*/, {
|
|
160
158
|
pages: pages,
|
|
161
159
|
redirect: hydratedTemplates.redirect,
|
|
162
160
|
webCover: $.html(),
|
|
163
161
|
pdfCover: $Pdf.html(),
|
|
164
|
-
pdfHeader:
|
|
162
|
+
pdfHeader: $PdfHeader.html(),
|
|
165
163
|
pdfFooter: $PdfFooter.html(),
|
|
166
164
|
}];
|
|
167
165
|
});
|
package/package.json
CHANGED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
pre {
|
|
2
|
-
font-size: 12px; /*todo - move to base styles*/
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
section blockquote p,
|
|
6
|
-
section li p {
|
|
7
|
-
margin: 0;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.w-table {
|
|
11
|
-
width: 100%;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/******************************** TABLE OF CONTENTS ****************************/
|
|
15
|
-
|
|
16
|
-
/*Table of contents button to initiate show/hide*/
|
|
17
|
-
#dg-navigator {
|
|
18
|
-
float: right;
|
|
19
|
-
background-color: rgb(26, 34, 49);
|
|
20
|
-
color: white;
|
|
21
|
-
text-align: right;
|
|
22
|
-
padding: 10px 20px 10px 20px;
|
|
23
|
-
margin-right: 200px;
|
|
24
|
-
border-radius: 0 0 10px 10px;
|
|
25
|
-
cursor: pointer;
|
|
26
|
-
font-weight: bold;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/*Table of contents container*/
|
|
30
|
-
#dg-toc {
|
|
31
|
-
color: white;
|
|
32
|
-
background-color: rgb(26, 34, 49);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
#dg-toc table {
|
|
36
|
-
table-layout: auto;
|
|
37
|
-
width: 100%;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
#dg-toc div {
|
|
41
|
-
padding: 15px 0 15px 0;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/*Columns in table of contents*/
|
|
45
|
-
|
|
46
|
-
#dg-toc td {
|
|
47
|
-
border-right: 1px solid #666;
|
|
48
|
-
vertical-align: top;
|
|
49
|
-
text-align: left;
|
|
50
|
-
padding: 0 20px 0 20px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
#dg-toc ul {
|
|
54
|
-
padding: 0;
|
|
55
|
-
list-style-type: none;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
#dg-toc li {
|
|
59
|
-
font-weight: bold;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
#dg-toc table td a {
|
|
63
|
-
color: white;
|
|
64
|
-
font-weight: normal;
|
|
65
|
-
text-decoration: none;
|
|
66
|
-
margin-left: 10px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
#dg-toc table td a:hover {
|
|
70
|
-
text-decoration: underline;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
#dg-tocFixedColumn {
|
|
74
|
-
border-right: none;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
#dg-toc table #dg-tocFixedColumn a {
|
|
78
|
-
vertical-align: middle;
|
|
79
|
-
margin-left: 4px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.dg-tocGroup {
|
|
83
|
-
width: 22%;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.dg-tocHeading {
|
|
87
|
-
font-size: 16px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.dg-tocIcon {
|
|
91
|
-
width: 18px;
|
|
92
|
-
height: 18px;
|
|
93
|
-
float: left;
|
|
94
|
-
}
|
|
95
|
-
.dg-tocIcon svg {
|
|
96
|
-
fill: white;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/*
|
|
100
|
-
Page table of contents
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
.dg-pageToc {
|
|
104
|
-
list-style: none;
|
|
105
|
-
padding: 10px;
|
|
106
|
-
border: 1px solid #999;
|
|
107
|
-
background-color: #eee;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/*
|
|
111
|
-
Class to make a heading look invisible in web page, but still appear in the PDF table of contents
|
|
112
|
-
- display:none, visibily: hidden, zero dimensions, and offscreen positioning don't work
|
|
113
|
-
- so instead take it out of the flow and make it small and translucent
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
.dg-hiddenTitle {
|
|
117
|
-
display: block;
|
|
118
|
-
border: none;
|
|
119
|
-
margin: 0;
|
|
120
|
-
padding: 0;
|
|
121
|
-
width: 1px;
|
|
122
|
-
height: 1px;
|
|
123
|
-
overflow: hidden;
|
|
124
|
-
position: absolute;
|
|
125
|
-
background-color: transparent;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.dg-fakeHeading {
|
|
129
|
-
text-decoration: none;
|
|
130
|
-
font-weight: bold;
|
|
131
|
-
color: #385691;
|
|
132
|
-
border-bottom: 1px solid #999;
|
|
133
|
-
margin: 20px 0 20px 0;
|
|
134
|
-
font-size: 16px;
|
|
135
|
-
padding-bottom: 4px;
|
|
136
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<style>
|
|
2
|
-
|
|
3
|
-
#dg-coverInfo {
|
|
4
|
-
margin-top: 100px;
|
|
5
|
-
margin-bottom: 50px;
|
|
6
|
-
width: 100%;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
#dg-coverInfo {
|
|
10
|
-
border-collapse: separate; /*http://stackoverflow.com/questions/7625586/*/
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
#dg-coverInfo th {
|
|
14
|
-
background-color: rgb(46, 113, 225);
|
|
15
|
-
color: white;
|
|
16
|
-
font-size: 34px;
|
|
17
|
-
padding: 20px;
|
|
18
|
-
border: 1px solid rgb(46, 113, 225);
|
|
19
|
-
border-radius: 10px 10px 0 0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
#dg-coverInfo tr td {
|
|
23
|
-
border-top: 2px solid rgb(46, 113, 225);
|
|
24
|
-
border-left: 2px solid rgb(46, 113, 225);
|
|
25
|
-
border-bottom: none;
|
|
26
|
-
border-right: none;
|
|
27
|
-
padding-top: 20px;
|
|
28
|
-
padding-bottom: 20px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
#dg-coverInfo td:last-child {
|
|
32
|
-
border-right: 2px solid rgb(46, 113, 225);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
#dg-coverInfo .dg-finalRow td {
|
|
36
|
-
border-bottom: 2px solid rgb(46, 113, 225);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
#dg-summary {
|
|
40
|
-
margin-bottom: 100px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
</style>
|