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

Add basic support for Vue SFC files (as HTML) #68

Merged
merged 1 commit into from
Feb 9, 2023
Merged

Add basic support for Vue SFC files (as HTML) #68

merged 1 commit into from
Feb 9, 2023

Conversation

PhenX
Copy link
Contributor

@PhenX PhenX commented Feb 8, 2023

PrismJS does not support this (PrismJS/prism#1665) but highlighting these files as HTML files would already be a lot better.

The extension of theses files is ".vue"

@aidando73
Copy link
Owner

Thanks @PhenX for the PR. Appreciate it.

I've given it a test

image

(Though the script and css tags aren't colored - I guess that's Prisms limitation)

@aidando73 aidando73 merged commit cddbf97 into aidando73:main Feb 9, 2023
@PhenX
Copy link
Contributor Author

PhenX commented Feb 10, 2023

Thank you, you merged it, does it mean the new extension version will be published automatically?
Also, I noticed scss files where not highlighted while prismjs supports it, isn't it included in the bundled prismjs? I think it should contain all the features prismjs proposes, what do you think? (only the ones relevant for the extension)

@aidando73
Copy link
Owner

I've published 0.0.4 which contains your changes - currently manual haha so I have to publish.

With regards to SCSS files, yes we should - I would welcome an issue or a PR for that one.

@PhenX
Copy link
Contributor Author

PhenX commented Feb 15, 2023

Great! Thank you for the new version. Concerning the Scss files, Prism supports it, but the embedded prism.js file does not contain it (as its header says : https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+aspnet+bash+c+csharp+go+gradle+hcl+java+json+markdown+markup-templating+objectivec+php+powershell+python+jsx+tsx+ruby+sql+typescript+visual-basic+yaml&plugins=keep-markup) I think the extension should contain all the available languages, plus a few plugins, what do you think?

@aidando73
Copy link
Owner

aidando73 commented Feb 27, 2023

@PhenX I'm currently unsure of the implications of that. I don't want users to have to download too big a css/js file.

But maybe that might not be an issue in this case? Depends on how big the full file is with all the languages. If it's not too big then we could include all of them (except the very esoteric languages that probs no one uses) - otherwise maybe there's a system we can build to allow users to opt out of languages they don't use?

@PhenX
Copy link
Contributor Author

PhenX commented Feb 28, 2023

@REslim30 I think these files are downloaded only once when the user installs the plugin (and when it gets updated), so it seems ok to me. Furthemore, it is zipped (currently the extension files take 90KB and get zipped to 38KB in the xpi).

I did a quick test, with ALL the PrismJS languages and it gives 563 KB of JS and 6KB of CSS. When included in your extension, the zip is 211KB.

It seems really reasonable to me :)

@aidando73
Copy link
Owner

aidando73 commented Mar 15, 2023

That makes sense @PhenX, thanks for looking into that - let's just enable all of them then.

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.

2 participants