We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b67b5e8 commit b57bac5Copy full SHA for b57bac5
syntax-highlight.webc
@@ -0,0 +1,16 @@
1
+<script webc:type="render" webc:is="template" webc:raw webc:nokeep>
2
+function() {
3
+ let errorPrefix = "[11ty/eleventy-plugin-syntaxhighlight] <syntax-highlight> WebC component: ";
4
+
5
+ if(!this.slots || !this.slots.text) {
6
+ throw new Error(errorPrefix + "requires WebC v0.6.0");
7
+ }
8
9
+ if(!this.helpers || !this.helpers.highlight) {
10
+ throw new Error(errorPrefix+ "missing the `highlight` helper! Did you run addPlugin on the syntax highlighter in your Eleventy config file?");
11
12
13
+ let content = this.slots.text.default;
14
+ return this.helpers.highlight(this.language, content);
15
+}
16
+</script>
0 commit comments