svelte-readme 3.6.3 → 4.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.
package/dist/style.css ADDED
@@ -0,0 +1,565 @@
1
+ /**
2
+ * Adapted from github-markdown-css (MIT License)
3
+ * https://github.com/sindresorhus/github-markdown-css
4
+ *
5
+ * Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this
8
+ * software and associated documentation files (the "Software"), to deal in the Software
9
+ * without restriction, including without limitation the rights to use, copy, modify,
10
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
11
+ * permit persons to whom the Software is furnished to do so, subject to the following
12
+ * conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all copies
15
+ * or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
22
+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+ *
24
+ * Selectors were rescoped from `.markdown-body` to `main`, and rules specific to
25
+ * GitHub's own chrome (diff/blob/octicon/utility classes) were dropped since they never
26
+ * match rendered README markup. The trailing `p`/`pre` rules below are this project's
27
+ * own spacing overrides, not from the upstream stylesheet.
28
+ *
29
+ * Colors, font stacks, and the block-spacing unit are pulled out as custom properties
30
+ * so a consumer can retheme this (e.g. dark mode, brand colors) by overriding them on
31
+ * `:root` or `main`, without having to override individual rules.
32
+ **/
33
+
34
+ :root {
35
+ --gh-font-sans: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;
36
+ --gh-font-mono: SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;
37
+
38
+ --gh-color-fg: #24292e;
39
+ --gh-color-fg-muted: #6a737d;
40
+ --gh-color-fg-subtle: #444d56;
41
+ --gh-color-link: #0366d6;
42
+
43
+ --gh-color-canvas: #fff;
44
+ --gh-color-canvas-subtle: #f6f8fa;
45
+ --gh-color-kbd-bg: #fafbfc;
46
+ --gh-color-code-bg: rgba(27,31,35,.05);
47
+
48
+ --gh-color-border: #dfe2e5;
49
+ --gh-color-border-muted: #eaecef;
50
+ --gh-color-border-kbd: #d1d5da;
51
+ --gh-color-border-table: #c6cbd1;
52
+ --gh-color-hr: #e1e4e8;
53
+
54
+ --gh-spacing: 16px;
55
+ --gh-spacing-lg: 24px;
56
+ }
57
+
58
+ .anchor {
59
+ float: left;
60
+ line-height: 1;
61
+ margin-left: -20px;
62
+ padding-right: 4px;
63
+ }
64
+
65
+ .anchor:focus {
66
+ outline: none;
67
+ }
68
+
69
+ h1:hover .anchor,
70
+ h2:hover .anchor,
71
+ h3:hover .anchor,
72
+ h4:hover .anchor,
73
+ h5:hover .anchor,
74
+ h6:hover .anchor {
75
+ text-decoration: none;
76
+ }
77
+
78
+ main {
79
+ -ms-text-size-adjust: 100%;
80
+ -webkit-text-size-adjust: 100%;
81
+ line-height: 1.5;
82
+ color: var(--gh-color-fg);
83
+ font-family: var(--gh-font-sans);
84
+ font-size: 16px;
85
+ word-wrap: break-word;
86
+ }
87
+
88
+ details {
89
+ display: block;
90
+ }
91
+
92
+ summary {
93
+ display: list-item;
94
+ }
95
+
96
+ a {
97
+ background-color: initial;
98
+ }
99
+
100
+ a:active,
101
+ a:hover {
102
+ outline-width: 0;
103
+ }
104
+
105
+ strong {
106
+ font-weight: inherit;
107
+ font-weight: bolder;
108
+ }
109
+
110
+ h1 {
111
+ font-size: 2em;
112
+ margin: .67em 0;
113
+ }
114
+
115
+ img {
116
+ border-style: none;
117
+ }
118
+
119
+ code,
120
+ kbd,
121
+ pre {
122
+ font-family: monospace,monospace;
123
+ font-size: 1em;
124
+ }
125
+
126
+ hr {
127
+ box-sizing: initial;
128
+ height: 0;
129
+ overflow: visible;
130
+ }
131
+
132
+ input {
133
+ font: inherit;
134
+ margin: 0;
135
+ }
136
+
137
+ input {
138
+ overflow: visible;
139
+ }
140
+
141
+ [type=checkbox] {
142
+ box-sizing: border-box;
143
+ padding: 0;
144
+ }
145
+
146
+ * {
147
+ box-sizing: border-box;
148
+ }
149
+
150
+ input {
151
+ font-family: inherit;
152
+ font-size: inherit;
153
+ line-height: inherit;
154
+ }
155
+
156
+ a {
157
+ color: var(--gh-color-link);
158
+ text-decoration: none;
159
+ }
160
+
161
+ a:hover {
162
+ text-decoration: underline;
163
+ }
164
+
165
+ strong {
166
+ font-weight: 600;
167
+ }
168
+
169
+ hr {
170
+ height: 0;
171
+ margin: 15px 0;
172
+ overflow: hidden;
173
+ background: transparent;
174
+ border: 0;
175
+ border-bottom: 1px solid var(--gh-color-border);
176
+ }
177
+
178
+ hr:after,
179
+ hr:before {
180
+ display: table;
181
+ content: "";
182
+ }
183
+
184
+ hr:after {
185
+ clear: both;
186
+ }
187
+
188
+ table {
189
+ border-spacing: 0;
190
+ border-collapse: collapse;
191
+ }
192
+
193
+ td,
194
+ th {
195
+ padding: 0;
196
+ }
197
+
198
+ details summary {
199
+ cursor: pointer;
200
+ }
201
+
202
+ kbd {
203
+ display: inline-block;
204
+ padding: 3px 5px;
205
+ font: 11px var(--gh-font-mono);
206
+ line-height: 10px;
207
+ color: var(--gh-color-fg-subtle);
208
+ vertical-align: middle;
209
+ background-color: var(--gh-color-kbd-bg);
210
+ border: 1px solid var(--gh-color-border-kbd);
211
+ border-radius: 3px;
212
+ box-shadow: inset 0 -1px 0 var(--gh-color-border-kbd);
213
+ }
214
+
215
+ h1,
216
+ h2,
217
+ h3,
218
+ h4,
219
+ h5,
220
+ h6 {
221
+ margin-top: 0;
222
+ margin-bottom: 0;
223
+ }
224
+
225
+ h1 {
226
+ font-size: 32px;
227
+ }
228
+
229
+ h1,
230
+ h2 {
231
+ font-weight: 600;
232
+ }
233
+
234
+ h2 {
235
+ font-size: 24px;
236
+ }
237
+
238
+ h3 {
239
+ font-size: 20px;
240
+ }
241
+
242
+ h3,
243
+ h4 {
244
+ font-weight: 600;
245
+ }
246
+
247
+ h4 {
248
+ font-size: 16px;
249
+ }
250
+
251
+ h5 {
252
+ font-size: 14px;
253
+ }
254
+
255
+ h5,
256
+ h6 {
257
+ font-weight: 600;
258
+ }
259
+
260
+ h6 {
261
+ font-size: 12px;
262
+ }
263
+
264
+ p {
265
+ margin-top: 0;
266
+ margin-bottom: 10px;
267
+ }
268
+
269
+ blockquote {
270
+ margin: 0;
271
+ }
272
+
273
+ ol,
274
+ ul {
275
+ padding-left: 0;
276
+ margin-top: 0;
277
+ margin-bottom: 0;
278
+ }
279
+
280
+ ol ol,
281
+ ul ol {
282
+ list-style-type: lower-roman;
283
+ }
284
+
285
+ ol ol ol,
286
+ ol ul ol,
287
+ ul ol ol,
288
+ ul ul ol {
289
+ list-style-type: lower-alpha;
290
+ }
291
+
292
+ dd {
293
+ margin-left: 0;
294
+ }
295
+
296
+ code,
297
+ pre {
298
+ font-family: var(--gh-font-mono);
299
+ font-size: 12px;
300
+ }
301
+
302
+ pre {
303
+ margin-top: 0;
304
+ margin-bottom: 0;
305
+ }
306
+
307
+ input::-webkit-inner-spin-button,
308
+ input::-webkit-outer-spin-button {
309
+ margin: 0;
310
+ -webkit-appearance: none;
311
+ appearance: none;
312
+ }
313
+
314
+ :checked+.radio-label {
315
+ position: relative;
316
+ z-index: 1;
317
+ border-color: var(--gh-color-link);
318
+ }
319
+
320
+ hr {
321
+ border-bottom-color: #eee;
322
+ }
323
+
324
+ main:after,
325
+ .markdown-body:before {
326
+ display: table;
327
+ content: "";
328
+ }
329
+
330
+ main:after {
331
+ clear: both;
332
+ }
333
+
334
+ main>:first-child {
335
+ margin-top: 0!important;
336
+ }
337
+
338
+ main>:last-child {
339
+ margin-bottom: 0!important;
340
+ }
341
+
342
+ a:not([href]) {
343
+ color: inherit;
344
+ text-decoration: none;
345
+ }
346
+
347
+ blockquote,
348
+ details,
349
+ dl,
350
+ ol,
351
+ p,
352
+ pre,
353
+ table,
354
+ ul {
355
+ margin-top: 0;
356
+ margin-bottom: var(--gh-spacing);
357
+ }
358
+
359
+ hr {
360
+ height: .25em;
361
+ padding: 0;
362
+ margin: var(--gh-spacing-lg) 0;
363
+ background-color: var(--gh-color-hr);
364
+ border: 0;
365
+ }
366
+
367
+ blockquote {
368
+ padding: 0 1em;
369
+ color: var(--gh-color-fg-muted);
370
+ border-left: .25em solid var(--gh-color-border);
371
+ }
372
+
373
+ blockquote>:first-child {
374
+ margin-top: 0;
375
+ }
376
+
377
+ blockquote>:last-child {
378
+ margin-bottom: 0;
379
+ }
380
+
381
+ h1,
382
+ h2,
383
+ h3,
384
+ h4,
385
+ h5,
386
+ h6 {
387
+ margin-top: var(--gh-spacing-lg);
388
+ margin-bottom: var(--gh-spacing);
389
+ font-weight: 600;
390
+ line-height: 1.25;
391
+ }
392
+
393
+ h1 {
394
+ font-size: 2em;
395
+ }
396
+
397
+ h1,
398
+ h2 {
399
+ padding-bottom: .3em;
400
+ border-bottom: 1px solid var(--gh-color-border-muted);
401
+ }
402
+
403
+ h2 {
404
+ font-size: 1.5em;
405
+ }
406
+
407
+ h3 {
408
+ font-size: 1.25em;
409
+ }
410
+
411
+ h4 {
412
+ font-size: 1em;
413
+ }
414
+
415
+ h5 {
416
+ font-size: .875em;
417
+ }
418
+
419
+ h6 {
420
+ font-size: .85em;
421
+ color: var(--gh-color-fg-muted);
422
+ }
423
+
424
+ ol,
425
+ ul {
426
+ padding-left: 2em;
427
+ }
428
+
429
+ ol ol,
430
+ ol ul,
431
+ ul ol,
432
+ ul ul {
433
+ margin-top: 0;
434
+ margin-bottom: 0;
435
+ }
436
+
437
+ li {
438
+ word-wrap: break-all;
439
+ }
440
+
441
+ li>p {
442
+ margin-top: var(--gh-spacing);
443
+ }
444
+
445
+ li+li {
446
+ margin-top: .25em;
447
+ }
448
+
449
+ dl {
450
+ padding: 0;
451
+ }
452
+
453
+ dl dt {
454
+ padding: 0;
455
+ margin-top: var(--gh-spacing);
456
+ font-size: 1em;
457
+ font-style: italic;
458
+ font-weight: 600;
459
+ }
460
+
461
+ dl dd {
462
+ padding: 0 var(--gh-spacing);
463
+ margin-bottom: var(--gh-spacing);
464
+ }
465
+
466
+ table {
467
+ display: block;
468
+ width: 100%;
469
+ overflow: auto;
470
+ }
471
+
472
+ table th {
473
+ font-weight: 600;
474
+ }
475
+
476
+ table td,
477
+ table th {
478
+ padding: 6px 13px;
479
+ border: 1px solid var(--gh-color-border);
480
+ }
481
+
482
+ table tr {
483
+ background-color: var(--gh-color-canvas);
484
+ border-top: 1px solid var(--gh-color-border-table);
485
+ }
486
+
487
+ table tr:nth-child(2n) {
488
+ background-color: var(--gh-color-canvas-subtle);
489
+ }
490
+
491
+ img {
492
+ max-width: 100%;
493
+ box-sizing: initial;
494
+ background-color: var(--gh-color-canvas);
495
+ }
496
+
497
+ img[align=right] {
498
+ padding-left: 20px;
499
+ }
500
+
501
+ img[align=left] {
502
+ padding-right: 20px;
503
+ }
504
+
505
+ code {
506
+ padding: .2em .4em;
507
+ margin: 0;
508
+ font-size: 85%;
509
+ background-color: var(--gh-color-code-bg);
510
+ border-radius: 3px;
511
+ }
512
+
513
+ pre {
514
+ word-wrap: normal;
515
+ }
516
+
517
+ pre>code {
518
+ padding: 0;
519
+ margin: 0;
520
+ font-size: 100%;
521
+ word-break: normal;
522
+ white-space: pre;
523
+ background: transparent;
524
+ border: 0;
525
+ }
526
+
527
+ .highlight {
528
+ margin-bottom: var(--gh-spacing);
529
+ }
530
+
531
+ .highlight pre {
532
+ margin-bottom: 0;
533
+ word-break: normal;
534
+ }
535
+
536
+ .highlight pre,
537
+ pre {
538
+ padding: var(--gh-spacing);
539
+ overflow: auto;
540
+ font-size: 85%;
541
+ line-height: 1.45;
542
+ background-color: var(--gh-color-canvas-subtle);
543
+ border-radius: 3px;
544
+ }
545
+
546
+ pre code {
547
+ display: inline;
548
+ max-width: auto;
549
+ padding: 0;
550
+ margin: 0;
551
+ overflow: visible;
552
+ line-height: inherit;
553
+ word-wrap: normal;
554
+ background-color: initial;
555
+ border: 0;
556
+ }
557
+
558
+ /* Overrides to keep spacing consistent with our own layout, not GitHub's. */
559
+
560
+ p {
561
+ min-height: 28px;
562
+ }
563
+ pre {
564
+ margin-bottom: 48px;
565
+ }
@@ -0,0 +1,3 @@
1
+ export declare const githubStyles: string;
2
+ export declare const layoutStyles: string;
3
+ export declare const buttonStyles: string;
@@ -0,0 +1,15 @@
1
+ .language-svelte .tag {
2
+ color: #22863a;
3
+ }
4
+ .language-svelte .attr-name {
5
+ color: #6f42c1;
6
+ }
7
+ .language-svelte .attr-value {
8
+ color: #032f62;
9
+ }
10
+ .language-svelte .selector {
11
+ color: #22863a;
12
+ }
13
+ .language-svelte .property {
14
+ color: #005cc5;
15
+ }
@@ -0,0 +1,42 @@
1
+ import { type Options as VitePluginSvelteOptions } from "@sveltejs/vite-plugin-svelte";
2
+ import { type Plugin } from "vite";
3
+ interface SvelteReadmeOptions {
4
+ /**
5
+ * set the folder to emit the files
6
+ * @default "dist"
7
+ */
8
+ outDir: string;
9
+ /**
10
+ * custom CSS appended to the <style> block
11
+ * @default ""
12
+ */
13
+ style: string;
14
+ /**
15
+ * set to `true` to omit the default GitHub styles
16
+ * @default false
17
+ */
18
+ disableDefaultCSS: boolean;
19
+ /**
20
+ * value to prepend to relative URLs (i.e. GitHub repo URL)
21
+ * @default undefined
22
+ */
23
+ prefixUrl: string;
24
+ /**
25
+ * Called with the source of each `svelte` code fence before it's highlighted for display,
26
+ * so it can be pretty-printed with your own formatter (e.g. Prettier). The code fence is
27
+ * displayed unformatted if this is omitted or its result rejects/throws.
28
+ * @default undefined
29
+ */
30
+ format: (source: string) => string | Promise<string>;
31
+ /**
32
+ * `@sveltejs/vite-plugin-svelte` options
33
+ * @default {}
34
+ */
35
+ svelte: VitePluginSvelteOptions;
36
+ /**
37
+ * Append content to the `head` element in `index.html`
38
+ */
39
+ head: string;
40
+ }
41
+ export declare function svelteReadme(opts?: Partial<SvelteReadmeOptions>): Plugin[];
42
+ export {};
@@ -0,0 +1,12 @@
1
+ .language-typescript,
2
+ .language-javascript {
3
+ color: #0550ae;
4
+ }
5
+ .language-typescript .string,
6
+ .language-javascript .string {
7
+ color: #0a3069;
8
+ }
9
+ .language-typescript .class-name,
10
+ .language-javascript .class-name {
11
+ color: #24292f;
12
+ }
@@ -0,0 +1,26 @@
1
+ export type Node = Record<string, any> & {
2
+ start: number;
3
+ end: number;
4
+ type: string;
5
+ };
6
+ export declare const aliases: Record<string, string>;
7
+ export declare function highlightCode(source: string, langId: string): string;
8
+ export declare function escapeForTemplateLiteral(text: string): string;
9
+ export declare function escapeRegExp(value: string): string;
10
+ export declare function isRelativeUrl(url: string): boolean;
11
+ export declare const getChildNodeText: (node: Node) => any;
12
+ export type Declaration = {
13
+ name: string;
14
+ start: number;
15
+ end: number;
16
+ };
17
+ export type IdentifierRange = {
18
+ start: number;
19
+ end: number;
20
+ name: string;
21
+ replacement?: string;
22
+ };
23
+ export declare const collectTopLevelDeclarations: (program: Node) => Declaration[];
24
+ export declare const computeRenameMap: (declarations: Declaration[], source: string, declaredVariables: Map<string, string>, reservedNames: Set<string>) => Map<string, string>;
25
+ export declare const collectIdentifierRanges: (root: Node, renameMap: Map<string, string>) => IdentifierRange[];
26
+ export declare const applyRenames: (source: string, ranges: IdentifierRange[], renameMap: Map<string, string>) => string;
@@ -0,0 +1 @@
1
+ export declare function purgeUnusedCss(rawCss: string, html: string): string;
@@ -0,0 +1,10 @@
1
+ export declare function toArray<T>(value: T | T[] | undefined): T[];
2
+ export declare function getPackageJSON(): {
3
+ name: any;
4
+ svelte: any;
5
+ description: any;
6
+ homepage: any;
7
+ repoUrl: any;
8
+ };
9
+ export declare function collapseWhitespace(html: string): string;
10
+ export declare function logSSRFallback(error: unknown): void;
package/dist/yaml.css ADDED
@@ -0,0 +1,3 @@
1
+ .language-yaml {
2
+ color: #0550ae;
3
+ }