Warning, /frameworks/syntax-highlighting/utils/schema-converter/README.rst is written in an unsupported language. File is not indexed.

0001 What is This
0002 ============
0003 
0004 The new kate's theme format incompatible with the previously used ``*.kateschema``
0005 and ``*.katehlcolor`` files. Here is a tool aimed to help convert old colors to
0006 the newly used theme files.
0007 
0008 
0009 Usage
0010 =====
0011 
0012 - Make a virtualenv with all dependencies::
0013 
0014     $ pipenv install --dev
0015 
0016 - Enter the virtualenv::
0017 
0018     $ pipenv shell
0019 
0020 - Check the help screen::
0021 
0022     Usage: kateschema2theme [OPTIONS] [INPUT_FILE]
0023 
0024     Options:
0025     -h, --help             Show this message and exit.
0026     --version              Show the version and exit.
0027     -d, --skip-included    Do not write custom colors included from another
0028                            syntax files.
0029 
0030     -s, --syntax-dir TEXT  Specify the directory to search for syntax files. If
0031                            given, extra validation going to happen.
0032 
0033 - Example *katecolor* file::
0034 
0035     $ cat .desktop.katehlcolor
0036     [Highlighting .desktop - Schema Zaufi::dark]
0037     .desktop:Comment=8,ff787775,ff787775,0,1,0,0,,,,---
0038     .desktop:Key=2,ff77aa77,ff77aa77,0,0,0,0,,,,---
0039     .desktop:Language=3,ff4086c0,ff4086c0,1,0,0,0,,,,---
0040     .desktop:Normal Text=0,ffcacaca,ffcacaca,0,0,0,0,,,,---
0041     .desktop:Section=1,ffdaaa66,ffdaaa66,1,0,0,0,,,,---
0042 
0043     [KateHLColors]
0044     full schema=false
0045     highlight=.desktop
0046     schema=Zaufi::dark
0047 
0048 - Perform the conversion::
0049 
0050     $ kateschema2theme .desktop.katehlcolor
0051     {
0052         "custom-styles": {
0053             ".desktop": {
0054                 "Comment": {
0055                     "bold": false,
0056                     "italic": true,
0057                     "selected-text-color": "#787775",
0058                     "strike-through": false,
0059                     "text-color": "#787775",
0060                     "underline": false
0061                 },
0062                 "Key": {
0063                     "bold": false,
0064                     "italic": false,
0065                     "selected-text-color": "#77aa77",
0066                     "strike-through": false,
0067                     "text-color": "#77aa77",
0068                     "underline": false
0069                 },
0070                 "Language": {
0071                     "bold": true,
0072                     "italic": false,
0073                     "selected-text-color": "#4086c0",
0074                     "strike-through": false,
0075                     "text-color": "#4086c0",
0076                     "underline": false
0077                 },
0078                 "Normal Text": {
0079                     "bold": false,
0080                     "italic": false,
0081                     "selected-text-color": "#cacaca",
0082                     "strike-through": false,
0083                     "text-color": "#cacaca",
0084                     "underline": false
0085                 },
0086                 "Section": {
0087                     "bold": true,
0088                     "italic": false,
0089                     "selected-text-color": "#daaa66",
0090                     "strike-through": false,
0091                     "text-color": "#daaa66",
0092                     "underline": false
0093                 }
0094             }
0095         },
0096         "metadata": {
0097             "name": "Zaufi::dark",
0098             "revision": 1
0099         }
0100     }
0101 
0102 - Because the syntax files also may be changed, and some syntax items could
0103   disappear, or some new added. The old theme files may contain unused entries
0104   as well as missed definitions for the newly added items. To address these
0105   possible issues, the ``-s`` option could be used with a path to the syntax
0106   XMLs directory. The conversion tool will validate the items defined in
0107   the old there against actually declared by the corresponding syntax.
0108   Unused items will be discarded from the converted theme::
0109 
0110     $ kateschema2theme -s /usr/share/org.kde.syntax-highlighting/syntax very-old.kateschema >/dev/null
01110112     * The following styles are not used by `CMake` syntax anymore:
0113       Commands               │ CMake Variable       │ Environment Variable
0114       Builtin CMake Variable │ Properties
0115       Macros                 │ Third-Party Commands
0116 
0117     * The following styles are not defined in the converted `CMake` syntax:
0118       User Function/Macro   │ False Special Arg                 │ Command
0119       Named Args            │ Cache Variable Substitution
0120       Internal Name         │ CMake Internal Variable
0121       Variable Substitution │ Property
0122       True Special Arg      │ Environment Variable Substitution
0123       Builtin Variable      │ Standard Environment Variable
0124       Aliased Targets       │ @Variable Substitution
0125