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

Feature Request: Support Shiki for Syntax Highlighting #7

Open
nlnw opened this issue Oct 4, 2024 · 2 comments
Open

Feature Request: Support Shiki for Syntax Highlighting #7

nlnw opened this issue Oct 4, 2024 · 2 comments

Comments

@nlnw
Copy link

nlnw commented Oct 4, 2024

To be consistent with Astro's defaults, could this plugin support Shiki for syntax highlighting?

@NotWoods
Copy link
Owner

Ideally Astro exports a Shiki remark handler somewhere. I'll dig around when I have a chance but this should be able to be accomplished using the remark plugin options.

@samuelhorn
Copy link

Just got this working by using @shikijs/rehype.

Like this:

import rehypeShiki from "@shikijs/rehype";

const blog = defineCollection({
  loader: notionLoader({
    auth: import.meta.env.NOTION_TOKEN,
    database_id: "168a5072f11480f093f4ef00f00edf2f",
    filter: {
      property: "Published",
      checkbox: { equals: true },
    },
    rehypePlugins: [[rehypeShiki, { theme: "github-dark" }]],
  }),
})

Hope it helps!

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

No branches or pull requests

3 participants