@analogjs/content 3.0.0-alpha.1 → 3.0.0-alpha.11

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 (103) hide show
  1. package/LICENSE +21 -0
  2. package/fesm2022/__vite-browser-external.mjs +9 -0
  3. package/fesm2022/analogjs-content-md4x.mjs +290 -0
  4. package/fesm2022/analogjs-content-mdc.mjs +170 -0
  5. package/fesm2022/analogjs-content-og.mjs +34 -46
  6. package/fesm2022/analogjs-content-prism-highlighter.mjs +81 -68
  7. package/fesm2022/analogjs-content-resources.mjs +115 -124
  8. package/fesm2022/analogjs-content-shiki-highlighter.mjs +9 -14
  9. package/fesm2022/analogjs-content.mjs +18538 -621
  10. package/fesm2022/api_vite.mjs +7 -0
  11. package/fesm2022/browser.mjs +6069 -0
  12. package/fesm2022/build2.mjs +5259 -0
  13. package/fesm2022/chunk.mjs +37 -0
  14. package/fesm2022/chunk2.mjs +41 -0
  15. package/fesm2022/jiti.mjs +4477 -0
  16. package/fesm2022/lib.mjs +365 -0
  17. package/fesm2022/main.mjs +2341 -0
  18. package/fesm2022/node.mjs +791 -0
  19. package/fesm2022/postcss-import.mjs +451 -0
  20. package/fesm2022/postcss.mjs +3236 -0
  21. package/fesm2022/prompt-BYQIwEjg.mjs +847 -0
  22. package/md4x/package.json +4 -0
  23. package/mdc/package.json +4 -0
  24. package/og/package.json +2 -2
  25. package/package.json +35 -9
  26. package/prism-highlighter/package.json +2 -2
  27. package/resources/package.json +2 -2
  28. package/shiki-highlighter/package.json +2 -2
  29. package/src/lib/devtools/content-devtools-client.ts +215 -0
  30. package/src/lib/devtools/content-devtools.styles.css +194 -0
  31. package/types/md4x/src/index.d.ts +5 -0
  32. package/types/md4x/src/lib/md4x-content-renderer.service.d.ts +33 -0
  33. package/types/md4x/src/lib/md4x-wasm-content-renderer.service.d.ts +16 -0
  34. package/types/md4x/src/lib/provide-md4x.d.ts +26 -0
  35. package/types/md4x/src/lib/streaming-markdown-renderer.d.ts +21 -0
  36. package/types/mdc/src/index.d.ts +2 -0
  37. package/types/mdc/src/lib/mdc-component-registry.d.ts +25 -0
  38. package/types/mdc/src/lib/mdc-renderer.directive.d.ts +33 -0
  39. package/types/og/src/index.d.ts +2 -0
  40. package/types/og/src/lib/og.d.ts +5 -0
  41. package/types/og/src/lib/options.d.ts +11 -0
  42. package/types/prism-highlighter/src/index.d.ts +8 -0
  43. package/types/prism-highlighter/src/lib/prism/angular.d.ts +1 -0
  44. package/types/prism-highlighter/src/lib/prism-highlighter.d.ts +8 -0
  45. package/types/resources/src/content-file-resource.d.ts +37 -0
  46. package/types/resources/src/content-files-resource.d.ts +3 -0
  47. package/types/resources/src/index.d.ts +2 -0
  48. package/types/shiki-highlighter/src/index.d.ts +7 -0
  49. package/types/src/index.d.ts +18 -0
  50. package/types/src/lib/anchor-navigation.directive.d.ts +9 -0
  51. package/types/src/lib/content-file-loader.d.ts +6 -0
  52. package/types/src/lib/content-file.d.ts +8 -0
  53. package/types/src/lib/content-files-list-token.d.ts +3 -0
  54. package/types/src/lib/content-files-token.d.ts +3 -0
  55. package/types/src/lib/content-list-loader.d.ts +7 -0
  56. package/types/src/lib/content-renderer.d.ts +33 -0
  57. package/types/src/lib/content.d.ts +14 -0
  58. package/types/src/lib/devtools/content-devtools-plugin.d.ts +23 -0
  59. package/types/src/lib/devtools/content-devtools-renderer.d.ts +23 -0
  60. package/types/src/lib/devtools/index.d.ts +23 -0
  61. package/types/src/lib/get-content-files.d.ts +14 -0
  62. package/types/src/lib/inject-content-files.d.ts +4 -0
  63. package/types/src/lib/markdown-content-renderer.service.d.ts +10 -0
  64. package/types/src/lib/markdown-route.component.d.ts +15 -0
  65. package/types/src/lib/markdown.component.d.ts +26 -0
  66. package/types/src/lib/marked-content-highlighter.d.ts +17 -0
  67. package/types/src/lib/marked-setup.service.d.ts +10 -0
  68. package/types/src/lib/parse-raw-content-file.d.ts +18 -0
  69. package/types/src/lib/provide-content.d.ts +7 -0
  70. package/types/src/lib/render-task.service.d.ts +8 -0
  71. package/types/src/lib/utils/zone-wait-for.d.ts +2 -0
  72. package/fesm2022/analogjs-content-og.mjs.map +0 -1
  73. package/fesm2022/analogjs-content-prism-highlighter.mjs.map +0 -1
  74. package/fesm2022/analogjs-content-resources.mjs.map +0 -1
  75. package/fesm2022/analogjs-content-shiki-highlighter.mjs.map +0 -1
  76. package/fesm2022/analogjs-content.mjs.map +0 -1
  77. package/og/README.md +0 -3
  78. package/plugin/README.md +0 -11
  79. package/plugin/migrations.json +0 -75
  80. package/plugin/package.json +0 -23
  81. package/plugin/src/index.d.ts +0 -2
  82. package/plugin/src/index.js +0 -4
  83. package/plugin/src/index.js.map +0 -1
  84. package/plugin/src/migrations/update-markdown-renderer-feature/compat.d.ts +0 -2
  85. package/plugin/src/migrations/update-markdown-renderer-feature/compat.js +0 -6
  86. package/plugin/src/migrations/update-markdown-renderer-feature/compat.js.map +0 -1
  87. package/plugin/src/migrations/update-markdown-renderer-feature/update-markdown-renderer-feature.d.ts +0 -2
  88. package/plugin/src/migrations/update-markdown-renderer-feature/update-markdown-renderer-feature.js +0 -48
  89. package/plugin/src/migrations/update-markdown-renderer-feature/update-markdown-renderer-feature.js.map +0 -1
  90. package/plugin/src/migrations/update-markdown-version/compat.d.ts +0 -2
  91. package/plugin/src/migrations/update-markdown-version/compat.js +0 -6
  92. package/plugin/src/migrations/update-markdown-version/compat.js.map +0 -1
  93. package/plugin/src/migrations/update-markdown-version/update-markdown-version.d.ts +0 -2
  94. package/plugin/src/migrations/update-markdown-version/update-markdown-version.js +0 -23
  95. package/plugin/src/migrations/update-markdown-version/update-markdown-version.js.map +0 -1
  96. package/prism-highlighter/README.md +0 -3
  97. package/resources/README.md +0 -3
  98. package/shiki-highlighter/README.md +0 -3
  99. package/types/analogjs-content-og.d.ts +0 -19
  100. package/types/analogjs-content-prism-highlighter.d.ts +0 -15
  101. package/types/analogjs-content-resources.d.ts +0 -20
  102. package/types/analogjs-content-shiki-highlighter.d.ts +0 -11
  103. package/types/analogjs-content.d.ts +0 -168
