jaamd 0.1.12 → 0.1.13

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.
Files changed (2) hide show
  1. package/index.ts +11 -11
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -13,10 +13,9 @@ export interface JaamdOptions {
13
13
 
14
14
  /**
15
15
  * Shiki syntax-highlighting theme family.
16
- * Selects between `github-light` and `github-dark`.
17
- * @default "light"
16
+ * @default "github-light"
18
17
  */
19
- theme?: "light" | "dark";
18
+ theme?: string;
20
19
 
21
20
  /**
22
21
  * Skip injecting the default CSS variable fallbacks (`jaamd/default`).
@@ -48,7 +47,12 @@ export interface JaamdOptions {
48
47
  * Supports `astro add jaamd`.
49
48
  */
50
49
  export default function jaamd(options: JaamdOptions = {}): AstroIntegration {
51
- const { selector = ".jaamd-content", theme = "light", noDefault = false, plugins = {} } = options;
50
+ const {
51
+ selector = ".jaamd-content",
52
+ theme = "github-light",
53
+ noDefault = false,
54
+ plugins = {},
55
+ } = options;
52
56
  const { codeTabs = true, alerts = true, directive = true } = plugins;
53
57
 
54
58
  return {
@@ -67,14 +71,10 @@ export default function jaamd(options: JaamdOptions = {}): AstroIntegration {
67
71
  const existingRemarkPlugins: any[] = existingMarkdown.remarkPlugins ?? [];
68
72
  const existingShikiConfig: any = existingMarkdown.shikiConfig ?? {};
69
73
 
70
- // Build shikiConfig: jaamd values are true defaults
71
- // only apply when the key is absent (undefined).
72
- // If the user (or a prior integration) already set a key,
73
- // that value is preserved as-is.
74
- const shikiTheme = theme === "dark" ? "github-dark" : "github-light";
74
+ // `wrap` and other keys are only filled in when absent.
75
75
  const mergedShikiConfig: any = { ...existingShikiConfig };
76
- if (mergedShikiConfig.theme === undefined) mergedShikiConfig.theme = shikiTheme;
77
- if (mergedShikiConfig.wrap === undefined) mergedShikiConfig.wrap = true;
76
+ mergedShikiConfig.theme = theme;
77
+ if (mergedShikiConfig.wrap === undefined) mergedShikiConfig.wrap = true;
78
78
 
79
79
  updateConfig({
80
80
  vite: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jaamd",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Just Another Astro Markdown",
5
5
  "type": "module",
6
6
  "license": "MIT",