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

feat(code-block): toggle between JS/TS #39

Open
mesqueeb opened this issue Dec 25, 2020 · 0 comments
Open

feat(code-block): toggle between JS/TS #39

mesqueeb opened this issue Dec 25, 2020 · 0 comments

Comments

@mesqueeb
Copy link
Member

mesqueeb commented Dec 25, 2020

I want to write code snippets that are toggolable between JS and TS.

because, TS users wanna see implementation examples with Typings included
but, JS users don't want to see this

Instead of having separate TS documentation, each code snippet should be toggolable between the two.

The change is to be implemented in the CodeBlock component:
https://github.com/CyCraft/planetar/blob/production/packages/markdown/src/components/CodeBlock.vue

The syntax could be to accept an array of languages and content.

By default it will show: content[0] language[0], and then there is a toggle in the top right somewhere to switch to the second language and content.

currently the props look like this (need refactoring so they accept String | Array):
image

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

1 participant