@abreen/tada 1.17.1 → 1.18.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/README.md +38 -7
- package/assets/material-symbols/chevron_right_24px.svg +1 -0
- package/bin/tada.ts +16 -7
- package/bin/validators.ts +33 -0
- package/build/branding.ts +41 -0
- package/build/build-manifest.ts +9 -4
- package/build/{watch/compiler-types.d.ts → build-types.d.ts} +8 -5
- package/build/build-validation.ts +176 -0
- package/build/bundle.ts +75 -65
- package/build/config-loader.ts +3 -3
- package/build/custom-fonts.ts +8 -5
- package/build/generate-favicon.ts +7 -6
- package/build/generate-fonts.ts +8 -15
- package/build/generate-katex-assets.ts +19 -17
- package/build/generate-web-app-manifest.ts +3 -11
- package/build/lodash-template.ts +14 -0
- package/build/material-symbols.ts +7 -4
- package/build/output-publication.ts +238 -0
- package/build/pagefind.ts +49 -21
- package/build/pdf-text.ts +41 -1
- package/build/pipeline.ts +95 -101
- package/build/site-assets.ts +46 -0
- package/build/site-build.ts +267 -0
- package/build/source-model.ts +223 -244
- package/build/source-records.ts +69 -81
- package/build/template-globals.ts +3 -0
- package/build/templates.ts +5 -2
- package/build/toc-plugin.ts +21 -21
- package/build/types.d.ts +44 -38
- package/build/util.ts +0 -4
- package/build/utils/code.ts +38 -101
- package/build/utils/final-html.ts +171 -47
- package/build/utils/literate-java.ts +11 -7
- package/build/utils/markdown-partials.ts +4 -3
- package/build/utils/markdown.ts +6 -17
- package/build/utils/paths.ts +3 -0
- package/build/utils/plain-text.ts +18 -0
- package/build/utils/render.ts +227 -165
- package/build/utils/shiki-highlighter.ts +11 -0
- package/build/utils/source-template.ts +2 -2
- package/build/utils/trace-core.ts +8 -83
- package/build/utils/trace.ts +38 -95
- package/build/validate-config-links.ts +60 -20
- package/build/watch/build-incremental.ts +46 -103
- package/build/watch/compiler.ts +158 -37
- package/build/watch/engine.ts +207 -176
- package/build/watch/index.ts +9 -2
- package/build/watch/planner.ts +88 -144
- package/build/watch/runtime.ts +21 -34
- package/build/watch/types.d.ts +32 -64
- package/init/content/labs/00/VowelCounter.java.md +5 -2
- package/init/content/labs/00/index.md +3 -2
- package/init/content/labs/01/index.md +3 -2
- package/init/content/labs/02/index.md +3 -2
- package/init/content/lectures/01/index.md +3 -2
- package/init/content/lectures/02/index.md +3 -2
- package/package.json +4 -4
- package/schema/site.schema.json +18 -2
- package/src/_content.scss +463 -0
- package/src/_fonts.scss +90 -0
- package/src/_layout.scss +50 -35
- package/src/{material-symbols.scss → _material-symbols.scss} +7 -0
- package/src/appearance-picker/{style.scss → _index.scss} +1 -1
- package/src/code/{style.scss → _index.scss} +61 -0
- package/src/header/{_base.scss → _index.scss} +98 -6
- package/src/index.ts +1 -17
- package/src/navigate/{style.scss → _index.scss} +29 -3
- package/src/navigate/breadcrumbs.ts +129 -0
- package/src/navigate/eligible.ts +0 -40
- package/src/navigate/index.ts +38 -4
- package/src/navigate/lifecycle.ts +19 -2
- package/src/navigate/runtime.ts +57 -22
- package/src/page-update/index.ts +33 -20
- package/src/print/{style.scss → _index.scss} +3 -1
- package/src/search/index.ts +7 -0
- package/src/slides/{style.scss → _index.scss} +5 -0
- package/src/style.scss +24 -536
- package/src/toc/index.ts +2 -2
- package/templates/_author.html +2 -2
- package/templates/_download.html +1 -1
- package/templates/_footer.html +1 -1
- package/templates/_heading.html +17 -4
- package/templates/_nav.html +2 -2
- package/templates/_page-bottom.html +6 -0
- package/templates/_top.html +18 -14
- package/templates/code.html +22 -21
- package/templates/default.html +12 -11
- package/templates/literate.html +6 -5
- package/assets/material-symbols/south_east_20px.svg +0 -1
- package/build/copy.ts +0 -82
- package/build/generate-content-assets.ts +0 -121
- package/build/utils/content-files.ts +0 -170
- package/build/watch/assets.ts +0 -103
- package/build/watch/build-full.ts +0 -97
- package/build/watch/build-helpers.ts +0 -66
- package/build/watch/build-result.ts +0 -19
- package/build/watch/fs-commit.ts +0 -218
- package/build/watch/mutations.ts +0 -73
- package/build/watch/snapshot.ts +0 -201
- package/build/watch/validation.ts +0 -57
- package/src/code.scss +0 -60
- package/src/critical.scss +0 -5
- package/src/header/style.scss +0 -91
- /package/src/{literate.scss → _literate.scss} +0 -0
- /package/src/anchor/{style.scss → _index.scss} +0 -0
- /package/src/page-update/{style.scss → _index.scss} +0 -0
- /package/src/question/{style.scss → _index.scss} +0 -0
- /package/src/search/{style.scss → _index.scss} +0 -0
- /package/src/timezone/{style.scss → _index.scss} +0 -0
- /package/src/toc/{style.scss → _index.scss} +0 -0
- /package/src/trace/{style.scss → _index.scss} +0 -0
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import { B } from '../colors';
|
|
3
|
-
import { makeLogger } from '../log';
|
|
4
|
-
import { config, getConfigFileName } from '../templates';
|
|
5
|
-
import { validateConfigLinks } from '../validate-config-links';
|
|
6
|
-
import { validateCustomFontOverrides } from '../custom-fonts';
|
|
7
|
-
import type { SiteVariables } from '../types';
|
|
8
|
-
import type { WatchDiagnostic } from './types';
|
|
9
|
-
import { assertNoOutputPathConflicts, type TadaProjectScan } from './snapshot';
|
|
10
|
-
|
|
11
|
-
const log = makeLogger(import.meta.url);
|
|
12
|
-
|
|
13
|
-
export function diagnosticsFromMessages(messages: string[]): WatchDiagnostic[] {
|
|
14
|
-
return messages.map(message => ({ message }));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function validateConfig(
|
|
18
|
-
scan: TadaProjectScan,
|
|
19
|
-
siteVariables: SiteVariables,
|
|
20
|
-
): WatchDiagnostic[] {
|
|
21
|
-
const diagnostics = diagnosticsFromMessages(
|
|
22
|
-
validateCustomFontOverrides({
|
|
23
|
-
fontOverrides: siteVariables.fontOverrides,
|
|
24
|
-
publicDir: scan.publicDir,
|
|
25
|
-
publicFiles: scan.publicFiles,
|
|
26
|
-
}),
|
|
27
|
-
);
|
|
28
|
-
const conflicts = assertNoOutputPathConflicts(scan);
|
|
29
|
-
if (conflicts.length === 0) {
|
|
30
|
-
return diagnostics;
|
|
31
|
-
}
|
|
32
|
-
for (const relPath of conflicts) {
|
|
33
|
-
const sources = [...scan.sourceOutputPaths]
|
|
34
|
-
.filter(([, outputs]) => outputs.has(relPath))
|
|
35
|
-
.map(([sourcePath]) =>
|
|
36
|
-
path.relative(path.dirname(scan.contentDir), sourcePath),
|
|
37
|
-
)
|
|
38
|
-
.sort();
|
|
39
|
-
log.error`${sources.join(' conflicts with ')}: same output path ${B`${relPath}`}`;
|
|
40
|
-
}
|
|
41
|
-
const noun = conflicts.length === 1 ? 'file' : 'files';
|
|
42
|
-
diagnostics.push({
|
|
43
|
-
message: `${conflicts.length} output ${noun} ${conflicts.length === 1 ? 'has' : 'have'} multiple sources with the same path`,
|
|
44
|
-
});
|
|
45
|
-
return diagnostics;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function validateProjectConfigLinks(
|
|
49
|
-
validTargets: Set<string>,
|
|
50
|
-
): WatchDiagnostic[] {
|
|
51
|
-
return diagnosticsFromMessages(
|
|
52
|
-
validateConfigLinks(validTargets, config('nav'), config('authors'), {
|
|
53
|
-
navFileName: getConfigFileName('nav'),
|
|
54
|
-
authorsFileName: getConfigFileName('authors'),
|
|
55
|
-
}),
|
|
56
|
-
);
|
|
57
|
-
}
|
package/src/code.scss
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
@use 'mixins' as *;
|
|
2
|
-
|
|
3
|
-
body.code {
|
|
4
|
-
--code-gutter-width: 4rem;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.file-header,
|
|
8
|
-
.slides-header {
|
|
9
|
-
display: flex;
|
|
10
|
-
gap: var(--gap);
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
padding: var(--gap);
|
|
14
|
-
margin-bottom: var(--gap);
|
|
15
|
-
border: 1px solid var(--fg2-color);
|
|
16
|
-
border-radius: var(--border-radius);
|
|
17
|
-
|
|
18
|
-
tt,
|
|
19
|
-
code {
|
|
20
|
-
padding: 0;
|
|
21
|
-
background: none;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.code-row {
|
|
26
|
-
display: grid;
|
|
27
|
-
grid-template-columns: var(--code-gutter-width) 1fr;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.line-number {
|
|
31
|
-
position: sticky;
|
|
32
|
-
left: 0;
|
|
33
|
-
z-index: 1;
|
|
34
|
-
display: block;
|
|
35
|
-
padding: 0 0.75em;
|
|
36
|
-
margin-right: var(--gap);
|
|
37
|
-
font-family: var(--mono-font);
|
|
38
|
-
font-size-adjust: var(--mono-font-size-adjust);
|
|
39
|
-
font-feature-settings: var(--mono-font-feature-settings);
|
|
40
|
-
color: var(--fg2-color);
|
|
41
|
-
text-align: right;
|
|
42
|
-
text-decoration: none;
|
|
43
|
-
background: var(--bg2-color);
|
|
44
|
-
border-right: 1px solid var(--fg2-color);
|
|
45
|
-
|
|
46
|
-
@include user-select(none);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
a.line-number {
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
|
|
52
|
-
&:hover {
|
|
53
|
-
color: var(--fg-color);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&:target {
|
|
57
|
-
color: var(--bg-color);
|
|
58
|
-
background: var(--fg2-color);
|
|
59
|
-
}
|
|
60
|
-
}
|
package/src/critical.scss
DELETED
package/src/header/style.scss
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
@use '../mixins' as *;
|
|
2
|
-
@use 'base';
|
|
3
|
-
|
|
4
|
-
header nav {
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-wrap: wrap;
|
|
7
|
-
|
|
8
|
-
@include user-select(none);
|
|
9
|
-
|
|
10
|
-
gap: var(--gap);
|
|
11
|
-
margin: var(--gap);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
header nav div {
|
|
15
|
-
flex: 1 1 150px;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
header nav ul {
|
|
19
|
-
padding: 0;
|
|
20
|
-
margin: 8px 0 0;
|
|
21
|
-
list-style-type: none;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
header nav ul li {
|
|
25
|
-
margin: 0;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
header nav a {
|
|
29
|
-
display: inline;
|
|
30
|
-
border: none;
|
|
31
|
-
|
|
32
|
-
@include subdued-link;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
header nav a.external {
|
|
36
|
-
border: none;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@media only screen and (width >= 740px) {
|
|
40
|
-
header details nav {
|
|
41
|
-
min-height: 100px;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
header nav div > p {
|
|
46
|
-
padding-bottom: 2px;
|
|
47
|
-
font-style: italic;
|
|
48
|
-
border-bottom: 1px solid var(--fg-color);
|
|
49
|
-
|
|
50
|
-
@include user-select(none);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
:root[data-contrast-preference='high'] header:has(details[open]) {
|
|
54
|
-
background: var(--bg2-color);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@media (hover: hover) {
|
|
58
|
-
header:has(details[open]):hover {
|
|
59
|
-
background: var(--bg-color-translucent);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
:root[data-contrast-preference='high'] header:hover {
|
|
63
|
-
background: var(--bg2-color);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
header .results-container {
|
|
68
|
-
position: absolute;
|
|
69
|
-
top: var(--header-collapsed-height);
|
|
70
|
-
right: 0;
|
|
71
|
-
left: 0;
|
|
72
|
-
z-index: 1000;
|
|
73
|
-
box-sizing: border-box;
|
|
74
|
-
display: block;
|
|
75
|
-
max-width: 640px;
|
|
76
|
-
padding: var(--gap);
|
|
77
|
-
margin: 0 auto;
|
|
78
|
-
pointer-events: none;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
header ol {
|
|
82
|
-
flex: 1;
|
|
83
|
-
min-height: 0;
|
|
84
|
-
padding: 0;
|
|
85
|
-
overflow-y: auto;
|
|
86
|
-
|
|
87
|
-
.excerpt {
|
|
88
|
-
height: 5ex;
|
|
89
|
-
line-height: 2.5ex;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|