-
-
Notifications
You must be signed in to change notification settings - Fork 379
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
docs: pass CodeBlock/highlight code + lang in as props, parameter #862
Conversation
✅ Deploy Preview for shiki-matsu ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for shiki-next ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Could you help to fix the lint? Thanks |
@antfu Sure thing - what do you think of the style in this commit: I guess the only problem here is the extra indentation at the start of each code line in the template string. Maybe we would want to introduce
export default async function CodeBlock(props: Props) {
const out = await codeToHast(dedent(props.children), {
lang: props.language,
theme: 'dark-plus',
}); But totally understand if you don't want to introduce new dependencies. If we shouldn't add any more dependencies, I would probably suggest disabling the |
It's just some demo examples; I think it's fine either way, but I would think it's better not to involve too many concepts all at once. It shouldn't be hard for developers to catch up and fix it, it's a problem unrelated to Shiki so I think it's better to not mention that. I changed it to array join to workaround that. |
Sounds good, thanks for the review, edit and merge! |
Description
Pass in:
<CodeBlock>
componenthighlight()
function parameterLinked Issues
--
Additional context
--