Questions tagged [prettify]

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

145 questions
2
votes
2 answers

Which library does GitHub use to beautify JavaScript code?

Which library does GitHub use to beautify JavaScript code? I am looking for a good code prettify library.
guilin 桂林
  • 17,050
  • 29
  • 92
  • 146
2
votes
4 answers

What is meant by to prettify JSON

I have heard of sites that prettify/beautify JSON. What does it actually mean?
Shamim Hafiz - MSFT
  • 21,454
  • 43
  • 116
  • 176
2
votes
0 answers

Python - CSS formatting lost when Beautifulsoup4 prettify() on a local .html file

I need to edit hundreds of .html files with beautifulSoup 4. My CSS formatting is lost when I write back the changes to file. Before prettify(): And prettify(): My code: from bs4 import BeautifulSoup import os files = [] path = r"C:\Files" for…
joke4me
  • 812
  • 1
  • 10
  • 29
2
votes
1 answer

What is the state of the art approach for creating own rules for Google's Prettify?

What is the state of the art approach for creating own rules for Google's Prettify? I am not talking about changing the colors of existing rules, furthermore, I want to create new rules: e.g for shell/bash maybe in an extrem case for a poem, in…
2
votes
1 answer

Guidelines for Google Code Prettify

I'm hoping to pick up Issue 295 from Google's Code-Prettify project; i.e. to add support for lang-powershell. Whilst I've found some code examples, I can't find any documentation on how this code should be written, or any submission guidelines (e.g.…
JohnLBevan
  • 22,735
  • 13
  • 96
  • 178
2
votes
1 answer

'unicode' object has no attribute 'prettify'

I am using BeautifulSoup to parse an html article. I use some functions to clear the html, so I can keep only the main article. Also, I want to save the Soup Output to a file. The error I get is the following: soup =…
photeesh
  • 312
  • 5
  • 19
2
votes
1 answer

Automatic SyntaxHighlighter with Prettify

Working on a school project where we have creating a forum based website. We are using PageDown and Prettify to handle the text. but like it's now we have to use on the code to get it out nice and smooth, but are there some way we…
2
votes
1 answer

Python - write Xml (formatted)

I wrote this python script in order to create Xml content and i would like to write this "prettified" xml to a file (50% done): My script so far: data = ET.Element("data") project = ET.SubElement(data, "project") project.text =…
Creative crypter
  • 1,348
  • 6
  • 30
  • 67
2
votes
1 answer

Insert comments with CSScomb (using Sublime Text)

I client of mine asked to have a lot of comments in the code - including css files. So I thought about using CSScomb to reorganize the css code and add comments automatically. It doesn't make sense but why not. So the idea would be to change the…
YannickHelmut
  • 555
  • 1
  • 7
  • 20
2
votes
1 answer

Can Prettify.js be used to highlight code on Wikipedia?

I want to add highlighted Mathematica source code to Wikipedia pages, samples of brief apps like those in WR's Tweet-a-Program. Currently, there's good support for Mathematica syntax highlight in prettify.js, and this is what…
andandandand
  • 21,946
  • 60
  • 170
  • 271
2
votes
1 answer

How to add line numbers when using google prettify in the nocode class?

related How to add line numbers to all lines in Google Prettify? I am looking at google's http://code.google.com/p/google-code-prettify/ to display come code I have written in Mathematica inside a web page. Mathematica is not supported language. So,…
Nasser
  • 12,849
  • 6
  • 52
  • 104
2
votes
1 answer

How to change or disable the alternating background colors in Google Prettify

I want to change the color or even disable totally the alternating background colors in google prettify wich I use at my blog@blogger. My current CSS is Doxy theme with this change: /* Specify class=linenums on a pre to get line numbering; line…
Chris
  • 3,619
  • 8
  • 44
  • 64
2
votes
1 answer

Is there a way to add 6502 Assembly to Google Code Prettify?

I have blog that is using Google Code Prettify. My blog has a lot of 6502 Assembly Language code and I would like to add the instructions and directives. I was hoping someone out there has learned how to add custom languages. Or better yet, knows…
JohnnyStarr
  • 619
  • 8
  • 21
2
votes
1 answer

Prettify syntax highlight in contenteditable pre

I am using google prettify to highlight code in a contenteditable pre. The contenteditable pre contains div nodes and creates/deletes divs for each line as the user presses enter or bspace. My pre element contains initial code, all on one line (I…
gkiely
  • 2,987
  • 1
  • 23
  • 37
2
votes
1 answer

Google Prettify Line numbers and Overflow

When adding overflow to Google prettify elements, the line numbers disappear. Unchanged CSS: pre { font-size:11px; background-color:white; } /* Alternate shading for lines */ li.L1, li.L3, li.L5, li.L7, li.L9 { background: #eee;…
Dan Bough
  • 499
  • 1
  • 10
  • 23