Git Product home page Git Product logo

monokai-sublime-text-octopress's Introduction

#Monokai-Sublime-Text-Octopress

Sublime Text Style Highlighting for PHP and JavaScript Coders Running Octopress

Based on bdryanovski's original patch here.

bdryanovski created a patch for the solarized syntax highlighting that octopress uses as a front end to its pygments based syntax highlighter.

The patch worked great, except that it looked much different (for PHP and JavaScript) than I was used to from Sublime Text's interpretation of the Monokai theme.

So - I made a few adjustments.

##Languages and Consistency Most of the code I was writing back when I worked on this was either JavaScript or PHP. So - this patch was optimized for those languages. Still, the theme isn't perfect due to some differences between sublime text and pygments.

For example - in PHP, while Sublime Text differentiates between the keywords "class" and "public" (giving the former a color of light blue and the latter a color of bright red), pygments does not - assigning a single css class of ".k" (for keyword presumably) to both.

Then there were conflicts between languages. Pygments sometimes assigns the same class for different features in different languges. For example - both non-stdlib functions in PHP and Object properties in JavaScript share the same class (.nx). I actually probably should have favored JavaScript in this case - as I certainly use JavaScript object properties more regularly than PHP functions that don't belong to any class or the stdlib, but I optimized for PHP first and am too lazy to go back and regenerate diff files for patches. Feel free to knock yourself out.

Finally - there are some places where Sublime Text seems to fall short. Pygments gets it right (in my opinion) for C highlighting. For some reason, Sublime Text treats the dereference, conditional and arithmetic operators as punctuation (coloring them white) while pygments appropriately assigns the .o css class (bright red)...

In any case, all 4 of the languages I tested turned out pretty well. I wasn't going for perfection (luckily), just something that somewhat resembles my typical dev environment. You can see screenshots below that illustrate the shortcoming described above. If your particular flavor of programming isn't well supported - you might try bdryanovski's original monokai patch.

##Tests JavaScript

PHP

C

Python

##Apply the Patch

Go to your home directory:

$ cd $HOME

Clone into the repo

$ git clone git://github.com/sanukcode/Monokai-Sublime-Text-Octopress.git

Go to wherever you installed octopress (note - the patch works on unmodified, fresh installations. No promises if you have tweaked any of the files we are patching...)

$ cd /path/to/octopress/

Patch the appropriate files:

$ patch -u sass/base/_solarized.scss  $HOME/Monokai-Sublime-Text-Octopress/_solarized.scss.patch
$ patch -u sass/custom/_colors.scss   $HOME/Monokai-Sublime-Text-Octopress/_colors.scss.patch
$ patch --ignore-whitespace -u sass/partials/_syntax.scss $HOME/Monokai-Sublime-Text-Octopress/_syntax.scss.patch

If you re-generate your site, you should be able to see the new highlighting in action!

monokai-sublime-text-octopress's People

Contributors

ragle avatar therealmarv avatar bdryanovski avatar

Stargazers

Preslav Rachev avatar Ryo Kabutan avatar  avatar Constantine Aaron Cois, PhD avatar Praveen Gowda I V avatar Sergii Khomenko avatar

Watchers

 avatar

Forkers

therealmarv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.