Bug 402210 - Add ability to format/pretty-print text files formats like JSON, XML and Protobuf
Summary: Add ability to format/pretty-print text files formats like JSON, XML and Prot...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 18.12.0
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-16 21:03 UTC by Gregor Mi
Modified: 2020-03-04 09:44 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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