New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eleventy plugin not working #51
Comments
Unsure of your setup, but I just re-tried the example 11ty version in this repo and it works fine (node 15) https://github.com/shikijs/twoslash/tree/main/examples/eleventy Perhaps replit is timing out due to hardware constraints? |
Thanks for checking the example. I've been doing some more testing, and seem to have gotten past that error and run into another. So I don't think it was hardware constraints - it's even stranger. My local machine is WSL Ubuntu with Node 14 and 15 (via nvm). I'm using your example repo and mine. NotesFirst test: Node 12 vs 14 vs 15Locally I tested 14 and 15, and used 12 in the replit. Node 15 worked, but 12 and 14 didn't. This was disappointing because 14 is LTS and I was hoping this library would work on Node LTS. However, then I tested something else - the Eleventy build command.
|
Actually it looks like the pinned canary version is probably ahead of the current release? So likely this plugin actually requires functionality not in the current 0.12.1 Eleventy release. If that is the case, would you accept a documentation PR to make that clearer? |
Thanks a lot for the thorough explanation, it really helps us. I think eleventyConfig.addMarkdownHighlighter((code, lang, fence) => { markdown-it/markdown-it#626 (comment) We might need a workaround to get the fence in older versions or we could just drop the support for eleventy v0.*s. But eleventy v1 is currently in alpha and not many ppl use it so it's not optimal. Now I'm looking for a workaround, and if the workaround is not possible or clashing with the latest versions, we might just have to drop the support then. |
Update here. I don't think it is possible. To override the default behavior of older markdown-it, we need to get access to the Long sentence short, even the official syntax highlighters use this weird syntax to highlight lines because it's impossible to get attributes other than the first one. ```js/1,3
console.dir(console);
```
👇 one plugin use this syntax
```js#13
console.dir(console);
``` let highlights = new HighlightLinesGroup(split.join("/"), "/");
Yes, PRs are welcomed, and thanks. |
Thanks for digging in and the explanation. I've submitted #58 to update the plugin readme. Thanks everyone! |
Hello,
I'm trying to run this within 11ty but haven't gotten past the setup part, as the plugin errors out with
Could not get Shiki loaded async via 'deasync'
Minimal reproduction: https://replit.com/@dpfavand/11ty-shiki-twoslash-doesnt-work (click the green button to run).
It appears that the
setupForFile
promise is never resolved or rejected. But that's about as far as I have been able to get.Has anyone else run into this lately? Running on Node 12 and 14, both promises and async should be available, so I'm not sure what's going on.
The text was updated successfully, but these errors were encountered: