Build preset files for iDEditor
Will take a collection of iD preset, field and category definition files, verify that the schema is correct and definitions are valid, and builds a preset file, translations, and a YAML file for translation. Useful for deploying iD Editor with custom preset files.
$ npm install --global id-presets-builder
$ id-presets build
Looks for iD preset files in ./presets/
, field files in ./fields/
, categories in ./categories/
and defaults in ./defaults.json
. Please see the iD Presets README.md for details about iD presets. Outputs presets.json
, translations.json
and translate.yaml
in ./build/
.
$ id-presets lint
Lints the presets files without writing anything.
var presetsBuilder = require('id-presets-builder')
Looks for preset, field and category files in dirs ${dir}/presets/
, ${dir}/fields/
, ${dir}/categories/
and ${dir}/defaults.json
. dir
defaults to process.cwd()
. Callback is called with a presets object:
{
presets: {...},
categories: {...},
fields: {...},
defaults: {...}
}
Generates an object of localized names for presets that can be used in iD editor for localized names of presets in the UI.
Generates a translate object that defines preset terms that need translation, for use in transifex or similar localization platform.
PRs accepted.
Small note: If editing the Readme, please conform to the standard-readme specification.
MIT © Gregor MacLennan / Digital Democracy