pretty-print

Pretty Print / HTML Tidy for Google Web Toolkit (GWT)?

Is there a function for GWT (Google Web Toolkit) to pretty-print the html output of widgets? (apologies if the question is badly phrased - I'm not a GWT dev, but our developers are claiming that there's no way to do this) Currently all output is a huge single-line block, making debugging of CSS issues etc. a considerable task. HTML Tid...

Formatting floats in Python without superfluous zeros

How to format a float so it does not containt the remaing zeros? In other words, I want the resulting string to be as short as possible..? Like: 3 -> "3" 3. -> "3" 3.1 -> "3.1" 3.14 -> "3.14" 3.140 -> "3.14" ...

How do I prevent a pair of XMLEvent[Reader|Writer] from splitting empty tags into start+end tags?

Hello, everyone! I have an understanding problem of how the following code works: XMLInputFactory xif = XMLInputFactory.newFactory(); XMLOutputFactory xof = XMLOutputFactory.newFactory(); XMLEventReader reader = xif.createXMLEventReader(/* ... */); XMLEventWriter writer = xof.createXMLEventWriter(/* ... */); writer.add(reader); The...

XmlDocument OuterXml pretty printed

Hi, I've got a XmlDocument and I want to get the Content (OuterXml) as a pretty printed string. How can I do this? Regards ...

Pretty print code to PDF

I'm searching for a tool that will take a source directory and produce a single PDF containing the source code, preferably with syntax highlighting. I would like to read the PDF on my phone, in order to get familiar with a code-base, or just to see what I can learn by reading a lot of code. I will most often be reading Ruby. I would pr...

Python: Pretty printing a xml file directly from a tar.gz package

This is the first Python script I've tried to create. I'm reading a xml file from a tar.gz package and then I want to pretty print it. However I can't seem to turn it from a file-like object to a string. I've tried to do it a few different ways including str(), tostring(), etc but nothing is working for me. For testing I just tried to...

Is there a stylesheet or Windows commandline tool for controllable XML formatting, specifically putting attributes one-per-line?

Hi - I am searching for an XSLT or command-line tool (or C# code that can be made into a command-line tool, etc) for Windows that will do XML pretty-printing. Specifically, I want one that has the ability to put attributes one-to-a-line, something like: <Node> <ChildNode value1='5' value2='6' value3='happy' /> <...

How to Pretty print VBA code?

I need to "pretty print" VBA code into a Word document, retaining the color scheme from the VBE editor. I've been looking for free programs or methods to do this, but found nothing usable so far. Any ideas would be greatly appreciated. Thanks ...

Looking for streaming xml pretty printer in C/C++ using expat or libxml2

I'm looking for a streaming xml pretty printer for C/C++ that's either self contained or that uses libxml2 or expat and has a BSD-ish license. I've searched a bit and not found one. It seems like something that would be generally useful. Am I missing an obvious tool that does this? Background: I have a library that outputs xml without w...

XML Pretty Printer Missing 2 Key Edge Cases

Using this xslt file found on this blog to pretty print xml using Nokogiri, everything almost works, but to the point where I can't use it for HTML. First, if a node is empty, it turns it into a self closing node, so: <textarea></textarea> gets converted to <textarea/> But that messes up the html tree when rendered. Second, if th...

Wanted: Command line HTML5 beautifier

Wanted A command line HTML5 beautifier running under Linux. Input Garbled, ugly HTML5 code. Possibly the result of multiple templates. You don't love it, it doesn't love you. Output Pure beauty. The code is nicely indented, has enough line breaks, cares for it's whitespace. Rather than viewing it in a webbrowser, you would like to d...

Does jQuery have a JSON/javascript object to HTML pretty print function similar to PHP's var_dump?

Yes or no. If yes, what is it? Thanks. ...

Rails - How can I display nicely indented JSON?

Hi - I have a controller action that returns JSON data for api purposes, and plenty of it. I want to be able to inspect it in the browser, and have it nicely indented for the viewer. For example, if my data is data = { :person => { :id => 1, :name => "john doe", :age => 30 }, :person => ... } I want to see { "person" : { ...

Pretty-printing of numpy.array

Hello, I'm curious, whether there is any way to print formated numpy.arrays, e.g., in the way similar to this: x = 1.23456 print '%.3f' % x If I want to print the numpy.array of floats, it prints several decimals, often in 'scientific' format, which is rather hard to read even for low-dimensional arrays. However, numpy.array apparent...

Python Source Formatter/Pretty Printer

Is there an online or offline utility that will format/pretty-print Python source code? ...

IRB and large variables?

How can I print a large variable nicely in an irb prompt? I have a variable that contains many variables which are long and the printout becomes a mess to wade through. What if I just want the variable names without their values? Or, can I print each one on a separate line, tabbed-in depending on depth? ...

Is there a PowerShell code formatter / pretty printer?

I'm looking for a source code beautifyer for PowerShell programs. Ideally, it would be CLI based, but any solution is acceptable. I would like to avoid configuring a generic pretty printer tool; I'd like a solution that works for PowerShell out of the box. Is there such a thing? ...

Does Google Prettifier Supports Syntax highlightation of C#?

I've started working on google prettifier to highlight the syntax. Just had a doubt whether google prettifier supports C# syntax highlightation or not. If yes, which .js file i need to include in my application? ...

Pretty print array object, not array of objects?

So, I've already discovered Arrays.toString(arr); So don't point me to this question. My problem is just a tiny bit different. In this case, I don't have a native array pointer to the array in question. I have it as an Object pointer, and it could be an array of any type (primitive or otherwise). In this case, I can use the above toS...

Pretty-printing a datetime as a day of the week plus time in jQuery/JavaScript

Hi guys, I'm looking for a (ideally jQuery plugin) Javascript library that will let me provide datetimes formatted in whatever standard format (ISO 8601 seems to be the most commonly used among libraries that do something similar, like timeago and Prettydate), and have them transformed into strings like: Wednesday, 5:00pm Tomorrow, 9:...