@kolkrabbi/kol-workshop 0.1.0 → 0.1.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 CHANGED
@@ -4,9 +4,14 @@ The KOL **workshop / docs system**, lifted from the monorepo `apps/web` into the
4
4
 
5
5
  A handrolled documentation engine — no `remark`, no `gray-matter`, no `fuse.js` — plus (in later phases) the docs shell, search, and a tag system including a d3 tag graph. Sits above the other four UI packages and consumes them.
6
6
 
7
- ## Status
7
+ ## What's in the box
8
8
 
9
- **Phase 1 — the pure engine (this release).** React-free, zero-dependency:
9
+ Two entry points:
10
+
11
+ - **`@kolkrabbi/kol-workshop/engine`** — the pure, React-free, zero-dependency core.
12
+ - **`@kolkrabbi/kol-workshop`** — the React layer (docs viewer, shell, tag system) built on the engine.
13
+
14
+ ### Engine (`/engine`)
10
15
 
11
16
  | Import | What |
12
17
  | --- | --- |
@@ -16,23 +21,30 @@ A handrolled documentation engine — no `remark`, no `gray-matter`, no `fuse.js
16
21
  | `buildInventoryCounts(inv)` | status / category / content-type tallies |
17
22
  | `getTagColor`, `extractDocNumber`, `cleanTitle`, `groupDocsByMajor`, … | doc/tag helpers |
18
23
 
19
- ```js
20
- import { parseDocsMarkdown, buildInventory } from '@kolkrabbi/kol-workshop/engine'
21
- ```
24
+ ### React layer (`.`)
25
+
26
+ | Import | What |
27
+ | --- | --- |
28
+ | `DocumentationReader` | the docs viewer — renders one doc from the inventory (article + header + frontmatter + token render) |
29
+ | `ShellLayout`, `ShellSidebar` | the docs shell composition (adapts the DS `ShellHeader`/`ShellDrawer`/`ShellSearchOverlay`) |
30
+ | `TagModeProvider`, `TagModeGate`, `TagModeOverlay`, `TagGraph` | the tag system, incl. the d3 tag graph |
31
+ | `WorkshopSidebar`, `WorkshopDefaultSidebar` | example sidebar compositions to copy |
32
+
33
+ The React layer imports its chrome (`Icon`/`Tag`/`CodeBlock`/`Divider`/`DocsToc` from `kol-component`, `ShellHeader` from `kol-framework`) from the DS packages — it keeps **no** local copies. Chrome CSS ships in `@kolkrabbi/kol-theme` (`kol-components-workshop.css`, already in the theme aggregate).
22
34
 
23
- ### Content-injection seam
35
+ ## The content-injection seam
24
36
 
25
- The package is **Vite-agnostic** — it never globs your docs. The consumer supplies the raw-markdown module map:
37
+ The package is **Vite-agnostic — it never globs your docs.** The consumer owns the `import.meta.glob` and injects the result as props:
26
38
 
27
39
  ```js
28
- const modules = import.meta.glob('/docs/**/*.md', { eager: true, query: '?raw', import: 'default' })
40
+ import { buildInventory } from '@kolkrabbi/kol-workshop/engine'
41
+ import { DocumentationReader, TagModeProvider } from '@kolkrabbi/kol-workshop'
42
+
43
+ const modules = import.meta.glob('/docs/**/*.md', { eager: true, query: '?raw', import: 'default' })
29
44
  const inventory = buildInventory(modules)
45
+ // pass inventory + routes/basePath + docHref(id) + tagHref(tag) into the components
30
46
  ```
31
47
 
32
- ## Roadmap
33
-
34
- - **Phase 2** — the shell + docs viewer + tag-mode components, KOL-conformed (Button / Icon-v1 / no text-transform), chrome CSS moved into `@kolkrabbi/kol-theme`.
35
- - **Phase 3** — content-injection seam extended to route + search config.
36
- - **Phase 4** — flip `private` off, publish, repoint the monorepo `apps/web` onto it, delete the local copies.
48
+ So the package ships the **engine + chrome**, never the content — bring your own docs.
37
49
 
38
50
  Self-check: `node src/engine/__check.mjs`.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-workshop",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
- "description": "KOL workshop/docs system — handrolled markdown engine, search, tag system, and the docs shell. Sits above @kolkrabbi/kol-{theme,icons,component,framework}. Private until the conformance sweep (Phase 4) ships it.",
5
+ "description": "KOL workshop/docs system — a handrolled markdown engine, search, tag system (incl. a d3 tag graph), docs viewer, and docs shell. Sits above @kolkrabbi/kol-{theme,icons,component,framework}; content is consumer-injected (the package never globs docs).",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "main": "./src/index.js",
@@ -14,9 +14,10 @@
14
14
  "dependencies": {
15
15
  "d3": "^7.9.0",
16
16
  "@kolkrabbi/kol-component": "0.7.0",
17
- "@kolkrabbi/kol-framework": "0.3.2",
17
+ "@kolkrabbi/kol-brand": "0.1.0",
18
18
  "@kolkrabbi/kol-icons": "0.5.0",
19
- "@kolkrabbi/kol-theme": "0.7.0"
19
+ "@kolkrabbi/kol-theme": "0.7.1",
20
+ "@kolkrabbi/kol-framework": "0.3.2"
20
21
  },
21
22
  "peerDependencies": {
22
23
  "react": "^18.3.0 || ^19.0.0",
@@ -4,6 +4,7 @@ import { Icon } from '@kolkrabbi/kol-icons'
4
4
  import { ShellHeader } from '@kolkrabbi/kol-framework'
5
5
  import ShellSidebar from './ShellSidebar.jsx'
6
6
  import { ShellDrawer, ShellSearchOverlay } from '@kolkrabbi/kol-component'
7
+ import { Asset } from '@kolkrabbi/kol-brand/svg'
7
8
 
8
9
  // Pages can register right-rail TOC content via this context.
9
10
  // Usage: const setTocContent = useContext(ShellTocContext)
@@ -100,10 +101,16 @@ const ShellLayout = ({ routes = [], basePath = '/', brandLogoSrc, brandLogoAlt =
100
101
  }
101
102
  }
102
103
  const brand = (
103
- <Link to={basePath} className="shell-header-logo flex items-center gap-2">
104
- {brandLogoSrc
105
- ? <img src={brandLogoSrc} alt={brandLogoAlt} className="h-6 w-auto" />
106
- : <span className="kol-helper-12 text-emphasis">{brandLogoAlt || 'Workshop'}</span>}
104
+ <Link to={basePath} className="shell-header-logo flex items-center gap-2 text-emphasis">
105
+ {brandLogoSrc ? (
106
+ <img src={brandLogoSrc} alt={brandLogoAlt} className="h-6 w-auto" />
107
+ ) : (
108
+ <>
109
+ <Asset name="kol-wordmark" title="Kolkrabbi" className="inline-flex [&>svg]:h-5 [&>svg]:w-auto" />
110
+ <span className="text-fg-24" aria-hidden="true">/</span>
111
+ <Asset name="wordmark-workshop" title="Workshop" className="inline-flex [&>svg]:h-4 [&>svg]:w-auto" />
112
+ </>
113
+ )}
107
114
  </Link>
108
115
  )
109
116
  const searchTrigger = (