How to add line numbers to all lines in Google Prettify?

The root cause is list-style-type: none in prettify.css: /* Specify class=linenums on a pre to get line numbering */ ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */ li.L0, li.L1, li.L2, li.L3, li.L5, li.L6, li.L7, li.L8 { list-style-type: none /* <<< THIS is the cause! */ } /* Alternate shading for … Read more

Sublime Text 2 Code Formatting

A similar option in Sublime Text is the built in Edit->Line->Reindent. You can put this code in Preferences -> Key Bindings User: { “keys”: [“alt+shift+f”], “command”: “reindent”} I use alt+shift+f because I’m a Netbeans user. To format your code, select all by pressing ctrl+a and “your key combination”. Excuse me for my bad english. Or … Read more

Can prettify.js be extended to support Mathematica?

Preface Since the Mathematica support for google-code-prettify was mainly developed for the new Mathematica.Stackexchange site, please see also the discussion here. Introduction I have no deep knowledge of all of this, but there were times when I wrote a cweb plugin for Idea to have my code highlighted there. In an IDE all this is … Read more

How can I use Prettify with Blogger/BlogSpot?

When you make a new entry in Blogger, you get the option to use HTML in your entry and to edit your blog entries. So type http://blogger.com, log in, and navigate to Posting → Edit Posts → Edit. In there put this at the top: <script type=”text/javascript” language=”javascript” src=”https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.js”></script> <script type=”text/javascript” language=”javascript” src=”https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/lang-css.min.js”></script> <script type=”text/javascript”> … Read more

Is there a Content Delivery Network (CDN) that hosts Google Code Prettify?

Found it! http://www.cdnjs.com/libraries/prettify <script src=”http://cdnjs.cloudflare.com/ajax/libs/prettify/r298/run_prettify.js” type=”text/javascript”></script> <link href=”http://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.css” type=”text/css”> Update: https://github.com/cdnjs/cdnjs/issues/695 (see bottom of page)