This repository has been archived on 2022-05-06. You can view files and clone it, but cannot push or open issues/pull-requests.
chromajson/schema/schema.json

207 lines
9.0 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://git.jojodev.com/jolheiser/chromajson/schema/schema.json",
"title": "Chroma style configuration",
"description": "A chroma style to be registered",
"type": "object",
"required": ["name"],
"additionalProperties": false,
"properties": {
"name": {
"description": "Style name",
"type": "string"
},
"style": {
"description": "Chroma style",
"type": "object",
"properties": {
"background": {"$ref": "#/$defs/style"},
"pre_wrapper": {"$ref": "#/$defs/style"},
"line": {"$ref": "#/$defs/style"},
"line_numbers": {"$ref": "#/$defs/style"},
"line_numbers_table": {"$ref": "#/$defs/style"},
"line_highlight": {"$ref": "#/$defs/style"},
"line_table": {"$ref": "#/$defs/style"},
"line_table_td": {"$ref": "#/$defs/style"},
"code_line": {"$ref": "#/$defs/style"},
"error": {"$ref": "#/$defs/style"},
"other": {"$ref": "#/$defs/style"},
"none": {"$ref": "#/$defs/style"},
"eof_type": {"$ref": "#/$defs/style"},
"keyword": {"$ref": "#/$defs/style"},
"keyword_constant": {"$ref": "#/$defs/style"},
"keyword_declaration": {"$ref": "#/$defs/style"},
"keyword_namespace": {"$ref": "#/$defs/style"},
"keyword_pseudo": {"$ref": "#/$defs/style"},
"keyword_reserved": {"$ref": "#/$defs/style"},
"keyword_type": {"$ref": "#/$defs/style"},
"name": {"$ref": "#/$defs/style"},
"name_attribute": {"$ref": "#/$defs/style"},
"name_builtin": {"$ref": "#/$defs/style"},
"name_builtin_pseudo": {"$ref": "#/$defs/style"},
"name_class": {"$ref": "#/$defs/style"},
"name_constant": {"$ref": "#/$defs/style"},
"name_decorator": {"$ref": "#/$defs/style"},
"name_entity": {"$ref": "#/$defs/style"},
"name_exception": {"$ref": "#/$defs/style"},
"name_function": {"$ref": "#/$defs/style"},
"name_function_magic": {"$ref": "#/$defs/style"},
"name_keyword": {"$ref": "#/$defs/style"},
"name_label": {"$ref": "#/$defs/style"},
"name_namespace": {"$ref": "#/$defs/style"},
"name_operator": {"$ref": "#/$defs/style"},
"name_other": {"$ref": "#/$defs/style"},
"name_pseudo": {"$ref": "#/$defs/style"},
"name_property": {"$ref": "#/$defs/style"},
"name_tag": {"$ref": "#/$defs/style"},
"name_variable": {"$ref": "#/$defs/style"},
"name_variable_anonymous": {"$ref": "#/$defs/style"},
"name_variable_class": {"$ref": "#/$defs/style"},
"name_variable_global": {"$ref": "#/$defs/style"},
"name_variable_instance": {"$ref": "#/$defs/style"},
"name_variable_magic": {"$ref": "#/$defs/style"},
"literal": {"$ref": "#/$defs/style"},
"literal_date": {"$ref": "#/$defs/style"},
"literal_other": {"$ref": "#/$defs/style"},
"literal_string": {"$ref": "#/$defs/style"},
"literal_string_affix": {"$ref": "#/$defs/style"},
"literal_string_atom": {"$ref": "#/$defs/style"},
"literal_string_backtick": {"$ref": "#/$defs/style"},
"literal_string_boolean": {"$ref": "#/$defs/style"},
"literal_string_char": {"$ref": "#/$defs/style"},
"literal_string_delimiter": {"$ref": "#/$defs/style"},
"literal_string_doc": {"$ref": "#/$defs/style"},
"literal_string_double": {"$ref": "#/$defs/style"},
"literal_string_escape": {"$ref": "#/$defs/style"},
"literal_string_heredoc": {"$ref": "#/$defs/style"},
"literal_string_interpol": {"$ref": "#/$defs/style"},
"literal_string_name": {"$ref": "#/$defs/style"},
"literal_string_other": {"$ref": "#/$defs/style"},
"literal_string_regex": {"$ref": "#/$defs/style"},
"literal_string_single": {"$ref": "#/$defs/style"},
"literal_string_symbol": {"$ref": "#/$defs/style"},
"literal_number": {"$ref": "#/$defs/style"},
"literal_number_bin": {"$ref": "#/$defs/style"},
"literal_number_float": {"$ref": "#/$defs/style"},
"literal_number_hex": {"$ref": "#/$defs/style"},
"literal_number_integer": {"$ref": "#/$defs/style"},
"literal_number_integer_long": {"$ref": "#/$defs/style"},
"literal_number_oct": {"$ref": "#/$defs/style"},
"operator": {"$ref": "#/$defs/style"},
"operator_word": {"$ref": "#/$defs/style"},
"punctuation": {"$ref": "#/$defs/style"},
"comment": {"$ref": "#/$defs/style"},
"comment_hashbang": {"$ref": "#/$defs/style"},
"comment_multiline": {"$ref": "#/$defs/style"},
"comment_single": {"$ref": "#/$defs/style"},
"comment_special": {"$ref": "#/$defs/style"},
"comment_preproc": {"$ref": "#/$defs/style"},
"comment_preproc_file": {"$ref": "#/$defs/style"},
"generic": {"$ref": "#/$defs/style"},
"generic_deleted": {"$ref": "#/$defs/style"},
"generic_emph": {"$ref": "#/$defs/style"},
"generic_error": {"$ref": "#/$defs/style"},
"generic_heading": {"$ref": "#/$defs/style"},
"generic_inserted": {"$ref": "#/$defs/style"},
"generic_output": {"$ref": "#/$defs/style"},
"generic_prompt": {"$ref": "#/$defs/style"},
"generic_strong": {"$ref": "#/$defs/style"},
"generic_subheading": {"$ref": "#/$defs/style"},
"generic_traceback": {"$ref": "#/$defs/style"},
"generic_underline": {"$ref": "#/$defs/style"},
"text": {"$ref": "#/$defs/style"},
"text_whitespace": {"$ref": "#/$defs/style"},
"text_symbol": {"$ref": "#/$defs/style"},
"text_punctuation": {"$ref": "#/$defs/style"},
"whitespace": {"$ref": "#/properties/style/properties/text_whitespace"},
"date": {"$ref": "#/properties/style/properties/literal_date"},
"string": {"$ref": "#/properties/style/properties/literal_string"},
"string_affix": {"$ref": "#/properties/style/properties/literal_string_affix"},
"string_backtick": {"$ref": "#/properties/style/properties/literal_string_backtick"},
"string_char": {"$ref": "#/properties/style/properties/literal_string_char"},
"string_delimiter": {"$ref": "#/properties/style/properties/literal_string_delimiter"},
"string_doc": {"$ref": "#/properties/style/properties/literal_string_doc"},
"string_double": {"$ref": "#/properties/style/properties/literal_string_double"},
"string_escape": {"$ref": "#/properties/style/properties/literal_string_escape"},
"string_heredoc": {"$ref": "#/properties/style/properties/literal_string_heredoc"},
"string_interpol": {"$ref": "#/properties/style/properties/literal_string_interpol"},
"string_other": {"$ref": "#/properties/style/properties/literal_string_other"},
"string_regex": {"$ref": "#/properties/style/properties/literal_string_regex"},
"string_single": {"$ref": "#/properties/style/properties/literal_string_single"},
"string_symbol": {"$ref": "#/properties/style/properties/literal_string_symbol"},
"number": {"$ref": "#/properties/style/properties/literal_number"},
"number_bin": {"$ref": "#/properties/style/properties/literal_number"},
"number_float": {"$ref": "#/properties/style/properties/literal_number_bin"},
"number_hex": {"$ref": "#/properties/style/properties/literal_number_hex"},
"number_integer": {"$ref": "#/properties/style/properties/literal_number_integer"},
"number_integer_long": {"$ref": "#/properties/style/properties/literal_number_integer_long"},
"number_oct": {"$ref": "#/properties/style/properties/literal_number_oct"}
},
"additionalProperties": false
}
},
"$defs": {
"style": {
"description": "Token style",
"type": "object",
"additionalProperties": false,
"properties": {
"accent": {
"description": "Font accent(s)",
"type": "array",
"items": {
"type": "string",
"enum": ["italic", "noitalic", "bold", "nobold", "underline", "nounderline", "inherit", "noinherit"]
},
"uniqueItems": true
},
"color": {
"description": "Font color",
"oneOf": [
{"$ref": "#/$defs/hex"},
{"$ref": "#/$defs/ansi"}
]
},
"background": {
"description": "Background color",
"oneOf": [
{"$ref": "#/$defs/hex"},
{"$ref": "#/$defs/ansi"}
]
},
"border": {
"description": "Border color",
"oneOf": [
{"$ref": "#/$defs/hex"},
{"$ref": "#/$defs/ansi"}
]
}
}
},
"hex": {
"description": "Hex color",
"type": "string",
"pattern": "^#(?:[A-Fa-f\\d]{3}|[A-Fa-f\\d]{6})$"
},
"ansi": {
"description": "ANSI color",
"type": "string",
"enum": ["black", "darkred", "darkgreen", "brown", "darkblue", "purple", "teal", "lightgray", "darkgray", "red", "green", "yellow", "blue", "fuchsia", "turquoise", "white"]
}
}
}