Skip to content
Permalink
Browse files
Document jsonminify
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Sep 21, 2015
1 parent 0d7c0b0 commit 5ef0dba8bb6b2ed3ab8b65e0eca076ece0a5012f
Showing 2 changed files with 4 additions and 3 deletions.
@@ -1376,13 +1376,13 @@ jpegoptim
Compress JPEG files using `jpegoptim <http://www.kokkonen.net/tjko/projects.html>`_

cssminify
Minify CSS using http://cssminifier.com/ (requires internet access)
Minify CSS using http://cssminifier.com/ (requires Internet access)

jsminify
Minify JS using http://javascript-minifier.com/ (requires internet access)
Minify JS using http://javascript-minifier.com/ (requires Internet access)

jsonminify
Minify JSON files (strips whitespace and use minimal separators).
Minify JSON files (strip whitespace and use minimal separators).

You can apply filters to specific posts or pages by using the ``filters`` metadata field:

@@ -310,6 +310,7 @@ def jsminify(data):

@apply_to_text_file
def jsonminify(data):
"""Minify JSON files (strip whitespace and use minimal separators)."""
data = json.dumps(json.loads(data), indent=None, separators=(',', ':'))
return data

0 comments on commit 5ef0dba

Please sign in to comment.