@@ -1,27 +1,25 @@
1
- import { MarkedContentHighlighter, NoopContentRenderer, ContentRenderer } from '@analogjs/content';
2
- import * as i0 from '@angular/core';
3
- import { Injectable } from '@angular/core';
4
- import { markedHighlight } from 'marked-highlight';
5
- import 'prismjs';
6
- import 'prismjs/plugins/toolbar/prism-toolbar';
7
- import 'prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard';
8
-
9
- class PrismHighlighter extends MarkedContentHighlighter {
10
- augmentCodeBlock(code, lang) {
11
- const classes = lang.startsWith('diff') && Prism.languages['diff']
12
- ? `language-${lang} diff-highlight`
13
- : `language-${lang.replace('diff-', '')}`;
14
- return `<pre class="${classes}"><code class="${classes}">${code}</code></pre>`;
15
- }
16
- getHighlightExtension() {
17
- return markedHighlight({
18
- async: true,
19
- highlight: (code, lang) => {
20
- let diff = lang?.startsWith('diff-');
21
- lang = diff ? lang.replace('diff-', '') : lang || 'typescript';
22
- if (diff && !Prism.languages['diff']) {
23
- diff = false;
24
- console.warn(`Notice:
1
+ import * as i0 from "@angular/core";
2
+ import { Injectable } from "@angular/core";
3
+ import { ContentRenderer, MarkedContentHighlighter, NoopContentRenderer } from "@analogjs/content";
4
+ import { markedHighlight } from "marked-highlight";
5
+ import Prism$1 from "prismjs";
6
+ import "prismjs/plugins/toolbar/prism-toolbar";
7
+ import "prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard";
8
+ //#region packages/content/prism-highlighter/src/lib/prism-highlighter.ts
9
+ var PrismHighlighter = class PrismHighlighter extends MarkedContentHighlighter {
10
+ augmentCodeBlock(code, lang) {
11
+ const classes = lang.startsWith("diff") && Prism.languages["diff"] ? `language-${lang} diff-highlight` : `language-${lang.replace("diff-", "")}`;
12
+ return `<pre class="${classes}"><code class="${classes}">${code}</code></pre>`;
13
+ }
14
+ getHighlightExtension() {
15
+ return markedHighlight({
16
+ async: true,
17
+ highlight: (code, lang) => {
18
+ let diff = lang?.startsWith("diff-");
19
+ lang = diff ? lang.replace("diff-", "") : lang || "typescript";
20
+ if (diff && !Prism.languages["diff"]) {
21
+ diff = false;
22
+ console.warn(`Notice:
25
23
  ---------------------------------------------------------------------------------------
26
24
  The \`diff\` language and plugin are not available in the provided setup.
27
25
  To enable it, add the following imports your \`app.config.ts\`:
@@ -29,57 +27,72 @@ class PrismHighlighter extends MarkedContentHighlighter {
29
27
  import 'prismjs/plugins/diff-highlight/prism-diff-highlight';
30
28
  ---------------------------------------------------------------------------------------
31
29
  `);
32
- }
33
- if (!Prism.languages[lang]) {
34
- if (lang !== 'mermaid') {
35
- console.warn(`Notice:
30
+ }
31
+ if (!Prism.languages[lang]) {
32
+ if (lang !== "mermaid") console.warn(`Notice:
36
33
  ---------------------------------------------------------------------------------------
37
34
  The requested language '${lang}' is not available in the provided setup.
38
35
  To enable it, add the following import your \`app.config.ts\`:
39
36
  import 'prismjs/components/prism-${lang}';
40
37
  ---------------------------------------------------------------------------------------
41
38
  `);
42
- }
43
- return code;
44
- }
45
- return Prism.highlight(code, diff ? Prism.languages['diff'] : Prism.languages[lang], lang);
46
- },
47
- });
48
- }
49
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: PrismHighlighter, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
50
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: PrismHighlighter }); }
51
- }
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: PrismHighlighter, decorators: [{
53
- type: Injectable
54
- }] });
55
-
56
- "use strict";
57
- (function () {
58
- if (typeof Prism === 'undefined') {
59
- return;
60
- }
61
- Prism.languages.angular = Prism.languages.extend('markup', {
62
- keyword: /(?:@if|@for|@switch|@defer|@loading|@error|@placeholder|prefetch)\b/,
63
- operator: /\b(?:on|when)\b/,
64
- number: {
65
- pattern: /\b(minimum|after)\s+\d+(?:s|ms|)/gi,
66
- lookbehind: true,
67
- },
68
- builtin: {
69
- pattern: /\b(?:viewport|timer|minimum|after|hover|idle|immediate|interaction)/,
70
- },
71
- function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
72
- });
73
- Prism.languages.ng = Prism.languages.angular;
39
+ return code;
40
+ }
41
+ return Prism.highlight(code, diff ? Prism.languages["diff"] : Prism.languages[lang], lang);
42
+ }
43
+ });
44
+ }
45
+ static {
46
+ this.ɵfac = i0.ɵɵngDeclareFactory({
47
+ minVersion: "12.0.0",
48
+ version: "21.1.1",
49
+ ngImport: i0,
50
+ type: PrismHighlighter,
51
+ deps: null,
52
+ target: i0.ɵɵFactoryTarget.Injectable
53
+ });
54
+ }
55
+ static {
56
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
57
+ minVersion: "12.0.0",
58
+ version: "21.1.1",
59
+ ngImport: i0,
60
+ type: PrismHighlighter
61
+ });
62
+ }
63
+ };
64
+ i0.ɵɵngDeclareClassMetadata({
65
+ minVersion: "12.0.0",
66
+ version: "21.1.1",
67
+ ngImport: i0,
68
+ type: PrismHighlighter,
69
+ decorators: [{ type: Injectable }]
70
+ });
71
+ //#endregion
72
+ //#region packages/content/prism-highlighter/src/lib/prism/angular.ts
73
+ (function() {
74
+ if (typeof Prism$1 === "undefined") return;
75
+ Prism$1.languages["angular"] = Prism$1.languages.extend("markup", {
76
+ keyword: /(?:@if|@for|@switch|@defer|@loading|@error|@placeholder|prefetch)\b/,
77
+ operator: /\b(?:on|when)\b/,
78
+ number: {
79
+ pattern: /\b(minimum|after)\s+\d+(?:s|ms|)/gi,
80
+ lookbehind: true
81
+ },
82
+ builtin: { pattern: /\b(?:viewport|timer|minimum|after|hover|idle|immediate|interaction)/ },
83
+ function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/
84
+ });
85
+ Prism$1.languages["ng"] = Prism$1.languages["angular"];
74
86
  })();
