@t8/docsgen 0.1.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 (43) hide show
  1. package/README.md +0 -0
  2. package/dist/bin.js +756 -0
  3. package/dist/css/base.css +232 -0
  4. package/dist/css/code.css +30 -0
  5. package/dist/css/code.lightbulb.css +278 -0
  6. package/dist/css/index.css +212 -0
  7. package/dist/css/section.css +200 -0
  8. package/package.json +36 -0
  9. package/src/bin/cleanup.ts +11 -0
  10. package/src/bin/createFiles.ts +8 -0
  11. package/src/bin/fetchText.ts +16 -0
  12. package/src/bin/getConfig.ts +44 -0
  13. package/src/bin/getCounterContent.ts +17 -0
  14. package/src/bin/getNav.ts +64 -0
  15. package/src/bin/getParsedContent.ts +180 -0
  16. package/src/bin/getRepoLink.ts +9 -0
  17. package/src/bin/getSlug.ts +21 -0
  18. package/src/bin/getTitle.ts +49 -0
  19. package/src/bin/run.ts +31 -0
  20. package/src/bin/runEntry.ts +55 -0
  21. package/src/bin/setCName.ts +13 -0
  22. package/src/bin/setContent.ts +251 -0
  23. package/src/bin/setImages.ts +8 -0
  24. package/src/bin/toConfig.ts +14 -0
  25. package/src/bin/toFileContent.ts +3 -0
  26. package/src/bin/toRepoURL.ts +22 -0
  27. package/src/const/packageName.ts +1 -0
  28. package/src/css/base.css +232 -0
  29. package/src/css/code.css +30 -0
  30. package/src/css/code.lightbulb.css +278 -0
  31. package/src/css/index.css +212 -0
  32. package/src/css/section.css +200 -0
  33. package/src/types/BinConfig.ts +6 -0
  34. package/src/types/Context.ts +4 -0
  35. package/src/types/EntryConfig.ts +57 -0
  36. package/src/types/NavItem.ts +8 -0
  37. package/src/types/PackageMetadata.ts +11 -0
  38. package/src/types/Theme.ts +1 -0
  39. package/src/utils/escapeHTML.ts +17 -0
  40. package/src/utils/escapeRegExp.ts +4 -0
  41. package/src/utils/getIcon.ts +16 -0
  42. package/src/utils/getSVGDataURL.ts +9 -0
  43. package/tsconfig.json +14 -0
