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

support for .properties file syntax #970

Closed
garretwilson opened this issue Jun 10, 2016 · 11 comments
Closed

support for .properties file syntax #970

garretwilson opened this issue Jun 10, 2016 · 11 comments

Comments

@garretwilson
Copy link

Surprisingly I just noticed that there seems to be no support for the ubiquitous Java properties file format. Am I missing it under a different name?

@mAAdhaTTah
Copy link
Member

It's similar to .ini, right?

@garretwilson
Copy link
Author

It's similar, yes, but but not identical.

@garretwilson
Copy link
Author

I just had an idea, based upon @mAAdhaTTah 's comment. If someone could simply copy the language-ini plugin to make an identical language-properties plugin, that would be helpful. The greatest benefit would be that it would allow us to include language-properties in our content and let the plugin be improved later. This would be better than putting an artificial language-ini identifier in our source code that would need to be changed later.

@LeaVerou
Copy link
Member

You could run:

Prism.languages.properties = Prism.languages.ini

right after including Prism. Once eventually there is a proper definition for this language, you remove the line. Would that work for you?

@garretwilson
Copy link
Author

You mean insert some sort of custom JavaScript every time I include prism.js? That's a little unwieldy, especially since I have so much content that already includes prism.js I'd have to add an extra <script> tag, right? And then go through and remove them all once Prism got the properties language type?

@LeaVerou
Copy link
Member

Or you can just insert it at the end of prism.js, but that means it's more of a hassle to update Prism.

@garretwilson
Copy link
Author

Oooh! So can I fork Prism and make a pull request with prism.js updated with Prism.languages.properties = Prism.languages.ini at the end ... for the time being? Or is there a better approach?

@Golmote
Copy link
Contributor

Golmote commented Jun 22, 2016

If you can wait til the end of the week, I will merge PR #980

@garretwilson
Copy link
Author

Oh, sure, that would be awesome! There's no emergency on my part---I was just wanting to register the issue so it could be addressed.

Let me know when it is merged so that I can update my documents with the correct Prism language ID.

Thanks!!

@Golmote
Copy link
Contributor

Golmote commented Jun 26, 2016

@garretwilson It is merged. ;)

@garretwilson
Copy link
Author

It seems to work great, @Golmote ! Thank you so much for your work on this.

In the next month or two I plan on trying to build my own Prism language plugin for another format, so maybe I'll send you a private note later for you to give me some pointers.

All the best.

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

No branches or pull requests

4 participants