Qeole / Enlight

Firefox add-on providing syntax highlighting for raw code, based on the highlight.js project.
Mozilla Public License 2.0
42 stars 2 forks source link

base16 ocean dark request #4

Closed gavsiu closed 8 years ago

gavsiu commented 8 years ago

I'm using Base16 Ocean Dark colors. Can you please add this seeing as you have Base16 Tomorrow. Thanks!

Qeole commented 8 years ago

Hi @gavsiu, and thanks for using the add-on!

I would be glad to add this color scheme, but it it not possible to do it here: I do not “choose” or “define” the schemes for the add-on, it just embeds all the styles provided by the JavaScript library it relies on (namely highlight.js). So your style will automatically be available here once it gets merged into a new version of this lib, and the lib into Enlight.

Thus I encourage you to submit the issue on the highlight.js GitHub repository or, if you feel like it, to create it (the existing styles being there) and to submit a pull request to highlight.js project.

gavsiu commented 8 years ago

I thought it would be faster if I do it myself. First time forking and submitting a pull request.

https://github.com/isagalaev/highlight.js/pull/1188

I'll let you know if it's accepted.

Qeole commented 8 years ago

@gavsiu congrats! Welcome to the world of open-source :-)

Once your style is accepted we need to wait for the next stable version of highlight.js to be released (usually every two months or so, the last one being on May 17th).

Qeole commented 8 years ago

@gavsiu I've seen that your pull request have just been merged. Congrats again! Now we are waiting for the next stable release.

Qeole commented 8 years ago

highlight.js v9.5.0, which includes the new style sheet, has just been released. I will try to update the add-on this weekend.

Qeole commented 8 years ago

Fixed with commit 0cad74a0d4b220be9ba35eec3a49d57b720fb1b5. I did not pushed it upstream immediately because I faced this issue on highlight.js, which broke the add-on. Now it's fixed, and highlight.js v9.6.0 even came out today, so I repacked and pushed to Mozilla's platform. It should be live in a few days.

gavsiu commented 8 years ago

Not to worry. I stopped using Arch and the Ocean theme. Lately I've been using the RecognEyes theme in my IDE and ported it to Firefox's view-source. I've just been too lazy to port it to highlight.js.

Qeole commented 8 years ago

Ok great! By the way I did not know you could select themes for the view-source function in Firefox. If you don't mind me asking, how would you do that?

gavsiu commented 8 years ago

You change it by adding it to userContent.css

View-source css file can be viewed here for your version of Firefox, but I doubt it has changed much: resource://gre-resources/viewsource.css

I copied everything and deleted the @charset and @namespace. Then I deleted everything else I didn't need to keep the file smaller.

Then you wrap all that css with

@-moz-document url-prefix(view-source:) {
    ...copied css...
}

so that it won't try to style every website you visit (checks for view-source: in the url).

Not present in the source is highlight color, so I added my own.

Also, if you're not sure which class is for which, you can confirm it using DOM Inspector on a view-source page. That's how I found the URL to the internal css file.

Qeole commented 8 years ago

I'll try that! Thanks :)

The add-on is available now, closing the issue.