Skip to content
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

experiment with using shiki twoslash #95

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

johnnyreilly
Copy link
Owner

@johnnyreilly johnnyreilly commented Aug 31, 2021

This PR is a place to experiment with docusaurus-preset-shiki-twoslash for syntax highlighting in place of using the default of Prism.JS

If others want to hack on this:

git clone https://github.com/johnnyreilly/blog.johnnyreilly.com.git
cd blog.johnnyreilly.com/blog-website
git checkout feat/twoslash
yarn
yarn start

Then browse to http://localhost:3000/2021/08/14/typescript-4-4-more-readable-code

You can see that it works:

Screenshot from 2021-10-02 09-35-51

However, there's been issues which I'll document so peeps can help me maybe:

  • shiki-twoslash is very, very slow. Running yarn start takes about 10 minutes to get started. It's worth saying that I have more than two hundred blog posts and that may be a factor.
  • also builds very very slowly - around 20 minutes. So slowly that netlify is timing out:

Failed during stage 'building site': Command did not finish within the time limit

Thoughts

I'm guessing that deactivating Prism is something to consider - but I think it does all it's work at runtime so I suspect it's not an issue.

@netlify
Copy link

netlify bot commented Aug 31, 2021

❌ Deploy Preview for johnnyreilly-preview failed.

🔨 Explore the source changes: b9b0864

🔍 Inspect the deploy log: https://app.netlify.com/sites/johnnyreilly-preview/deploys/616c67987419aa0007a9f763

@johnnyreilly
Copy link
Owner Author

Hey @orta

I'm starting to write a blog post about using twoslash - I have been somewhat cheeky with the title image... 😉 I hope this doesn't offend?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant