Questions tagged [google-code-prettify]

Prettify is a JavaScript module and CSS file that allows syntax highlighting of source code snippets in an HTML page.

Google Code Prettify is a JavaScript module and CSS file that allows syntax highlighting of source code snippets in an HTML page.

Features

  • Works on HTML pages
  • Works even if code contains embedded links, line numbers, etc.
  • Simple API: Include some JavaScript code and CSS, and add an onload handler.
  • Lightweight: Small download and does not block page from loading while running.
  • Customizable styles via CSS. See the themes gallery
  • Supports all C-like, Bash-like, and XML-like languages. No need to specify the language
  • Extensible language handlers for other languages. You can specify the language.
  • Widely used with good cross-browser support.
103 questions
26
votes
2 answers

A List of Google Prettify Language Codes

I cannot find this anywhere and I swear I used to be able to very simply without much prying. Can anyone help me? Thanks. I would appreciate it. Also, does prettify support Batch?
Gabriel Ryan Nahmias
  • 2,135
  • 2
  • 26
  • 39
21
votes
1 answer

How to implement the code highlight as bootstrap's example

I found the bootstrap's code highlight has a very good style for code blocks. I find it using google-code-prettify, but I tried google code prettify, the style is different: How to implement the same as bootstrap's ?
Freewind
  • 193,756
  • 157
  • 432
  • 708
16
votes
2 answers

prettyPrint() doesn't get called on page load

I'm trying to prettify my code in Blogger. I've linked Google JS and CSS files to my template. The problem is that I want the code to be prettified on page load, so I add prettyPrint(); to page load event on the template.
Lim H.
  • 9,870
  • 9
  • 48
  • 74
10
votes
1 answer

Dynamic google-code-prettify doesn't work

Is it possible for a button to call a function that would 'prettify' a dynamic
? I can't get it to work.
After the page loads, the initial  is prettified(?), but when I change it and call prettyPrint() afterwards, it no longer…
GaiusSensei
  • 1,860
  • 4
  • 25
  • 44
9
votes
3 answers

Google Prettify with Bootstrap: Line Numbers Not Showing

I am using Google Prettify with Twitter Bootstrap. It is working, but for some reason, the line numbers are not appearing. Here is the markup:
    
  1. Matt
    • 6,787
    • 11
    • 65
    • 112
8
votes
7 answers

HTML won't render code block

So I'm using Google code prettify with AnchorCMS. All other languages but HTML work. This is what I'm trying to use.

But I think that the editor is interpreting the HTML within the
user3444414
5
votes
2 answers

Displaying XML using google-code-prettify

I can't seem to get google prettify to work with basic XML: anyone got this to work, or can see what I am doing wrong: here is my code:
Spleenboy
  • 179
  • 2
  • 13
4
votes
2 answers

google prettify: ada syntax

I am currently trying to highlight Ada code on my website using google prettify and a file I have found here. However, I am not able to use the later file with prettify, and the automatic language detection messes up attributes with ' characters…
Siapran
  • 43
  • 4
4
votes
1 answer

Remove google-code-prettify border on code

I want to remove the border on code while using google-code-prettify. I tried the following but got no result. pre.prettyprint { border: none; } I also tried to remove borders on all pre tags, same no result. pre { border: none; }
sorinu26
  • 1,122
  • 2
  • 13
  • 20
4
votes
2 answers

Google Code Prettify with Markdown is not working

Google Code Prettify is working fine, but when I am using the Markdown content and show the content from the database, Prettify isn't working properly (link of live result). This is what I am doing: Getting content with
user007
  • 71
  • 9
3
votes
1 answer

google code prettify Delphi comment

I'm trying to get the google code prettify working showing something similar to the Delphi IDE and ran into a problem with the comments This is a comment: {text in here} This is a compiler directive (not a comment): {$text in here} Does anyone…
Dangas56
  • 849
  • 1
  • 8
  • 32
3
votes
2 answers

Having trouble implementing Code Prettify in Jekyll—want to use `` instead of

I've been trying to implement Code Prettify in my Jekyll blog. I followed some guides and was able to implement it, but it's not ideal. This is what I did: 1- I went to _includes and added the necessary files in head.html: The sunburst…
Ludwig
  • 432
  • 6
  • 17
3
votes
1 answer

Google Code Prettify - How to fix SQL escape character

I'm trying to fix the following issue, as it's being very annoying on my site. https://code.google.com/p/google-code-prettify/issues/detail?id=341&thanks=341&ts=1398085413 and refers to the following file of the prettify…
AlexT82
  • 1,114
  • 1
  • 7
  • 12
3
votes
1 answer

How to disable code highlighting for google code prettify?

Is it possible to add a class to pre tag to disable code highlight? I tried adding classes prettyprint-false and no-prettyprint. https://code.google.com/p/google-code-prettify/wiki/GettingStarted
Vlad Vinnikov
  • 1,457
  • 3
  • 22
  • 33
3
votes
1 answer

Horizontal scroll area for displaying code snippets on tumblr

I am trying to set up my tumblr theme using prettify and css customization to display python code snippets. I am brand new to css, but I have it pretty much working as I want now (thanks to scouring the web for examples). However, the text is…
Mathieson
  • 1,194
  • 2
  • 13
  • 28
1
2 3 4 5 6 7