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(theme-common): code block MagicComments support for TeX/LaTeX/Matlab #8982

Merged
merged 3 commits into from
May 30, 2023

Conversation

jj-style
Copy link
Contributor

@jj-style jj-style commented May 15, 2023

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

I could not see an open issue for it but I would like to be able to use the magic comments feature in Matlab code blocks. This isn't currently supported due to Matlab's way of commenting, therefore I have added this capability in this PR.

Test Plan

  • I have added a Matlab code snippet in the
    dogfooding page which verifies the functionality.
  • I ran a local instance of the site and verified that the lines were not highlighted by the magic comments
  • I did the implementation and restarted the server and verified that the lines were highlighted

before
before
after
after

Test links

Deploy preview: https://deploy-preview-8982--docusaurus-2.netlify.app/tests/pages/code-block-tests/#magic-comments-tests

Related issues/PRs

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 15, 2023
@netlify
Copy link

netlify bot commented May 15, 2023

[V2]

Name Link
🔨 Latest commit 5f0d777
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6475f44fea88c300089a5beb
😎 Deploy Preview https://deploy-preview-8982--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented May 15, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟢 94 🟢 97 🟢 100 🟢 100 🟠 89 Report
/docs/installation 🟠 81 🟢 100 🟢 100 🟢 100 🟠 89 Report

Copy link
Collaborator

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

Thanks! This pattern is inherited from TeX so let's call the style tex and add tex and latex to the language list.

@jj-style
Copy link
Contributor Author

Thank you for the feedback!
I have now changed the comment style to be called tex and added an example in dogfooding code blocks page to verify this for latex also

@slorber slorber added the pr: new feature This PR adds a new API or behavior. label May 30, 2023
@slorber
Copy link
Collaborator

slorber commented May 30, 2023

LGTM thanks 👍

@slorber slorber added the to backport This PR is planned to be backported to a stable version of Docusaurus label May 30, 2023
@slorber slorber changed the title feat(theme-common): code block MagicComments support for matlab feat(theme-common): code block MagicComments support for TeX/LaTeX/Matlab May 30, 2023
@slorber slorber merged commit 30a4181 into facebook:main May 30, 2023
29 checks passed
@jj-style
Copy link
Contributor Author

Thanks for the review and for pushing up the missing quote! 😊

This was referenced Oct 19, 2023
@slorber slorber removed the to backport This PR is planned to be backported to a stable version of Docusaurus label Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants