You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (src.startsWith("./") ||src.startsWith("../")) {
436
+
src=path.posix.join(basePath, src);
437
+
}
438
+
439
+
// Return a new node with modified src attribute
440
+
returnnewMarkdoc.Tag("EnhancedImage", {
441
+
...node.attributes,
442
+
src,
443
+
});
444
+
},
445
+
},
446
+
};
447
+
```
448
+
376
449
### Partials
377
450
378
451
[Partials](https://markdoc.dev/docs/partials) are ways to reuse content across files (through [transclusion](https://en.wikipedia.org/wiki/Transclusion)).
@@ -406,7 +479,7 @@ This is a file that is processed by `markdoc-svelte`.
406
479
### Tags
407
480
408
481
[Tags](https://markdoc.dev/docs/tags) are ways to extend Markdown syntax to do more.
409
-
You can add functionality through Svelte components
482
+
Use them to add functionality through Svelte components.
410
483
411
484
For example, you might want to create a custom Callout tag to highlight information on a page
412
485
(these are also known as admonitions).
@@ -456,7 +529,7 @@ Then create a Callout component for tag in `src/lib/components/Callout.svelte`:
456
529
</div>
457
530
```
458
531
459
-
Then you can use the Callout tag in a Markdoc file:
532
+
Then use the Callout tag in a Markdoc file:
460
533
461
534
```markdown
462
535
---
@@ -479,7 +552,7 @@ Defaults to false.
479
552
480
553
The preprocessor validates whether the Markdoc is valid.
481
554
By default, it throws an error on files for issues at the `error` or `critical` level.
482
-
To debug, you can set the level to a lower level to stop the build for any errors at that level or above.
555
+
To debug, set the level to a lower level to stop the build for any errors at that level or above.
483
556
Possible values in ascending order: `debug`, `info`, `warning`, `error`, `critical`.
@@ -520,21 +593,22 @@ Markdoc has a few Markdown syntax limitations, see [Markdoc FAQ](https://markdoc
520
593
521
594
### @sveltejs/enhanced-img
522
595
523
-
To use the [enhanced-img plugin](https://svelte.dev/docs/kit/images#sveltejs-enhanced-img) with Markdown images, you can customize the default images Node with a custom Svelte component.
524
-
See the example [custom node](#nodes).
596
+
To use the [enhanced-img plugin](https://svelte.dev/docs/kit/images#sveltejs-enhanced-img) with Markdown images,
597
+
customize the default images Nnde with a custom Svelte component.
598
+
See the example [custom node](#nodes) including the option for relative paths to images.
525
599
526
600
### Page table of contents
527
601
528
-
Each proccessed page automatically exports a `headings` property with all headings on the page and IDs for each.
529
-
Add IDs with [annotations](https://markdoc.dev/docs/syntax#annotations) or they are generated automatically.
602
+
When you have the [`headingIds` option](#heading-ids) enabled,
603
+
each proccessed page automatically exports a `headings` property with all headings on the page and IDs for each.
530
604
Use this list to generate a table of contents for the page, as in the following example:
0 commit comments