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

Request: Documentation should have a user option to display either TypeScript or JavaScript #3895

Open
timbuckley opened this issue Sep 29, 2020 · 4 comments · May be fixed by #5635
Open

Request: Documentation should have a user option to display either TypeScript or JavaScript #3895

timbuckley opened this issue Sep 29, 2020 · 4 comments · May be fixed by #5635

Comments

@timbuckley
Copy link
Collaborator

Do you want to request a feature or report a bug?

Request

What's the current behavior?

Currently there is no way to toggle between JS and TS examples on the documentation (example), it only shows TS examples.

What's the expected behavior?

User should see a toggle above each example (or at the top of all pages) to see a TS or JS version of example usage.

@walsquared
Copy link

walsquared commented Oct 8, 2020

@timbuckley I'd like to tackle this, however I'd like to clarify something. Some snippets only include things like interfaces or types, which don't directly translate back to JS. How should that be represented when toggled to JS, or should that not be an option for these kinds of snippets?

@BrentFarese BrentFarese added this to the Slate 1.0 milestone Nov 3, 2020
@thesunny
Copy link
Collaborator

@Walsker @timbuckley I wonder if the right approach is to use the TypeScript to generate the JavaScript. I don't know if the JavaScript will appear natural, but I feel like it's worth a try. Then we don't have to keep two separate code bases (one in TS and one in JS) in sync.

With respect to interfaces and types, I don't think those have a JS equivalent anyways so they should be ignored.

@RavenColEvol
Copy link
Contributor

@thesunny @ianstormtaylor is it still a good first issue? I would like to hop in and take this issue.

@thesunny
Copy link
Collaborator

thesunny commented Aug 3, 2022

@RavenColEvol feels like a good first issue to me!

Since it affects documentation and not Slate itself, it is simultaneously easy to confirm that it works (does the code look right) and also shouldn't introduce any issues into Slate.

@timbuckley timbuckley changed the title TODO: Documentation should have a user option to display either TypeScript or JavaScript Request: Documentation should have a user option to display either TypeScript or JavaScript Aug 3, 2022
@maral maral linked a pull request Apr 14, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants