fafranco82 / swdestinydb-json-data

29 stars 46 forks source link

validate

SWDestinyDB cards JSON data

The goal of this repository is to store SWDestinyDB card data in a format that can be easily updated by multiple people and their changes reviewed.

Validating and formatting JSON

Using python >=2.6, type in command line:

./validate.py --verbose --fix_formatting

The above script requires python package jsonschema which can be installed using pip via pip install -U jsonschema.

You can also just try to follow the style existing files use when editing entries. They are all formatted and checked using the script above.

Description of properties in schemas

Required properties are in bold.

Set schema

Card schema

JSON text editing tips

Full description of (very simple) JSON format can be found here, below there are a few tips most relevant to editing this repository.

Non-ASCII symbols

When symbols outside the regular ASCII range are needed, UTF-8 symbols come in play. These need to be escaped using \u<4 letter hexcode>.

To get the 4-letter hexcode of a UTF-8 symbol (or look up what a particular hexcode represents), you can use a UTF-8 converter, such as this online tool.

Quotes and breaking text into multiple lines

To have text spanning multiple lines, use \n to separate them. To have quotes as part of the text, use \". For example, "\"Orange and white: one of a kind.\" <cite>Poe Dameron</cite>" results in following flavor text:

"Orange and white: one of a kind." Poe Dameron

Star Wars Destiny symbols

These can be used in a card's text section.

Translations

To merge new changes in default language in all locales, run the CoffeeScript script update_locales.

Pre-requisites:

Usage: coffee update_locales.coffee [language code]

(NOTE: a folder with the language code must exists in translations folder)