histoire 1.0.0-alpha.1 → 1.0.0-alpha.2
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/dist/node/markdown.d.ts.map +1 -1
- package/dist/node/markdown.js +5 -6
- package/dist/node/vite.js +1 -1
- package/package.json +6 -6
- package/src/node/markdown.ts +5 -6
- package/src/node/vite.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/node/markdown.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAA;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAK3C,OAAO,UAAU,MAAM,aAAa,CAAA;AAapC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,OAAO,QAE1D;AAQD,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/node/markdown.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAA;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAK3C,OAAO,UAAU,MAAM,aAAa,CAAA;AAapC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,OAAO,QAE1D;AAQD,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,OAAO,uBAsExD;AAaD,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,OAAO,8BAqBvD;AAED,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,OAAO;;GAgI5D;AAED,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAA"}
|
package/dist/node/markdown.js
CHANGED
|
@@ -9,7 +9,7 @@ import { full as emoji } from 'markdown-it-emoji';
|
|
|
9
9
|
import micromatch from 'micromatch';
|
|
10
10
|
import path from 'pathe';
|
|
11
11
|
import pc from 'picocolors';
|
|
12
|
-
import {
|
|
12
|
+
import { bundledLanguages, createHighlighter } from 'shiki';
|
|
13
13
|
import { addStory, notifyStoryChange, removeStory } from './stories.js';
|
|
14
14
|
import { slugify } from './util/slugify.js';
|
|
15
15
|
const onMarkdownListChangeHandlers = [];
|
|
@@ -22,13 +22,12 @@ function notifyMarkdownListChange() {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
export async function createMarkdownRenderer(ctx) {
|
|
25
|
-
const highlighter = await
|
|
26
|
-
|
|
25
|
+
const highlighter = await createHighlighter({
|
|
26
|
+
themes: ['github-dark'],
|
|
27
|
+
langs: Object.keys(bundledLanguages), // not ideal but markdown-it does not provide async highlight
|
|
27
28
|
});
|
|
28
29
|
const md = new MarkdownIt({
|
|
29
|
-
highlight: (code, lang) => `<div class="htw-relative htw-not-prose __histoire-code"><div class="htw-absolute htw-top-0 htw-right-0 htw-text-xs htw-text-white/40">${lang}</div>${highlighter.codeToHtml(code, {
|
|
30
|
-
lang,
|
|
31
|
-
})}</div>`,
|
|
30
|
+
highlight: (code, lang) => `<div class="htw-relative htw-not-prose __histoire-code"><div class="htw-absolute htw-top-0 htw-right-0 htw-text-xs htw-text-white/40">${lang}</div>${highlighter.codeToHtml(code, { theme: 'github-dark', lang })}</div>`,
|
|
32
31
|
linkify: true,
|
|
33
32
|
html: true,
|
|
34
33
|
breaks: false,
|
package/dist/node/vite.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "histoire",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.2",
|
|
5
5
|
"description": "A fast story book powered by Vite",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Guillaume Chau"
|
|
@@ -62,13 +62,13 @@
|
|
|
62
62
|
"pathe": "^1.1.2",
|
|
63
63
|
"picocolors": "^1.1.1",
|
|
64
64
|
"sade": "^1.8.1",
|
|
65
|
-
"shiki
|
|
65
|
+
"shiki": "^3.0.0",
|
|
66
66
|
"sirv": "^3.0.0",
|
|
67
67
|
"vite-node": "0.34.7",
|
|
68
|
-
"@histoire/app": "^1.0.0-alpha.
|
|
69
|
-
"@histoire/
|
|
70
|
-
"@histoire/
|
|
71
|
-
"@histoire/
|
|
68
|
+
"@histoire/app": "^1.0.0-alpha.2",
|
|
69
|
+
"@histoire/shared": "^1.0.0-alpha.2",
|
|
70
|
+
"@histoire/vendors": "^1.0.0-alpha.2",
|
|
71
|
+
"@histoire/controls": "^1.0.0-alpha.2"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@types/fs-extra": "^11.0.4",
|
package/src/node/markdown.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { full as emoji } from 'markdown-it-emoji'
|
|
|
12
12
|
import micromatch from 'micromatch'
|
|
13
13
|
import path from 'pathe'
|
|
14
14
|
import pc from 'picocolors'
|
|
15
|
-
import {
|
|
15
|
+
import { bundledLanguages, createHighlighter } from 'shiki'
|
|
16
16
|
import { addStory, notifyStoryChange, removeStory } from './stories.js'
|
|
17
17
|
import { slugify } from './util/slugify.js'
|
|
18
18
|
|
|
@@ -29,14 +29,13 @@ function notifyMarkdownListChange() {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export async function createMarkdownRenderer(ctx: Context) {
|
|
32
|
-
const highlighter = await
|
|
33
|
-
|
|
32
|
+
const highlighter = await createHighlighter({
|
|
33
|
+
themes: ['github-dark'],
|
|
34
|
+
langs: Object.keys(bundledLanguages), // not ideal but markdown-it does not provide async highlight
|
|
34
35
|
})
|
|
35
36
|
|
|
36
37
|
const md = new MarkdownIt({
|
|
37
|
-
highlight: (code, lang) => `<div class="htw-relative htw-not-prose __histoire-code"><div class="htw-absolute htw-top-0 htw-right-0 htw-text-xs htw-text-white/40">${lang}</div>${highlighter.codeToHtml(code, {
|
|
38
|
-
lang,
|
|
39
|
-
})}</div>`,
|
|
38
|
+
highlight: (code, lang) => `<div class="htw-relative htw-not-prose __histoire-code"><div class="htw-absolute htw-top-0 htw-right-0 htw-text-xs htw-text-white/40">${lang}</div>${highlighter.codeToHtml(code, { theme: 'github-dark', lang })}</div>`,
|
|
40
39
|
linkify: true,
|
|
41
40
|
html: true,
|
|
42
41
|
breaks: false,
|
package/src/node/vite.ts
CHANGED