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

Update the php syntax file to highlight attributes #173

Merged
merged 2 commits into from
May 20, 2024

Conversation

wouterj
Copy link
Contributor

@wouterj wouterj commented May 17, 2024

Alternative to #172 (as per my suggestion).

@javiereguiluz what do you think of this? The output is slightly different from yours, but that's how highlight.js works :)

I tried my suggestion of converting the latest highlight.js syntax file, this unfortunately didn't work (there are too many BC breaks in v10). So I've copy pasted their regex and used it to what is available in our syntax file already.

If we want to go this way, I can also follow up with a PR adding more support for PHP features (e.g. arrow functions). For now, I've just added a couple keywords that plainly were missing (such as trait and enum).

@javiereguiluz
Copy link
Collaborator

@wouterj this is beautiful 🙌 ... and so simple compared to #172 😍

Thanks a lot for working on this. I just closed the other PR.

I'm going to merge this and tag a new version so we can test this in symfony.com docs as soon as possible. Thanks!

@javiereguiluz javiereguiluz merged commit 81e707a into symfony-tools:main May 20, 2024
3 checks passed
@smnandre
Copy link
Contributor

FYI: we now use tempest on ux.symfony.com, so we'll have some IRL feedback about it soon... if you want of course :)

@javiereguiluz
Copy link
Collaborator

@smnandre thanks! I did a POC using tempest ... it highlights PHP attributes, but it uses a highlighting code that didn't play well with other existing highlighting. Also, we need to highlight C, Markdown, etc. for some parts of Symfony Docs and those are not supported (yet) in tempest.

So,we're putting that idea on hold for now ... but we'll see in the future. Your experience using it in ux.symfony.com will be vey valuable when we revisit this idea. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants