@erclx/canon 4.66.0 → 4.67.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/src/teach/nav.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { existsSync } from 'node:fs'
2
2
  import { readFile, writeFile } from 'node:fs/promises'
3
3
  import { join, relative } from 'node:path'
4
+ import { TEACH_STYLESHEET_COMPONENTS } from '@/design/components'
4
5
  import { buildDesignCss } from '@/design/css'
5
6
  import { parseFrontmatter, readField } from '@/indexes/frontmatter'
7
+ import { TEACH_FONT_FACES } from '@/teach/fonts'
6
8
  import {
7
9
  listWorkspaces,
8
10
  readWorkspace,
@@ -500,7 +502,7 @@ function renderRootPage(workspaces: readonly WorkspaceSummary[]): string {
500
502
  })
501
503
  .join('')
502
504
 
503
- return `${pageHead('Learning workspaces', undefined, buildDesignCss(undefined, { embedFonts: true }))}<body>
505
+ return `${pageHead('Learning workspaces', TEACH_STYLESHEET, undefined)}<body>
504
506
  ${renderHeader(segments, track)}
505
507
  <main class="wide-body">
506
508
 
@@ -784,6 +786,14 @@ export async function generateNav(
784
786
  const rootPath = join(dir, 'index.html')
785
787
  await writeFile(rootPath, renderRootPage(listed.workspaces))
786
788
 
789
+ await writeFile(
790
+ join(dir, TEACH_STYLESHEET),
791
+ buildDesignCss(undefined, {
792
+ embedFonts: TEACH_FONT_FACES,
793
+ components: TEACH_STYLESHEET_COMPONENTS,
794
+ }),
795
+ )
796
+
787
797
  const contents: string[] = []
788
798
  const skipped: LessonSkipped[] = []
789
799
  let lessons = 0
@@ -1,10 +1,12 @@
1
1
  import { existsSync } from 'node:fs'
2
2
  import { mkdir, readdir, readFile, writeFile } from 'node:fs/promises'
3
3
  import { join, relative } from 'node:path'
4
+ import { TEACH_STYLESHEET_COMPONENTS } from '@/design/components'
4
5
  import { buildDesignCss } from '@/design/css'
5
6
  import { parseFrontmatter, readField } from '@/indexes/frontmatter'
6
7
  import { type BodyLine, bodyLines } from '@/markdown/scan'
7
8
  import { recordDir } from '@/record-root'
9
+ import { TEACH_FONT_FACES } from '@/teach/fonts'
8
10
 
9
11
  export const TEACH_REFUSALS = [
10
12
  'no-teach',
@@ -1046,7 +1048,8 @@ export async function writeStylesheet(
1046
1048
  path,
1047
1049
  buildDesignCss(undefined, {
1048
1050
  banner: STYLESHEET_BANNER,
1049
- embedFonts: true,
1051
+ embedFonts: TEACH_FONT_FACES,
1052
+ components: TEACH_STYLESHEET_COMPONENTS,
1050
1053
  }),
1051
1054
  )
1052
1055