SerializedDataConverter icon indicating copy to clipboard operation
SerializedDataConverter copied to clipboard

feature_request(conversion): Specific extension and contains

Open Kristinita opened this issue 7 years ago • 1 comments

1. Summary

It would be nice, if would be possible automatically convert files, that contains certain symbols to files with specific extension (similar as contains rule in ApplySyntax package).

2. Argumentation

Quick and simply conversion from file, that contains certians symbols to file with specific extension.

3. Example

I have some files <filename>.yaml. These files start with a line:

user_commands:

4. Steps to reproduce

I edit <filename>.yaml → I save <filename>.yaml.

5. Expected behavior

If in User/serialized_data_converter.sublime-settings:

{
"rules": [
    {
        "src_path": "(.*)\\.yaml$"
    },
    {
        "src_contains": "^user_commands:$"
    }
    {
        "src_syntax": "YAML"
    },
    {
        "dest_path": "$1\\.suricate-profile$"
    },
    {
        "dest_syntax": "JSON"
    },
],
}

<filename>.yaml convert to JSON syntax in <filename>.suricate-profile in current folder after each <filename>.yaml saving.

Thanks.

Kristinita avatar Apr 03 '18 06:04 Kristinita

It's a interesting feature idea. To be honest, while I still use SerializedDataConverter, I rarely use the auto convert feature these day. I'll have to see how motivated I am to tackle this feature moving forward.

facelessuser avatar Apr 03 '18 14:04 facelessuser