75
-
87
+ //#endregion
88
+ //#region packages/content/prism-highlighter/src/index.ts
76
89
  function withPrismHighlighter() {
77
- return [{ provide: ContentRenderer, useClass: NoopContentRenderer }];
90
+ return [{
91
+ provide: ContentRenderer,
92
+ useClass: NoopContentRenderer
93
+ }];
78
94
  }
79
-
80
- /**
81
- * Generated bundle index. Do not edit.
82
- */
83
-
95
+ //#endregion
84
96
  export { PrismHighlighter, withPrismHighlighter };
85
- //# sourceMappingURL=analogjs-content-prism-highlighter.mjs.map
97
+
98
+ //# sourceMappingURL=analogjs-content-prism-highlighter.mjs.map
@@ -1,129 +1,120 @@
1
- import { resource, inject, computed } from '@angular/core';
2
- import { injectContentListLoader, parseRawContentFile, injectContentFileLoader, ContentRenderer } from '@analogjs/content';
3
- import { ActivatedRoute } from '@angular/router';
4
- import { toSignal } from '@angular/core/rxjs-interop';
5
- import { from } from 'rxjs';
6
- import { map } from 'rxjs/operators';
7
-
1
+ import { computed, inject, resource } from "@angular/core";
2
+ import { ActivatedRoute } from "@angular/router";
3
+ import { from } from "rxjs";
4
+ import { map } from "rxjs/operators";
5
+ import { toSignal } from "@angular/core/rxjs-interop";
6
+ import { ContentRenderer, FrontmatterValidationError, injectContentFileLoader, injectContentListLoader, parseRawContentFile, parseRawContentFileAsync } from "@analogjs/content";
7
+ //#region packages/content/resources/src/content-files-resource.ts
8
8
  function contentFilesResource(filterFn) {
9
- const contentListLoader = injectContentListLoader();
10
- const contentList = contentListLoader().then((items) => filterFn ? items.filter(filterFn) : items);
11
- return resource({
12
- loader: () => contentList,
13
- });
9
+ const contentList = injectContentListLoader()().then((items) => filterFn ? items.filter(filterFn) : items);
10
+ return resource({ loader: () => contentList });
14
11
  }
