Bug 402210

Summary: Add ability to format/pretty-print text files formats like JSON, XML and Protobuf
Product: [Applications] kate Reporter: Gregor Mi <codestruct>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: tilman
Priority: NOR    
Version: 18.12.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Gregor Mi 2018-12-16 21:03:37 UTC
Often, it comes in handy to quickly reformat a JSON file (or XML or Protobuf) to make it readable for the human eye.

Maybe this could be solved in a generic way to make it easy to integrate other external formatter programs (similar to Projects > Code Analysis).

A bonus would be to auto-detect suitable formatters for the currently opened file and present those first in the list.

See also https://bugs.kde.org/show_bug.cgi?id=325807 ("Add C++ Source Code Formatting with clang-format")
Comment 1 Dominik Haumann 2019-02-03 08:37:18 UTC
I think this should be done via the upcoming External Tools.
Comment 2 Gregor Mi 2019-02-03 20:22:10 UTC
One tool would be

    xmllint --format file.xml
Comment 3 Tilman Keskinöz 2020-03-04 09:44:52 UTC
Tools->External Tools->Tools->XML Format Full File is available in 19.12.2. 

-> RESOLVED