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

docs: Update typescript code blocks in docs #35219

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cpAdm
Copy link
Contributor

@cpAdm cpAdm commented Mar 16, 2025

- Some typescript codeblocks were defined as js instead of ts

  • Could not update API docs: 5ba5ac2
    Since only JS blocks are added to docs, not TS code blocks. Should probably be allowed?
  • Updated all TS blocks to JS
  • Some other small updates:
    • Fixed wrong param for --update-snapshots
    • Replaced deprecated string.substr
    • Removed unused parameters in examples
  • Fix: [BUG]: Numbered list gets flattened out playwright.dev#1714

Copy link
Contributor

@dgozman dgozman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. We intentionally use js code blocks instead of ts, because that produces better highlight on our documentation site.

@cpAdm
Copy link
Contributor Author

cpAdm commented Mar 18, 2025

Thank you for the PR. We intentionally use js code blocks instead of ts, because that produces better highlight on our documentation site.

Seems a bit weird to me that ts produces worse highlighting than js for typescript code?

Example, type is not highlighted here with js
https://playwright.dev/docs/accessibility-testing#creating-a-fixture

With ts
image

With js
image

@dgozman
Copy link
Contributor

dgozman commented Mar 20, 2025

Seems a bit weird to me that ts produces worse highlighting than js for typescript code?

I understand that, but the decision was made after looking quite a few snippets. I don't think we really want to change that for now.

@cpAdm
Copy link
Contributor Author

cpAdm commented Mar 21, 2025

@dgozman Confusingly, there are already 36 code blocks with ts in the docs. That's why I thought it was fine using them. But if you want I can revert my ts changes, and just keep the 'Some other small updates' changes?

@dgozman
Copy link
Contributor

dgozman commented Mar 21, 2025

@dgozman Confusingly, there are already 36 code blocks with ts in the docs. That's why I thought it was fine using them. But if you want I can revert my ts changes, and just keep the 'Some other small updates' changes?

Yeah, that would be great. In fact, if you'd like to change those 36 ts blocks into js, that would be nice as well. Thank you!

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

Successfully merging this pull request may close these issues.

[BUG]: Numbered list gets flattened out
3 participants