@abreen/tada 1.17.0 → 1.18.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 (107) hide show
  1. package/README.md +41 -7
  2. package/bin/tada.ts +23 -9
  3. package/bin/validators.ts +34 -1
  4. package/build/branding.ts +41 -0
  5. package/build/build-manifest.ts +10 -5
  6. package/build/{watch/compiler-types.d.ts → build-types.d.ts} +8 -5
  7. package/build/build-validation.ts +176 -0
  8. package/build/bundle.ts +75 -65
  9. package/build/columns-plugin.ts +27 -1
  10. package/build/config-loader.ts +3 -3
  11. package/build/custom-fonts.ts +8 -5
  12. package/build/deflist-id-plugin.ts +2 -2
  13. package/build/generate-favicon.ts +7 -6
  14. package/build/generate-fonts.ts +8 -15
  15. package/build/generate-katex-assets.ts +19 -17
  16. package/build/generate-web-app-manifest.ts +3 -11
  17. package/build/lodash-template.ts +14 -0
  18. package/build/output-publication.ts +238 -0
  19. package/build/pagefind.ts +49 -21
  20. package/build/pdf-text.ts +41 -1
  21. package/build/pipeline.ts +95 -101
  22. package/build/site-assets.ts +46 -0
  23. package/build/site-build.ts +267 -0
  24. package/build/source-model.ts +223 -229
  25. package/build/source-records.ts +69 -81
  26. package/build/template-globals.ts +3 -0
  27. package/build/templates.ts +12 -8
  28. package/build/toc-plugin.ts +21 -21
  29. package/build/types.d.ts +38 -38
  30. package/build/util.ts +0 -4
  31. package/build/utils/code.ts +51 -117
  32. package/build/utils/final-html.ts +171 -47
  33. package/build/utils/jdi-runner/LiterateRunner.java +9 -1
  34. package/build/utils/literate-java.ts +11 -7
  35. package/build/utils/markdown-partials.ts +4 -3
  36. package/build/utils/markdown.ts +6 -17
  37. package/build/utils/paths.ts +3 -0
  38. package/build/utils/plain-text.ts +18 -0
  39. package/build/utils/render.ts +197 -154
  40. package/build/utils/shiki-highlighter.ts +11 -0
  41. package/build/utils/source-template.ts +2 -2
  42. package/build/utils/trace-core.ts +8 -83
  43. package/build/utils/trace.ts +38 -95
  44. package/build/validate-config-links.ts +39 -6
  45. package/build/watch/build-incremental.ts +46 -103
  46. package/build/watch/compiler.ts +158 -37
  47. package/build/watch/engine.ts +207 -162
  48. package/build/watch/index.ts +9 -2
  49. package/build/watch/planner.ts +88 -144
  50. package/build/watch/runtime.ts +21 -34
  51. package/build/watch/types.d.ts +32 -64
  52. package/package.json +4 -5
  53. package/schema/site.schema.json +18 -2
  54. package/src/_content.scss +447 -0
  55. package/src/_fonts.scss +90 -0
  56. package/src/_layout.scss +50 -35
  57. package/src/appearance-picker/{style.scss → _index.scss} +1 -1
  58. package/src/code/{style.scss → _index.scss} +61 -0
  59. package/src/header/{_base.scss → _index.scss} +98 -6
  60. package/src/index.ts +1 -17
  61. package/src/navigate/{style.scss → _index.scss} +20 -0
  62. package/src/navigate/eligible.ts +0 -40
  63. package/src/navigate/index.ts +50 -5
  64. package/src/navigate/lifecycle.ts +19 -2
  65. package/src/navigate/runtime.ts +20 -4
  66. package/src/page-update/index.ts +33 -20
  67. package/src/print/{style.scss → _index.scss} +3 -1
  68. package/src/search/index.ts +30 -2
  69. package/src/slides/{style.scss → _index.scss} +5 -0
  70. package/src/style.scss +24 -536
  71. package/src/timezone/index.ts +29 -3
  72. package/src/timezone/time-format.ts +4 -0
  73. package/src/toc/index.ts +6 -5
  74. package/src/trace/index.ts +11 -1
  75. package/templates/_author.html +2 -2
  76. package/templates/_download.html +1 -1
  77. package/templates/_footer.html +1 -1
  78. package/templates/_heading.html +3 -3
  79. package/templates/_nav.html +2 -2
  80. package/templates/_page-bottom.html +6 -0
  81. package/templates/_top.html +18 -14
  82. package/templates/code.html +22 -21
  83. package/templates/default.html +12 -11
  84. package/templates/literate.html +6 -5
  85. package/build/copy.ts +0 -82
  86. package/build/generate-content-assets.ts +0 -121
  87. package/build/utils/content-files.ts +0 -170
  88. package/build/watch/assets.ts +0 -103
  89. package/build/watch/build-full.ts +0 -97
  90. package/build/watch/build-helpers.ts +0 -66
  91. package/build/watch/build-result.ts +0 -19
  92. package/build/watch/fs-commit.ts +0 -153
  93. package/build/watch/mutations.ts +0 -73
  94. package/build/watch/snapshot.ts +0 -201
  95. package/build/watch/validation.ts +0 -50
  96. package/src/code.scss +0 -60
  97. package/src/critical.scss +0 -5
  98. package/src/header/style.scss +0 -91
  99. /package/src/{literate.scss → _literate.scss} +0 -0
  100. /package/src/{material-symbols.scss → _material-symbols.scss} +0 -0
  101. /package/src/anchor/{style.scss → _index.scss} +0 -0
  102. /package/src/page-update/{style.scss → _index.scss} +0 -0
  103. /package/src/question/{style.scss → _index.scss} +0 -0
  104. /package/src/search/{style.scss → _index.scss} +0 -0
  105. /package/src/timezone/{style.scss → _index.scss} +0 -0
  106. /package/src/toc/{style.scss → _index.scss} +0 -0
  107. /package/src/trace/{style.scss → _index.scss} +0 -0
@@ -1,50 +0,0 @@
1
- import { B } from '../colors';
2
- import { makeLogger } from '../log';
3
- import { config, getConfigFileName } from '../templates';
4
- import { validateConfigLinks } from '../validate-config-links';
5
- import { validateCustomFontOverrides } from '../custom-fonts';
6
- import type { SiteVariables } from '../types';
7
- import type { WatchDiagnostic } from './types';
8
- import { assertNoOutputPathConflicts, type TadaProjectScan } from './snapshot';
9
-
10
- const log = makeLogger(import.meta.url);
11
-
12
- export function diagnosticsFromMessages(messages: string[]): WatchDiagnostic[] {
13
- return messages.map(message => ({ message }));
14
- }
15
-
16
- export function validateConfig(
17
- scan: TadaProjectScan,
18
- siteVariables: SiteVariables,
19
- ): WatchDiagnostic[] {
20
- const diagnostics = diagnosticsFromMessages(
21
- validateCustomFontOverrides({
22
- fontOverrides: siteVariables.fontOverrides,
23
- publicDir: scan.publicDir,
24
- publicFiles: scan.publicFiles,
25
- }),
26
- );
27
- const conflicts = assertNoOutputPathConflicts(scan);
28
- if (conflicts.length === 0) {
29
- return diagnostics;
30
- }
31
- for (const relPath of conflicts) {
32
- log.error`content/${B`${relPath}`} conflicts with public/${B`${relPath}`}`;
33
- }
34
- const noun = conflicts.length === 1 ? 'file' : 'files';
35
- diagnostics.push({
36
- message: `${conflicts.length} ${noun} in content/ and public/ have the same path`,
37
- });
38
- return diagnostics;
39
- }
40
-
41
- export function validateProjectConfigLinks(
42
- validTargets: Set<string>,
43
- ): WatchDiagnostic[] {
44
- return diagnosticsFromMessages(
45
- validateConfigLinks(validTargets, config('nav'), config('authors'), {
46
- navFileName: getConfigFileName('nav'),
47
- authorsFileName: getConfigFileName('authors'),
48
- }),
49
- );
50
- }
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
@@ -1,5 +0,0 @@
1
- @use 'config/theme';
2
- @use 'base';
3
- @use 'layout';
4
- @use 'alerts';
5
- @use 'header/base' as *;
@@ -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