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

[WIP] Test Docusaurus's syntax highlighting #7527

Closed
wants to merge 5 commits into from

Conversation

fisker
Copy link
Sponsor Member

@fisker fisker commented Feb 3, 2020

Test Docusaurus's syntax highlighting for #7417 (comment)

one , two

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory)
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/pr-XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@thorn0
Copy link
Member

thorn0 commented Feb 3, 2020

Please try also updating prismjs in yarn.lock. See PrismJS/prism#1827

@fisker
Copy link
Sponsor Member Author

fisker commented Feb 3, 2020

@thorn0 On my test highlighting.js can't work on jsx and typescript.

usePrism can make them to use Prism syntax highlighter.

usePrism can be array or true(for all).

Another problem prism has ts alias for typescript, but seem Docusaurus can only load this language by typescript. So we have to replace ```ts to ```typescript, also many other languages need full name(if we use usePrism: true).

I don't know how to write markdownPlugins to replace those language. But you can do this in your script, since those .md are well formatted by prettier, just replace ```ts with ```typescript should work. Easier way.

@fisker
Copy link
Sponsor Member Author

fisker commented Feb 3, 2020

I'm not going to make this PR merge, just test for you.

@thorn0
Copy link
Member

thorn0 commented Feb 3, 2020

Thanks, I understood all that from your commits. But what about this comment? Probably, after updating, Prism will understand ts.

@fisker
Copy link
Sponsor Member Author

fisker commented Feb 3, 2020

You already update highlight.js in your PR, right? Do one more.. :)

@fisker
Copy link
Sponsor Member Author

fisker commented Feb 3, 2020

I missed your link, this problem seems fix already.

@fisker
Copy link
Sponsor Member Author

fisker commented Feb 3, 2020

@fisker fisker closed this Feb 3, 2020
@fisker fisker deleted the test-syntax-highlighting branch March 17, 2020 02:56
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants