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

Support syntax highlighting and diff in markdown? #60

Open
eddyw opened this issue May 4, 2022 · 1 comment
Open

Support syntax highlighting and diff in markdown? #60

eddyw opened this issue May 4, 2022 · 1 comment

Comments

@eddyw
Copy link
Collaborator

eddyw commented May 4, 2022

Hey 👋

Do you think it makes sense to add syntax highlighting support for markdown code?

Also, a more useful feature. Does it maybe make sense to add diff support in markdown? This'd help to easily display inline suggestions of code than should be removed + added. Sort of like GitHub suggestions or diff markdown. For example: 👇

const foo = "bar";
- type a = (typeof);
+ type a = typeof foo;
@mattpocock
Copy link
Owner

Yes, I think we should do syntax highlighting and prettifying for all the code snippets. I.e. you should be able to view {0}, {1}, etc all pretty, with syntax highlighting.

This is complicated by the fact that TS sometimes has 'and 2 more' in their code snippets. But a smart fella like you could work around that, I'm sure (perhaps wrapping it in a comment, then prettifying it).

I kind of like the idea of diffing (I assume you mean in the body) but not as much as I like the idea of integrating shiki-twoslash for really bringing out the errors. We're using it in the new XState docs, I'm sure it would work great for the site.

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

2 participants