15
-
16
- async function getContentFile(contentFiles, slug, fallback) {
17
- // Normalize file keys so both "/src/content/..." and "/<project>/src/content/..." resolve.
18
- // This mirrors normalization used elsewhere in the content pipeline.
19
- const normalizedFiles = {};
20
- for (const [key, resolver] of Object.entries(contentFiles)) {
21
- const normalizedKey = key
22
- // replace any prefix up to the content directory with /src/content
23
- // use a non-greedy match so nested paths containing "/content" are preserved
24
- .replace(/^(?:.*?)\/content(?=\/)/, '/src/content')
25
- // normalize duplicate slashes
26
- .replace(/\/{2,}/g, '/');
27
- normalizedFiles[normalizedKey] = resolver;
28
- }
29
- // Try direct file first, then directory index variants
30
- const base = `/src/content/${slug}`.replace(/\/{2,}/g, '/');
31
- const candidates = [
32
- `${base}.md`,
33
- `${base}.agx`,
34
- `${base}/index.md`,
35
- `${base}/index.agx`,
36
- ];
37
- const matchKey = candidates.find((k) => k in normalizedFiles);
38
- const contentFile = matchKey ? normalizedFiles[matchKey] : undefined;
39
- if (!contentFile) {
40
- return {
41
- filename: base,
42
- attributes: {},
43
- slug: '',
44
- content: fallback,
45
- };
46
- }
47
- const resolvedBase = matchKey.replace(/\.(md|agx)$/, '');
48
- return contentFile().then((contentFile) => {
49
- if (typeof contentFile === 'string') {
50
- const { content, attributes } = parseRawContentFile(contentFile);
51
- return {
52
- filename: resolvedBase,
53
- slug,
54
- attributes,
55
- content,
56
- };
57
- }
58
- return {
59
- filename: resolvedBase,
60
- slug,
61
- attributes: contentFile.metadata,
62
- content: contentFile.default,
63
- };
64
- });
12
+ //#endregion
13
+ //#region packages/content/resources/src/content-file-resource.ts
14
+ async function validateAttributes(schema, attributes, filename) {
15
+ const result = await schema["~standard"].validate(attributes);
16
+ if (result.issues) throw new FrontmatterValidationError(result.issues, filename);
17
+ return result.value;
65
18
  }
66
- /**
67
- * Resource for requesting an individual content file
68
- *
69
- * @param params
70
- * @param fallback
71
- * @returns
72
- */
73
- function contentFileResource(params, fallback = 'No Content Found') {
74
- const loaderPromise = injectContentFileLoader();
75
- const contentRenderer = inject(ContentRenderer);
76
- const contentFilesMap = toSignal(from(loaderPromise()));
77
- const input = params ||
78
- toSignal(inject(ActivatedRoute).paramMap.pipe(map((params) => params.get('slug'))), { requireSync: true });
79
- return resource({
80
- params: computed(() => ({ input: input(), files: contentFilesMap() })),
81
- loader: async ({ params }) => {
82
- const { input: param, files } = params;
83
- if (typeof param === 'string') {
84
- if (param) {
85
- const file = await getContentFile(files, param, fallback);
86
- if (typeof file.content === 'string') {
87
- const rendered = (await contentRenderer.render(file.content));
88
- return {
89
- ...file,
90
- toc: rendered.toc ?? [],
91
- };
92
- }
93
- return {
94
- ...file,
95
- toc: [],
96
- };
97
- }
98
- return {
99
- filename: '',
100
- slug: '',
101
- attributes: {},
102
- content: fallback,
103
- toc: [],
104
- };
105
- }
106
- else {
107
- const file = await getContentFile(files, param.customFilename, fallback);
108
- if (typeof file.content === 'string') {
109
- const rendered = (await contentRenderer.render(file.content));
110
- return {
111
- ...file,
112
- toc: rendered.toc ?? [],
113
- };
114
- }
115
- return {
116
- ...file,
117
- toc: [],
118
- };
119
- }
120
- },
121
- });
19
+ function getValidationFilename(filename) {
20
+ return filename.replace(/^\/src\/content\//, "");
122
21
  }
123
-
124
- /**
125
- * Generated bundle index. Do not edit.
126
- */
127
-
22
+ async function getContentFile(contentFiles, slug, fallback, schema) {
23
+ const normalizedFiles = {};
24
+ for (const [key, resolver] of Object.entries(contentFiles)) {
25
+ const normalizedKey = key.replace(/^(?:.*?)\/content(?=\/)/, "/src/content").replace(/\/{2,}/g, "/");
26
+ normalizedFiles[normalizedKey] = resolver;
27
+ }
28
+ const base = `/src/content/${slug}`.replace(/\/{2,}/g, "/");
29
+ const matchKey = [
30
+ `${base}.md`,
31
+ `${base}.agx`,
32
+ `${base}/index.md`,
33
+ `${base}/index.agx`
34
+ ].find((k) => k in normalizedFiles);
35
+ const contentFile = matchKey ? normalizedFiles[matchKey] : void 0;
36
+ if (!contentFile) return {
37
+ filename: base,
38
+ attributes: {},
39
+ slug: "",
40
+ content: fallback
41
+ };
42
+ const resolvedBase = matchKey.replace(/\.(md|agx)$/, "");
43
+ const validationFilename = getValidationFilename(matchKey);
44
+ return contentFile().then(async (contentFile) => {
45
+ if (typeof contentFile === "string") {
46
+ const { content, attributes } = schema ? await parseRawContentFileAsync(contentFile, schema, validationFilename) : parseRawContentFile(contentFile);
47
+ return {
48
+ filename: resolvedBase,
49
+ slug,
50
+ attributes,
51
+ content
52
+ };
53
+ }
54
+ return {
55
+ filename: resolvedBase,
56
+ slug,
57
+ attributes: schema ? await validateAttributes(schema, contentFile.metadata, validationFilename) : contentFile.metadata,
58
+ content: contentFile.default
59
+ };
60
+ });
61
+ }
62
+ function contentFileResource(paramsOrOptions, fallbackArg = "No Content Found") {
63
+ const isOptionsObject = paramsOrOptions && typeof paramsOrOptions === "object" && !("set" in paramsOrOptions) && ("schema" in paramsOrOptions || "params" in paramsOrOptions || "fallback" in paramsOrOptions);
64
+ const params = isOptionsObject ? paramsOrOptions.params : paramsOrOptions;
65
+ const fallback = isOptionsObject ? paramsOrOptions.fallback ?? "No Content Found" : fallbackArg;
66
+ const schema = isOptionsObject ? paramsOrOptions.schema : void 0;
67
+ const loaderPromise = injectContentFileLoader();
68
+ const contentRenderer = inject(ContentRenderer);
69
+ const contentFilesMap = toSignal(from(loaderPromise()));
70
+ const input = params || toSignal(inject(ActivatedRoute).paramMap.pipe(map((params) => params.get("slug"))), { requireSync: true });
71
+ return resource({
72
+ params: computed(() => ({
73
+ input: input(),
74
+ files: contentFilesMap()
75
+ })),
76
+ loader: async ({ params: resourceParams }) => {
77
+ const { input: param, files } = resourceParams;
78
+ if (typeof param === "string") {
79
+ if (param) {
80
+ const file = await getContentFile(files, param, fallback, schema);
81
+ if (typeof file.content === "string") {
82
+ const rendered = await contentRenderer.render(file.content);
83
+ return {
84
+ ...file,
85
+ toc: rendered.toc ?? []
86
+ };
87
+ }
88
+ return {
89
+ ...file,
90
+ toc: []
91
+ };
92
+ }
93
+ return {
94
+ filename: "",
95
+ slug: "",
96
+ attributes: {},
97
+ content: fallback,
98
+ toc: []
99
+ };
100
+ } else {
101
+ const file = await getContentFile(files, param.customFilename, fallback, schema);
102
+ if (typeof file.content === "string") {
103
+ const rendered = await contentRenderer.render(file.content);
104
+ return {
105
+ ...file,
106
+ toc: rendered.toc ?? []
107
+ };
108
+ }
109
+ return {
110
+ ...file,
111
+ toc: []
112
+ };
113
+ }
114
+ }
115
+ });
116
+ }
117
+ //#endregion
128
118
  export { contentFileResource, contentFilesResource };
129
- //# sourceMappingURL=analogjs-content-resources.mjs.map
119
+
120
+ //# sourceMappingURL=analogjs-content-resources.mjs.map
@@ -1,17 +1,12 @@
1
- import { NoopContentRenderer, ContentRenderer } from '@analogjs/content';
2
-
1
+ import { ContentRenderer, NoopContentRenderer } from "@analogjs/content";
2
+ //#region packages/content/shiki-highlighter/src/index.ts
3
3
  function withShikiHighlighter(_opts = {}) {
4
- return [
5
- {
6
- provide: ContentRenderer,
7
- useClass: NoopContentRenderer,
8
- },
9
- ];
4
+ return [{
5
+ provide: ContentRenderer,
6
+ useClass: NoopContentRenderer
7
+ }];
10
8
  }
11
-
12
- /**
13
- * Generated bundle index. Do not edit.
14
- */
15
-
9
+ //#endregion
16
10
  export { withShikiHighlighter };
17
- //# sourceMappingURL=analogjs-content-shiki-highlighter.mjs.map
11
+
12
+ //# sourceMappingURL=analogjs-content-shiki-highlighter.mjs.map