@riebeckite/core 0.0.10 → 0.0.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.
package/dist/index.js CHANGED
@@ -1546,7 +1546,7 @@ var Pipeline = class {
1546
1546
  options;
1547
1547
  isBuildTime;
1548
1548
  pluginCaches = /* @__PURE__ */ new Map();
1549
- async execute(markDownContent, embedDepth = 0, embedTrail = /* @__PURE__ */ new Set()) {
1549
+ async execute(markDownContent, embedDepth = 0, embedTrail = /* @__PURE__ */ new Set(), sourceSlug) {
1550
1550
  const processor = unified();
1551
1551
  const plugins = resolvePlugins(this.options.plugins);
1552
1552
  this.use(processor, remarkParse);
@@ -1560,6 +1560,7 @@ var Pipeline = class {
1560
1560
  this.use(processor, remarkMath);
1561
1561
  this.use(processor, remarkGfm);
1562
1562
  const markdownPipelineContext = {
1563
+ sourceSlug,
1563
1564
  contentIndex: this.contentIndex,
1564
1565
  resolvePermalink: (slug) => this.getPermalink(slug),
1565
1566
  renderNoteEmbed: this.createNoteEmbedRenderer(embedDepth, embedTrail),
@@ -1628,7 +1629,8 @@ var Pipeline = class {
1628
1629
  const content = await this.execute(
1629
1630
  markdown,
1630
1631
  embedDepth + 1,
1631
- nextEmbedTrail
1632
+ nextEmbedTrail,
1633
+ slug
1632
1634
  );
1633
1635
  return content.html;
1634
1636
  };
@@ -2786,7 +2788,8 @@ var ContentManager = class {
2786
2788
  const content = await this.pipeline.execute(
2787
2789
  rawPost,
2788
2790
  0,
2789
- /* @__PURE__ */ new Set([slug])
2791
+ /* @__PURE__ */ new Set([slug]),
2792
+ slug
2790
2793
  );
2791
2794
  await this.pluginRuntime.runPostHook(
2792
2795
  "onPostParsed",
@@ -16,7 +16,7 @@ export declare class Pipeline {
16
16
  private isBuildTime;
17
17
  private pluginCaches;
18
18
  constructor(contentIndex: Map<string, string>, permalinks: ReadonlyMap<string, string>, getMarkdownBySlug?: (slug: string) => Promise<string>, options?: PipelineOptions, isBuildTime?: boolean);
19
- execute(markDownContent: string, embedDepth?: number, embedTrail?: Set<string>): Promise<PostContent>;
19
+ execute(markDownContent: string, embedDepth?: number, embedTrail?: Set<string>, sourceSlug?: string): Promise<PostContent>;
20
20
  private getPermalink;
21
21
  private use;
22
22
  private createNoteEmbedRenderer;
@@ -7,6 +7,8 @@ export type MarkdownPipeline = {
7
7
  };
8
8
  export type HtmlPipeline = MarkdownPipeline;
9
9
  export type MarkdownPipelineContext = {
10
+ /** Slug of the content currently being rendered, when available. */
11
+ sourceSlug?: string;
10
12
  contentIndex: Map<string, string>;
11
13
  resolvePermalink: (slug: string) => string;
12
14
  renderNoteEmbed?: (slug: string, fragment: MarkdownEmbedFragment | null) => Promise<string | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/core",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "tsx": "^4.22.4",
46
- "@riebeckite/test": "0.0.10"
46
+ "@riebeckite/test": "0.0.11"
47
47
  },
48
48
  "repository": {
49
49
  "type": "git",