website icon indicating copy to clipboard operation
website copied to clipboard

Shiki once more

Open lishaduck opened this issue 1 year ago • 12 comments

Type

  • [x] Refactor
  • [ ] Feature
  • [ ] Bug Fix
  • [ ] Optimization
  • [ ] Documentation Update

Description

Upgrade Shiki, which required upgrading the unified collective, which required switching to contentlayer2.

Related

  • Closes #710

lishaduck avatar Jul 11 '24 17:07 lishaduck

@lishaduck is attempting to deploy a commit to the Effect Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jul 11 '24 17:07 vercel[bot]

It still uses the classic renderer, but otherwise it works now.

lishaduck avatar Jul 11 '24 19:07 lishaduck

I'm going to put the rich renderer into a different PR, it'll need some tweaking, and I'd rather have someone more design oriented figure out how they want to render it, as the default css looks pretty bad.

lishaduck avatar Jul 11 '24 19:07 lishaduck

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 12, 2024 2:47am

vercel[bot] avatar Jul 12 '24 02:07 vercel[bot]

@lishaduck - thank you very much for all your work! I'll take a closer look tomorrow. Also cc'ing @gcanti for another set of 👀 validating the Shiki visuals.

IMax153 avatar Jul 12 '24 02:07 IMax153

@lishaduck - thank you very much for all your work! I'll take a closer look tomorrow.

You're welcome! And honestly, thanks! I'd been wanting to do some more investigation into Shiki, and this was the perfect excuse 🙃

lishaduck avatar Jul 12 '24 15:07 lishaduck

I looked through a bunch of the documentation and from my perspective this PR looks good. I'll wait for @gcanti to have a chance to review though.

IMax153 avatar Jul 12 '24 17:07 IMax153

Oh yeah, and I didn't see changesets set up. Do I need to do that here?

lishaduck avatar Jul 12 '24 17:07 lishaduck

@lishaduck - no need to create a changeset - we don't version the website in that manner.

IMax153 avatar Jul 12 '24 18:07 IMax153

Looks like there are a couple of issues:

  • the code block metadatas are not respected, for example here https://website-git-fork-lishaduck-shiki-once-more-effect-ts.vercel.app/docs/quickstart the code snippets should have a "Terminal" title (see https://effect.website/docs/quickstart for reference)

Yeah, must've reordered too much.

  • the @include directive of twoslash is not respected, for example https://website-git-fork-lishaduck-shiki-once-more-effect-ts.vercel.app/docs/guides/error-management/expected-errors#error-tracking

~~I was looking, and it's not a twoslash feature, must've been injected by something else, I guess.~~ It wasn't in the original ts version nor the current Shiki one, but the old v0 Shiki version does. I guess I'll mark this as draft then and file an issue.

EDIT: (Un)blocked on twoslashes/twoslash#47

lishaduck avatar Jul 13 '24 21:07 lishaduck

I haven't forgotten about this, it's is blocked on shikijs/shiki#737 (and possibly shikijs/shiki#746) getting merged. I'll try to finish this 🔜

EDIT: It's been merged, 🥳 EDIT 2: It does require #771 though, so this'll still be a larger endeavour.

lishaduck avatar Aug 11 '24 01:08 lishaduck

Ok, been looking through the docs. Here's a list of issues for my own reference. I think we ran into these: https://rehype-pretty.pages.dev/#meta-strings, I think there's a conflict with https://rehype-pretty.pages.dev/#titles; and possibly https://shiki.style/packages/rehype#line-highlight / https://rehype-pretty.pages.dev/#highlight-lines. I also ran into timlrx/contentlayer2#35.

Also, are we OK moving to contentlayer2 given Reimagining ContentLayer with Effect? Is there a contentlayer3 hanging around somewhere?

lishaduck avatar Aug 18 '24 01:08 lishaduck

Closing as blocked on a separate contentlayer upgrade. The scope got too big, debugging rehype isn't fun.

lishaduck avatar Sep 04 '24 16:09 lishaduck