pretty-print

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

坚强是说给别人听的谎言 提交于 2019-11-30 08:05:24
问题 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' /> </Node> It doesn't have to be EXACTLY like that, but I want to use it for an XML file that has nodes with dozens of attributes and spreading them across multiple lines makes them easier to

Lua indentation code in Lua [closed]

浪尽此生 提交于 2019-11-30 07:10:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Does there exist Lua code to indent Lua code? I have a lot of lua code where indenting it would help, and its in a pure lua environment. In defence of my question: For some of you here the situation here sounds impossible. It is very similar to requesting for Emacs Lisp code to format text. This is a real live

Scala - how to print case classes like (pretty printed) tree

安稳与你 提交于 2019-11-30 06:20:47
问题 I'm making a parser with Scala Combinators. It is awesome. What I end up with is a long list of entagled case classes, like: ClassDecl(Complex,List(VarDecl(Real,float), VarDecl(Imag,float))) , just 100x longer. I was wondering if there is a good way to print case classes like these in a tree-like fashion so that it's easier to read..? (or some other form of Pretty Print ) ClassDecl name = Complex fields = - VarDecl name = Real type = float - VarDecl name = Imag type = float ^ I want to end up

Pretty-Print JSON Data to a File using Python

久未见 提交于 2019-11-30 06:17:39
问题 A project for class involves parsing Twitter JSON data. I'm getting the data and setting it to the file without much trouble, but it's all in one line. This is fine for the data manipulation I'm trying to do, but the file is ridiculously hard to read and I can't examine it very well, making the code writing for the data manipulation part very difficult. Does anyone know how to do that from within Python (i.e. not using the command line tool, which I can't get to work)? Here's my code so far:

one pretty printer “to rule them all”

假装没事ソ 提交于 2019-11-30 05:38:03
问题 I'm looking for a tool that can pretty-print (AKA tidy or beautify) source code in as many languages as possible. Those I'm particularly keen on include: Java JSP HTML JavaScript SQL JSON XML Ideally, the tool should be able to update source files in-place and be able to format more than a single file at-a-time. It would be great if it could format files containing multiple languages (e.g. a JSP containing HTML, Java, and JavaScript source code), but that's probably asking for a bit much. I

Best pretty-printing library for Java? [closed]

浪尽此生 提交于 2019-11-30 04:21:03
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . What is the single best pretty-printing library for Java? I mean a library for printing formatted output with indentation, break hints, etc., not a library for beautifying/re-formatting Java code itself. Ideally, the library would "play nice" with System.out.println and friends. For an idea of what I'm looking

Pretty printing math in C# desktop application

强颜欢笑 提交于 2019-11-30 04:13:02
问题 What is the best method of printing math equations in a C# (winforms) desktop application? The format for the source is not important; I can generate almost anything with a little effort. What is important is that it should be relatively high performance and low overhead (I know, I'm only supposed to pick 2 of { performance, size, features } but I want all 3.) Things I have considered: LaTeX via System.Process() -> dvipng. Problem: even a minimal LaTeX instal is about 200 MB. Considering that

Pretty printing golang variable

扶醉桌前 提交于 2019-11-30 01:24:50
Is there something like Ruby 's awesome_print in Golang ? For example in ruby you could write: require 'ap' x = {a:1,b:2} // also works for class ap x the output would be: { "a" => 1, "b" => 2 } closest thing that I could found is Printf("%#v", x) If your goal is to avoid importing a third-party package, your other option is to use json.MarshalIndent : x := map[string]interface{}{"a": 1, "b": 2} b, err := json.MarshalIndent(x, "", " ") if err != nil { fmt.Println("error:", err) } fmt.Print(string(b)) Output: { "a": 1, "b": 2 } Working sample: http://play.golang.org/p/SNdn7DsBjy Nevermind, I

How do I pretty-print existing JSON data with Java? [closed]

独自空忆成欢 提交于 2019-11-29 22:06:38
I have a compact JSON string, and I want to format it nicely in Java without having to deserialize it first -- e.g. just like jsonlint.org does it. Are there any libraries out there that provides this? A similar solution for XML would also be nice. Waldheinz I think for pretty-printing something, it's very helpful to know its structure. To get the structure you have to parse it. Because of this, I don't think it gets much easier than first parsing the JSON string you have and then using the pretty-printing method toString mentioned in the comments above. Of course you can do similar with any

How do I pretty-print JSON in Delphi?

喜夏-厌秋 提交于 2019-11-29 19:54:06
问题 I am looking for a function that will take a string of JSON as input and format it with line breaks and indentations (tabs). Example: I have input line: {"menu": {"header": "JSON viewer", "items": [{"id": "Delphi"},{"id": "Pascal", "label": "Nice tree format"}, null]}} And want to get a readable result as text: { "menu":{ "header":"JSON viewer", "items":[ { "id":"Delphi" }, { "id":"Pascal", "label":"Nice tree format" }, null ] } } I found a lot of examples for PHP and C#, but not for Delphi.