-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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: change all .js
endings to .ts
when having the TypeScript
toggle enabled
#9431
Comments
@dummdidumm I have a proposal for this. As we can see one of the ways of dealing with typescript toggle on: kit/sites/kit.svelte.dev/src/lib/docs/TSToggle.svelte Lines 7 to 22 in c0612a8
This will show the corresponding code block for the language selected (Typescript, Javascript) based on One of the proposals i have to deal with this is:
<code>+page <span class="js-version">.js</span> <span class="ts-version">.ts</span></code> In that way we can reutilize the same function that shows or hides the js-version or ts-version of the code blocks. The idea is to modify the parser and how it outputs the kit/sites/kit.svelte.dev/src/lib/docs/server/markdown.js Lines 35 to 52 in c0612a8
Instead of creating duplicate markdown files for typescript, we deal with how the markdown renderer deal with this. What do you think? |
Makes sense! Do you want to open a PR with these changes? |
That's great !! @dummdidumm yeah sure! can you assign me the issue please? 🙏 |
Just to update: i have found the exact code thats in charge of rendering the code element: kit/sites/kit.svelte.dev/src/lib/docs/server/index.js Lines 293 to 301 in c0612a8
This would be the section where i'm gonna add the span element of the .js and .ts section. I dont know if accesibility is gonna be a problem for screen readers. But for the mean while we can fix it. And the same would apply to the heading sections. |
Where as the deployed docs (when toggled to typescript) say:
|
Describe the problem
When switching to the
TypeScript
mode in the docsI would expect that all
.js
rererences were renamed to.ts
but this isn't the caseCurrently only the file name in the title of the code section changes to
.ts
.Describe the proposed solution
All
.js
references should be renamed to.ts
to be consistent and not to confuse peopleAlternatives considered
No response
Importance
nice to have
Additional Information
The
js
is also part of some anchor links e.g. https://kit.svelte.dev/docs/routing#layout-layout-jsI think it is fine to leave the
js
there.The text was updated successfully, but these errors were encountered: