Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
config:json [2011/12/15 05:51] – Fix title codebrainz | config:json [2014/11/27 00:54] – Use lexer filetype "Javascritp" to be more straightforward (but it's the same in the end) colombanw | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== JSON Filetype ====== | ====== JSON Filetype ====== | ||
+ | JSON files are intended for serializing data objects, but are sometimes used as configuration files. | ||
- | Although JSON files aren't terribly common, sometimes you'll have to hand-edit some JSON data, for example when it's used as a configuration file format. | + | Add this to the '' |
- | + | ||
- | Add this to the '' | + | |
<code ini> | <code ini> | ||
[Extensions] | [Extensions] | ||
Line 17: | Line 16: | ||
And create a new filedef named '' | And create a new filedef named '' | ||
- | <code ini> | + | <file properties filetypes.JSON.conf> |
[styling=C] | [styling=C] | ||
[keywords] | [keywords] | ||
- | primary=true false | + | primary=true false null |
[settings] | [settings] | ||
- | extension=json | ||
lexer_filetype=Javascript | lexer_filetype=Javascript | ||
- | comment_single=# | + | extension=json |
- | comment_use_indent=true | + | mime_type=application/ |
[indentation] | [indentation] | ||
- | width=2 | + | #width=4 |
# 0 is spaces, 1 is tabs, 2 is tab & spaces | # 0 is spaces, 1 is tabs, 2 is tab & spaces | ||
- | type=1 | + | #type=1 |
- | </code> | + | </file> |
+ | |||
+ | === Build Commands === | ||
+ | |||
+ | For people using Unix, the following will be helpful for checking your JSON files for correctness. | ||
+ | |||
+ | <file bash / | ||
+ | #!/bin/sh | ||
+ | |||
+ | if which python >/ | ||
+ | python -m json.tool <" | ||
+ | | sed ' | ||
+ | elif which perl >/ | ||
+ | perl -MJSON -e 'local $/; | ||
+ | |sed ' | ||
+ | else | ||
+ | echo "No known JSON parsers found" >& | ||
+ | exit 1 | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | In Geany, go to the Build menu and 'Set Build Commands...' | ||
{{tag> | {{tag> | ||
+ | ~~NOTOC~~ | ||
+ |