Refactor the sprite interface and documentation
keichan34 opened this issue · comments
Is your feature request related to a problem? Please describe.
Currently, the sprite interface is only available in charites build
(#143 adds support for charites serve
), and it is only available using command line options. Additionally, there is some special logic with the current sprite
property and trying to parse its URL when building sprites -- my proposed solution would remove the need for that logic.
Describe the solution you'd like
I propose a unified interface for specifying sprite build options in style.yml
:
version: 8
metadata:
"charites:sprites":
directory: ./icons
output: ./sprite
pixel_ratios: [ 1, 2 ]
This is compatible with the Mapbox Style Specification, but probably should be stripped out when compiling the style.json
file.
Additionally, a separate page should be added to the documentation regarding the facilities Charites provides for building spritesheets.
Describe alternatives you've considered
- Automatically detecting an
icons
directory in the same directory as thestyle.yml
file- What happens when you don't want to build sprites?
--no-sprites
? - Probably this could be combined with the sprite build options for a smooth user experience?
- What happens when you don't want to build sprites?
Additional context
Documentation is currently lacking: see #115