@pantoken/jekyll 0.1.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/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # @pantoken/jekyll
2
+
3
+ Emit the Instructure token stylesheet for a Jekyll site. Jekyll has no standard theming-variable
4
+ contract, so this delivers the tokens as drop-in assets: a Sass partial for `_sass/` and a plain CSS
5
+ file for `assets/css/`.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ npm i @pantoken/jekyll
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```ts
16
+ import { toJekyllAssets } from "@pantoken/jekyll";
17
+
18
+ for (const { path, content } of toJekyllAssets()) {
19
+ /* write `path` under your site root */
20
+ }
21
+ ```
22
+
23
+ Or via the CLI, straight into a site:
24
+
25
+ ```sh
26
+ pantoken generate jekyll --out ./my-site
27
+ ```
28
+
29
+ ## Output
30
+
31
+ Three files under the site root:
32
+
33
+ - `_sass/pantoken.scss` — a Sass partial (Instructure tokens as `$instui-*` variables). Import it
34
+ from your main stylesheet: `@import "pantoken";`.
35
+ - `assets/css/pantoken.css` — a plain stylesheet (`--instui-*` custom properties) for sites that
36
+ don't use Sass. Reference it from your layout.
37
+ - `assets/css/pantoken-prose.css` — an InstUI-look stylesheet for rendered content (tables,
38
+ headings, links, code) in a `.pantoken-prose` region. From `@pantoken/components`.
39
+
40
+ Use the Sass partial if your site compiles SCSS; use the plain CSS otherwise. Add the prose sheet
41
+ and wrap your content in `.pantoken-prose` for the InstUI content look.
42
+
43
+ ## API
44
+
45
+ - **`toJekyllAssets(): JekyllFile[]`** — build the token asset files (paths relative to the site
46
+ root).
47
+ - **`JekyllFile`** — a generated file: `path` (site-relative) and `content`.
48
+
49
+ ## Related
50
+
51
+ - Wraps `@pantoken/scss` (the Sass partial), `@pantoken/css` (the plain stylesheet), and
52
+ `@pantoken/components` (the content look).
53
+ - Mirrors `@pantoken/hugo`, the same idea for Hugo sites.
54
+
55
+ ## License
56
+
57
+ MIT
@@ -0,0 +1,28 @@
1
+ //#region src/index.d.ts
2
+ /** A generated file: a site-relative path and its contents. */
3
+ interface JekyllFile {
4
+ path: string;
5
+ content: string;
6
+ }
7
+ /**
8
+ * Build the token asset files for a Jekyll site (paths relative to the site root).
9
+ *
10
+ * @returns The Sass partial (`_sass/pantoken.scss`), the plain stylesheet
11
+ * (`assets/css/pantoken.css`), and the prose stylesheet (`assets/css/pantoken-prose.css`).
12
+ *
13
+ * @example Write the assets under a site root
14
+ * ```ts
15
+ * import { writeFileSync, mkdirSync } from "node:fs";
16
+ * import { dirname, join } from "node:path";
17
+ * import { toJekyllAssets } from "@pantoken/jekyll";
18
+ *
19
+ * for (const { path, content } of toJekyllAssets()) {
20
+ * const dest = join("./my-site", path);
21
+ * mkdirSync(dirname(dest), { recursive: true });
22
+ * writeFileSync(dest, content);
23
+ * }
24
+ * ```
25
+ */
26
+ declare function toJekyllAssets(): JekyllFile[];
27
+ //#endregion
28
+ export { JekyllFile, toJekyllAssets };
package/dist/index.mjs ADDED
@@ -0,0 +1,52 @@
1
+ import { css } from "@pantoken/css";
2
+ import { proseCss } from "@pantoken/components";
3
+ import { scss } from "@pantoken/scss";
4
+ //#region src/index.ts
5
+ /**
6
+ * `@pantoken/jekyll` — emit the Instructure token stylesheet for a Jekyll site.
7
+ *
8
+ * Jekyll has no standard theming-variable contract, so this delivers the tokens as drop-in assets:
9
+ * a Sass partial for `_sass/` (import it from your main stylesheet) and a plain CSS file for
10
+ * `assets/css/` (from `@pantoken/scss` and `@pantoken/css`), plus an InstUI-look prose stylesheet
11
+ * (from `@pantoken/components`) that styles content in a `.pantoken-prose` region.
12
+ *
13
+ * @module
14
+ * @experimental
15
+ */
16
+ /**
17
+ * Build the token asset files for a Jekyll site (paths relative to the site root).
18
+ *
19
+ * @returns The Sass partial (`_sass/pantoken.scss`), the plain stylesheet
20
+ * (`assets/css/pantoken.css`), and the prose stylesheet (`assets/css/pantoken-prose.css`).
21
+ *
22
+ * @example Write the assets under a site root
23
+ * ```ts
24
+ * import { writeFileSync, mkdirSync } from "node:fs";
25
+ * import { dirname, join } from "node:path";
26
+ * import { toJekyllAssets } from "@pantoken/jekyll";
27
+ *
28
+ * for (const { path, content } of toJekyllAssets()) {
29
+ * const dest = join("./my-site", path);
30
+ * mkdirSync(dirname(dest), { recursive: true });
31
+ * writeFileSync(dest, content);
32
+ * }
33
+ * ```
34
+ */
35
+ function toJekyllAssets() {
36
+ return [
37
+ {
38
+ path: "_sass/pantoken.scss",
39
+ content: scss
40
+ },
41
+ {
42
+ path: "assets/css/pantoken.css",
43
+ content: css
44
+ },
45
+ {
46
+ path: "assets/css/pantoken-prose.css",
47
+ content: proseCss({ scope: ".pantoken-prose" })
48
+ }
49
+ ];
50
+ }
51
+ //#endregion
52
+ export { toJekyllAssets };
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@pantoken/jekyll",
3
+ "version": "0.1.0",
4
+ "description": "Emit the Instructure token stylesheet for a Jekyll site (a _sass partial + a plain CSS asset).",
5
+ "license": "MIT",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "type": "module",
10
+ "exports": {
11
+ ".": "./dist/index.mjs",
12
+ "./package.json": "./package.json"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "dependencies": {
18
+ "@pantoken/components": "0.1.0",
19
+ "@pantoken/scss": "0.1.0",
20
+ "@pantoken/css": "0.1.0"
21
+ },
22
+ "devDependencies": {
23
+ "@types/node": "^24.13.3",
24
+ "typescript": "^6.0.3",
25
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.2.4",
26
+ "vite-plus": "0.2.4"
27
+ },
28
+ "scripts": {
29
+ "build": "vp pack",
30
+ "dev": "vp pack --watch",
31
+ "test": "vp test",
32
+ "check": "vp check"
33
+ }
34
+ }