@graphql-markdown/nuxt-theme 0.2.1 → 0.2.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.
|
@@ -79,12 +79,13 @@ const { copy: copyVariables, copyButtonProps: variablesCopyButtonProps } =
|
|
|
79
79
|
</script>
|
|
80
80
|
|
|
81
81
|
<style>
|
|
82
|
-
/*
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
/* The card supplies background and spacing; Shiki's inline `<pre>` style is
|
|
83
|
+
removed by a transformer, so no `!important` is needed. The selectors reach
|
|
84
|
+
into `v-html` output, so they cannot be scoped. */
|
|
85
|
+
/* fallow-ignore-next-line css-selector-complexity -- targets Shiki v-html output */
|
|
85
86
|
.blueprint-code pre {
|
|
86
|
-
background: transparent
|
|
87
|
-
color: var(--gqlmd-code-text)
|
|
87
|
+
background: transparent;
|
|
88
|
+
color: var(--gqlmd-code-text);
|
|
88
89
|
line-height: normal;
|
|
89
90
|
margin: 0;
|
|
90
91
|
padding: 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { codeToHtml } from "shiki";
|
|
1
|
+
import { codeToHtml, type ShikiTransformer } from "shiki";
|
|
2
2
|
import type { Ref } from "vue";
|
|
3
3
|
import {
|
|
4
4
|
CODE_COLUMN_SECTIONS,
|
|
@@ -33,8 +33,22 @@ export const detectLanguage = (code: string): "graphql" | "json" => {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Drops the inline `style` Shiki puts on `<pre>` (theme background and text
|
|
38
|
+
* colour); the card supplies both, so no `!important` override is needed.
|
|
39
|
+
*/
|
|
40
|
+
const stripPreStyle: ShikiTransformer = {
|
|
41
|
+
pre(node) {
|
|
42
|
+
delete node.properties.style;
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
36
46
|
const highlight = async (code: string, shikiTheme: string): Promise<string> => {
|
|
37
|
-
return codeToHtml(code, {
|
|
47
|
+
return codeToHtml(code, {
|
|
48
|
+
lang: detectLanguage(code),
|
|
49
|
+
theme: shikiTheme,
|
|
50
|
+
transformers: [stripPreStyle],
|
|
51
|
+
});
|
|
38
52
|
};
|
|
39
53
|
|
|
40
54
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-markdown/nuxt-theme",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "A Nuxt layer for building GraphQL API reference sites",
|
|
5
5
|
"homepage": "https://graphql-markdown.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -46,20 +46,20 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@clack/prompts": "^1.0.0",
|
|
49
|
-
"@graphql-markdown/cli": "^1.2.
|
|
49
|
+
"@graphql-markdown/cli": "^1.2.2",
|
|
50
50
|
"@nuxt/content": "^3.16.2",
|
|
51
|
-
"@nuxt/kit": "^4.6.
|
|
51
|
+
"@nuxt/kit": "^4.6.4",
|
|
52
52
|
"@nuxt/ui": "^4.11.0",
|
|
53
53
|
"consola": "^3.4.2",
|
|
54
|
-
"shiki": "^4.
|
|
55
|
-
"tailwindcss": "^4.3.
|
|
54
|
+
"shiki": "^4.6.0",
|
|
55
|
+
"tailwindcss": "^4.3.5"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@graphql-markdown/tooling-config": "^1.0.0",
|
|
59
|
-
"nuxt": "^4.6.
|
|
59
|
+
"nuxt": "^4.6.4",
|
|
60
60
|
"typescript": "6.0.3",
|
|
61
61
|
"vue-router": "^5.4.0",
|
|
62
|
-
"vue-tsc": "^3.3.
|
|
62
|
+
"vue-tsc": "^3.3.14"
|
|
63
63
|
},
|
|
64
64
|
"engines": {
|
|
65
65
|
"node": ">=22.18.0"
|