@@ -0,0 +1,232 @@
1
+ :root {
2
+ color-scheme: light dark;
3
+
4
+ --b0: light-dark(white, #1a1a1a);
5
+ --b1: var(--color-scheme, gray);
6
+ --link-color: light-dark(royalblue, deepskyblue);
7
+ --button-color: light-dark(royalblue, royalblue);
8
+
9
+ --b1-light: color(from var(--b1) srgb r g b / 0.12);
10
+ --b1-medium: color(
11
+ from var(--b1) srgb calc(0.8 * r) calc(0.8 * g) calc(0.8 * b) /
12
+ 0.5
13
+ );
14
+ --b1-heavy: color(
15
+ from var(--b1) srgb calc(0.35 * r) calc(0.35 * g) calc(0.35 * b) /
16
+ 0.9
17
+ );
18
+
19
+ --c0: oklch(from var(--b0) calc(100 * (0.78 - l)) 0 0 / 0.82);
20
+ --c1: oklch(from var(--b1) calc(100 * (0.78 - l)) 0 0 / 0.82);
21
+ --c2: oklch(from var(--button-color) calc(100 * (0.75 - l)) 0 0 / 0.82);
22
+
23
+ /*
24
+ --link-color: color(
25
+ from var(--c0) srgb calc(r + 0.2) calc(g + 0.4) calc(b + 0.8)
26
+ );
27
+ */
28
+ --link-decoration: underline;
29
+
30
+ --max-content-width: 64em;
31
+ --content-padding-x: 1.75rem;
32
+ --content-padding-y: 1.75rem;
33
+ --content-border-radius: 1rem;
34
+ --space-x: var(--content-padding-x);
35
+ --block-margin-y: 1em;
36
+ --hr-border: 0.15rem solid var(--b1-medium);
37
+
38
+ font-size: 100%;
39
+ font-family: sans-serif;
40
+ /*
41
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
42
+ */
43
+ line-height: 1.45;
44
+ }
45
+ html {
46
+ color: var(--c0);
47
+ background-color: var(--b0);
48
+ background-position: 50% 0;
49
+ }
50
+ html[data-theme="t8"] {
51
+ --color-scheme: #410fcd;
52
+ }
53
+ body {
54
+ color: inherit;
55
+ background-color: transparent;
56
+ padding: 0;
57
+ margin: 0;
58
+ }
59
+ @media (max-width: 840px) {
60
+ :root {
61
+ --content-padding-x: 0.85rem;
62
+ --content-padding-y: 1rem;
63
+ }
64
+ body {
65
+ font-size: 100%;
66
+ }
67
+ }
68
+
69
+ p,
70
+ ul,
71
+ ol,
72
+ table,
73
+ pre,
74
+ blockquote {
75
+ margin-top: var(--block-margin-y);
76
+ margin-bottom: var(--block-margin-y);
77
+ }
78
+ ul,
79
+ ol {
80
+ padding-inline-start: 2em;
81
+ }
82
+
83
+ a,
84
+ a:link,
85
+ a:visited,
86
+ a:hover,
87
+ a:active {
88
+ color: var(--link-color);
89
+ text-decoration: var(--link-decoration);
90
+ }
91
+
92
+ a.button {
93
+ --bc1: color(from var(--c0) srgb r g b / 0.25);
94
+ --bc2: color(
95
+ from var(--c0) srgb calc(0.8 * r) calc(0.8 * g) calc(0.8 * b) /
96
+ 0.35
97
+ );
98
+
99
+ display: inline-block;
100
+ text-decoration: none;
101
+ color: var(--b0);
102
+ background: color(from var(--c0) srgb r g b / 0.65);
103
+ border: 0.075em solid var(--c0);
104
+ border-color: var(--bc1) var(--bc2) var(--bc2) var(--bc1);
105
+ border-radius: var(--r);
106
+ padding: 0.25em 1.25em;
107
+ margin: 0.5em 0.35em;
108
+ box-shadow: 0 0 0.1em 0 var(--c0);
109
+ transition: box-shadow 0.1s;
110
+ box-sizing: border-box;
111
+ }
112
+ a.button:hover {
113
+ box-shadow: 0 0 0.25em 0 var(--c0);
114
+ }
115
+ a.button.primary {
116
+ --bc1: color(from var(--button-color) srgb r g b / 0.55);
117
+ --bc2: color(
118
+ from var(--button-color) srgb calc(0.8 * r) calc(0.8 * g) calc(0.8 * b) /
119
+ 0.7
120
+ );
121
+
122
+ font-weight: bold;
123
+ color: var(--c2);
124
+ background: var(--button-color);
125
+ box-shadow: 0 0 0.2em 0 var(--button-color);
126
+ }
127
+ a.button.primary:hover {
128
+ box-shadow: 0 0 0.35em 0 var(--button-color);
129
+ }
130
+
131
+ h1 {
132
+ font-size: 2.25em;
133
+ line-height: 1;
134
+ margin: 0;
135
+ }
136
+ h1 a,
137
+ h1 a:link,
138
+ h1 a:visited,
139
+ h1 a:active {
140
+ color: inherit;
141
+ text-decoration: none;
142
+ }
143
+ h1 a:hover {
144
+ color: inherit;
145
+ text-decoration: underline;
146
+ }
147
+ h2,
148
+ h3,
149
+ h4 {
150
+ line-height: 1.1;
151
+ }
152
+ h2 {
153
+ font-size: 1.6em;
154
+ margin: 1em 0 0.65em 0;
155
+ }
156
+ h3 {
157
+ font-size: 1.3em;
158
+ margin: 1em 0 0.65em 0;
159
+ }
160
+ h4 {
161
+ font-size: 1.15em;
162
+ margin: 1em 0 0.65em 0;
163
+ }
164
+
165
+ header,
166
+ .body,
167
+ footer {
168
+ max-width: var(--max-content-width);
169
+ margin: 0 auto;
170
+ box-sizing: border-box;
171
+ }
172
+
173
+ header,
174
+ footer {
175
+ padding: 0 var(--content-padding-x);
176
+ }
177
+
178
+ main {
179
+ box-sizing: border-box;
180
+ }
181
+ main h2:first-child {
182
+ margin-top: 0;
183
+ }
184
+ main ul {
185
+ padding: 0;
186
+ padding-inline-start: 1.5em;
187
+ margin: 1em 0;
188
+ }
189
+ main ul ul {
190
+ margin: 0.5em 0;
191
+ }
192
+ main li {
193
+ margin-top: 0;
194
+ margin-bottom: 0.5em;
195
+ }
196
+
197
+ .highlight {
198
+ border-radius: 1em;
199
+ margin: 0;
200
+ }
201
+ code {
202
+ background: light-dark(
203
+ color(from currentColor srgb r g b / 0.08),
204
+ color(from currentColor srgb r g b / 0.15)
205
+ );
206
+ border-radius: 0.35em;
207
+ padding: 0.15em 0.35em;
208
+ }
209
+ pre,
210
+ pre.highlight {
211
+ line-height: 1.25;
212
+ color: inherit;
213
+ border-radius: 1em;
214
+ overflow: auto;
215
+ }
216
+ pre > code {
217
+ display: block;
218
+ background: transparent;
219
+ padding: 1.25em;
220
+ }
221
+
222
+ html.blank h1 {
223
+ font-size: 10vmin;
224
+ color: var(--b1-light);
225
+ }
226
+ html.blank .layout {
227
+ display: flex;
228
+ height: 90vh;
229
+ align-items: center;
230
+ justify-content: center;
231
+ overflow: hidden;
232
+ }
@@ -0,0 +1,30 @@
1
+ .hljs {
2
+ color: #dbdad6;
3
+ background: #1d2331;
4
+ }
5
+ .hljs-bullet,
6
+ .hljs-name,
7
+ .hljs-selector-tag,
8
+ .hljs-template-variable,
9
+ .hljs-variable {
10
+ color: #f49466;
11
+ }
12
+ .hljs-attr,
13
+ .hljs-link,
14
+ .hljs-literal,
15
+ .hljs-number,
16
+ .hljs-symbol,
17
+ .hljs-variable.constant_ {
18
+ color: #f2af7d;
19
+ }
20
+ .hljs-deletion {
21
+ color: #f88f7f;
22
+ background: #3d1e20;
23
+ }
24
+ .hljs-addition {
25
+ color: #6ad4af;
26
+ background: #19362c;
27
+ }
28
+ .hljs-comment {
29
+ color: #7a8599;
30
+ }
@@ -0,0 +1,278 @@
1
+ /* This file was generated using `pygmentize -S lightbulb -f html -a .highlight` */
2
+ pre {
3
+ line-height: 125%;
4
+ }
5
+ td.linenos .normal {
6
+ color: #3c4354;
7
+ background-color: transparent;
8
+ padding-left: 5px;
9
+ padding-right: 5px;
10
+ }
11
+ span.linenos {
12
+ color: #3c4354;
13
+ background-color: transparent;
14
+ padding-left: 5px;
15
+ padding-right: 5px;
16
+ }
17
+ td.linenos .special {
18
+ color: #3c4354;
19
+ background-color: #ffffc0;
20
+ padding-left: 5px;
21
+ padding-right: 5px;
22
+ }
23
+ span.linenos.special {
24
+ color: #3c4354;
25
+ background-color: #ffffc0;
26
+ padding-left: 5px;
27
+ padding-right: 5px;
28
+ }
29
+ .highlight .hll {
30
+ background-color: #6e7681;
31
+ }
32
+ .highlight {
33
+ background: #1d2331;
34
+ color: #d4d2c8;
35
+ }
36
+ .highlight .c {
37
+ color: #7e8aa1;
38
+ } /* Comment */
39
+ .highlight .err {
40
+ color: #f88f7f;
41
+ } /* Error */
42
+ .highlight .esc {
43
+ color: #d4d2c8;
44
+ } /* Escape */
45
+ .highlight .g {
46
+ color: #d4d2c8;
47
+ } /* Generic */
48
+ .highlight .k {
49
+ color: #ffad66;
50
+ } /* Keyword */
51
+ .highlight .l {
52
+ color: #d5ff80;
53
+ } /* Literal */
54
+ .highlight .n {
55
+ color: #d4d2c8;
56
+ } /* Name */
57
+ .highlight .o {
58
+ color: #ffad66;
59
+ } /* Operator */
60
+ .highlight .x {
61
+ color: #d4d2c8;
62
+ } /* Other */
63
+ .highlight .p {
64
+ color: #d4d2c8;
65
+ } /* Punctuation */
66
+ .highlight .ch {
67
+ color: #f88f7f;
68
+ font-style: italic;
69
+ } /* Comment.Hashbang */
70
+ .highlight .cm {
71
+ color: #7e8aa1;
72
+ } /* Comment.Multiline */
73
+ .highlight .cp {
74
+ color: #ffad66;
75
+ font-weight: bold;
76
+ } /* Comment.Preproc */
77
+ .highlight .cpf {
78
+ color: #7e8aa1;
79
+ } /* Comment.PreprocFile */
80
+ .highlight .c1 {
81
+ color: #7e8aa1;
82
+ } /* Comment.Single */
83
+ .highlight .cs {
84
+ color: #7e8aa1;
85
+ font-style: italic;
86
+ } /* Comment.Special */
87
+ .highlight .gd {
88
+ color: #f88f7f;
89
+ background-color: #3d1e20;
90
+ } /* Generic.Deleted */
91
+ .highlight .ge {
92
+ color: #d4d2c8;
93
+ font-style: italic;
94
+ } /* Generic.Emph */
95
+ .highlight .ges {
96
+ color: #d4d2c8;
97
+ } /* Generic.EmphStrong */
98
+ .highlight .gr {
99
+ color: #f88f7f;
100
+ } /* Generic.Error */
101
+ .highlight .gh {
102
+ color: #d4d2c8;
103
+ } /* Generic.Heading */
104
+ .highlight .gi {
105
+ color: #6ad4af;
106
+ background-color: #19362c;
107
+ } /* Generic.Inserted */
108
+ .highlight .go {
109
+ color: #7e8aa1;
110
+ } /* Generic.Output */
111
+ .highlight .gp {
112
+ color: #d4d2c8;
113
+ } /* Generic.Prompt */
114
+ .highlight .gs {
115
+ color: #d4d2c8;
116
+ font-weight: bold;
117
+ } /* Generic.Strong */
118
+ .highlight .gu {
119
+ color: #d4d2c8;
120
+ } /* Generic.Subheading */
121
+ .highlight .gt {
122
+ color: #f88f7f;
123
+ } /* Generic.Traceback */
124
+ .highlight .kc {
125
+ color: #ffad66;
126
+ } /* Keyword.Constant */
127
+ .highlight .kd {
128
+ color: #ffad66;
129
+ } /* Keyword.Declaration */
130
+ .highlight .kn {
131
+ color: #ffad66;
132
+ } /* Keyword.Namespace */
133
+ .highlight .kp {
134
+ color: #ffad66;
135
+ } /* Keyword.Pseudo */
136
+ .highlight .kr {
137
+ color: #ffad66;
138
+ } /* Keyword.Reserved */
139
+ .highlight .kt {
140
+ color: #73d0ff;
141
+ } /* Keyword.Type */
142
+ .highlight .ld {
143
+ color: #d5ff80;
144
+ } /* Literal.Date */
145
+ .highlight .m {
146
+ color: #dfbfff;
147
+ } /* Literal.Number */
148
+ .highlight .s {
149
+ color: #d5ff80;
150
+ } /* Literal.String */
151
+ .highlight .na {
152
+ color: #ffd173;
153
+ } /* Name.Attribute */
154
+ .highlight .nb {
155
+ color: #ffd173;
156
+ } /* Name.Builtin */
157
+ .highlight .nc {
158
+ color: #73d0ff;
159
+ } /* Name.Class */
160
+ .highlight .no {
161
+ color: #ffd173;
162
+ } /* Name.Constant */
163
+ .highlight .nd {
164
+ color: #7e8aa1;
165
+ font-weight: bold;
166
+ font-style: italic;
167
+ } /* Name.Decorator */
168
+ .highlight .ni {
169
+ color: #95e6cb;
170
+ } /* Name.Entity */
171
+ .highlight .ne {
172
+ color: #73d0ff;
173
+ } /* Name.Exception */
174
+ .highlight .nf {
175
+ color: #ffd173;
176
+ } /* Name.Function */
177
+ .highlight .nl {
178
+ color: #d4d2c8;
179
+ } /* Name.Label */
180
+ .highlight .nn {
181
+ color: #d4d2c8;
182
+ } /* Name.Namespace */
183
+ .highlight .nx {
184
+ color: #d4d2c8;
185
+ } /* Name.Other */
186
+ .highlight .py {
187
+ color: #ffd173;
188
+ } /* Name.Property */
189
+ .highlight .nt {
190
+ color: #5ccfe6;
191
+ } /* Name.Tag */
192
+ .highlight .nv {
193
+ color: #d4d2c8;
194
+ } /* Name.Variable */
195
+ .highlight .ow {
196
+ color: #ffad66;
197
+ } /* Operator.Word */
198
+ .highlight .pm {
199
+ color: #d4d2c8;
200
+ } /* Punctuation.Marker */
201
+ .highlight .w {
202
+ color: #d4d2c8;
203
+ } /* Text.Whitespace */
204
+ .highlight .mb {
205
+ color: #dfbfff;
206
+ } /* Literal.Number.Bin */
207
+ .highlight .mf {
208
+ color: #dfbfff;
209
+ } /* Literal.Number.Float */
210
+ .highlight .mh {
211
+ color: #dfbfff;
212
+ } /* Literal.Number.Hex */
213
+ .highlight .mi {
214
+ color: #dfbfff;
215
+ } /* Literal.Number.Integer */
216
+ .highlight .mo {
217
+ color: #dfbfff;
218
+ } /* Literal.Number.Oct */
219
+ .highlight .sa {
220
+ color: #f29e74;
221
+ } /* Literal.String.Affix */
222
+ .highlight .sb {
223
+ color: #d5ff80;
224
+ } /* Literal.String.Backtick */
225
+ .highlight .sc {
226
+ color: #d5ff80;
227
+ } /* Literal.String.Char */
228
+ .highlight .dl {
229
+ color: #d5ff80;
230
+ } /* Literal.String.Delimiter */
231
+ .highlight .sd {
232
+ color: #7e8aa1;
233
+ } /* Literal.String.Doc */
234
+ .highlight .s2 {
235
+ color: #d5ff80;
236
+ } /* Literal.String.Double */
237
+ .highlight .se {
238
+ color: #95e6cb;
239
+ } /* Literal.String.Escape */
240
+ .highlight .sh {
241
+ color: #d5ff80;
242
+ } /* Literal.String.Heredoc */
243
+ .highlight .si {
244
+ color: #95e6cb;
245
+ } /* Literal.String.Interpol */
246
+ .highlight .sx {
247
+ color: #95e6cb;
248
+ } /* Literal.String.Other */
249
+ .highlight .sr {
250
+ color: #95e6cb;
251
+ } /* Literal.String.Regex */
252
+ .highlight .s1 {
253
+ color: #d5ff80;
254
+ } /* Literal.String.Single */
255
+ .highlight .ss {
256
+ color: #dfbfff;
257
+ } /* Literal.String.Symbol */
258
+ .highlight .bp {
259
+ color: #5ccfe6;
260
+ } /* Name.Builtin.Pseudo */
261
+ .highlight .fm {
262
+ color: #ffd173;
263
+ } /* Name.Function.Magic */
264
+ .highlight .vc {
265
+ color: #d4d2c8;
266
+ } /* Name.Variable.Class */
267
+ .highlight .vg {
268
+ color: #d4d2c8;
269
+ } /* Name.Variable.Global */
270
+ .highlight .vi {
271
+ color: #d4d2c8;
272
+ } /* Name.Variable.Instance */
273
+ .highlight .vm {
274
+ color: #d4d2c8;
275
+ } /* Name.Variable.Magic */
276
+ .highlight .il {
277
+ color: #dfbfff;
278
+ } /* Literal.Number.Integer.Long */