radiant-docs 0.1.62 → 0.1.64

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "radiant-docs",
3
- "version": "0.1.62",
3
+ "version": "0.1.64",
4
4
  "description": "CLI tool for previewing Radiant documentation locally",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,5 +1,6 @@
1
1
  // @ts-check
2
2
  import { defineConfig } from "astro/config";
3
+ import { unified } from "@astrojs/markdown-remark";
3
4
  import sitemap from "@astrojs/sitemap";
4
5
  import tailwindcss from "@tailwindcss/vite";
5
6
  import mdx from "@astrojs/mdx";
@@ -13,6 +14,7 @@ import {
13
14
  isPublishableStaticAssetPath,
14
15
  validateMdxContent,
15
16
  } from "./src/lib/validation";
17
+ import { createDevPlaygroundProxyPlugin } from "./src/lib/dev-playground-proxy.mjs";
16
18
  import remarkCodeBlockComponent from "./src/lib/mdx/remark-code-block-component";
17
19
  import remarkDemoteH1 from "./src/lib/mdx/remark-demote-h1";
18
20
  import remarkResolveInternalLinks from "./src/lib/mdx/remark-resolve-internal-links";
@@ -309,6 +311,33 @@ function resolveDocsSiteConfig() {
309
311
  const docsSiteConfig = resolveDocsSiteConfig();
310
312
  globalThis.__RADIANT_DOCS_BASE_PATH__ = docsSiteConfig.base;
311
313
 
314
+ const markdownProcessor = unified({
315
+ remarkPlugins: [
316
+ remarkGfm,
317
+ remarkResolveInternalLinks,
318
+ remarkDemoteH1,
319
+ remarkStandaloneImageComponent,
320
+ remarkCodeBlockComponent,
321
+ ],
322
+ rehypePlugins: [
323
+ rehypeSlug,
324
+ rehypePrefixPreviewHeadingIds,
325
+ rehypeExternalLinks,
326
+ [
327
+ rehypeAutolinkHeadings,
328
+ {
329
+ behavior: "append",
330
+ content: headingAnchorContent,
331
+ properties: {
332
+ className: ["heading-anchor"],
333
+ ariaLabel: "Copy section link",
334
+ title: "Copy section link",
335
+ },
336
+ },
337
+ ],
338
+ ],
339
+ });
340
+
312
341
  const configuredStaticAssetHost =
313
342
  typeof process.env.STATIC_ASSET_HOST === "string" &&
314
343
  process.env.STATIC_ASSET_HOST.trim().length > 0
@@ -339,8 +368,15 @@ export default defineConfig({
339
368
  devToolbar: {
340
369
  enabled: false,
341
370
  },
371
+ markdown: {
372
+ processor: markdownProcessor,
373
+ },
342
374
  vite: {
343
- plugins: [tailwindcss(), copyContentAssets()],
375
+ plugins: [
376
+ tailwindcss(),
377
+ copyContentAssets(),
378
+ createDevPlaygroundProxyPlugin({ basePath: docsSiteConfig.base }),
379
+ ],
344
380
  optimizeDeps: {
345
381
  include: ["@paper-design/shaders"],
346
382
  },
@@ -355,32 +391,7 @@ export default defineConfig({
355
391
  preact({
356
392
  compat: true,
357
393
  }),
358
- mdx({
359
- remarkPlugins: [
360
- remarkGfm,
361
- remarkResolveInternalLinks,
362
- remarkDemoteH1,
363
- remarkStandaloneImageComponent,
364
- remarkCodeBlockComponent,
365
- ],
366
- rehypePlugins: [
367
- rehypeSlug,
368
- rehypePrefixPreviewHeadingIds,
369
- rehypeExternalLinks,
370
- [
371
- rehypeAutolinkHeadings,
372
- {
373
- behavior: "append",
374
- content: headingAnchorContent,
375
- properties: {
376
- className: ["heading-anchor"],
377
- ariaLabel: "Copy section link",
378
- title: "Copy section link",
379
- },
380
- },
381
- ],
382
- ],
383
- }),
394
+ mdx(),
384
395
  alpine({ entrypoint: "/src/entrypoint" }),
385
396
  icon(),
386
397
  ],