Skip to content
Yash edited this page Apr 18, 2016 · 17 revisions

Flavours Info

 {
    "about": {
        "repo": "syntaxChecker",
        "description": "Validator For Web Developers",
        "version": "2.0.0",
        "authors": [
            {
                "name": "",
                "email": "",
                "url": ""
            }
        ],
        "icons": {
            "128": "jsonlint-logo.png"
        },
        "license": "Apache License 2.0"
    },
    

Menu Format

{    
   "menu": {
        "parent_label": "Validators",
        "label": "Linters"
    },
    
    "submenu": [
        {
            "command_name": "lintJs"
        }
    ]
} 

Context Menu Format

    "contextmenu": [
        {
            "command_name": "lintJs"
        }
    ],
    

Commands

{
    "commands": [
        {
            "name": "lintJs",
            "label": "Lint JavaScript",
            "keymap": "Ctrl+Shift+h",
            "trigger_event": {
                "fullcommand": "node application.js lint lint_js",
                "command": ["lint", "lint_js"],
                "available_api_methods": [ "selected_text", "file_path" ],
                "after_success_run_commands": [ "commandname1", "commandname2"],
                "after_failure_run_commands": [ "commandname5", "commandname6"]
            },
            "icons": {
                "normal_state": "nor"
            }           
        }
    ]
}    

Events format

{
    "events": [
            {
                "event_name": "on_text_changed",
                "event_type" : "type",
                "file_type": "Css File",
                "command_name": "lintCss"
            },
            {
                "event_name": "on_text_changed",
                "event_type" : "type",
                "file_type": "Php File",
                "command_name": "lintPhp"
            }
        ]
}

##Events

Possible events (event names)

  • on_load
  • on_pre_close
  • on_close
  • on_pre_save
  • on_post_save
  • on_text_changed
  • on_selection_changed
  • on_got_focus
  • on_lost_focus

Event type values

  • type : Event will run for Standard File Type
  • pattern : Any regex pattern would be matched like .php (*.php,*php5 and so on targets)
  • path: Only one path would be match. Run for exactly single file.
  • project : Event contains project related events like project_on_load etc

Explaining above terms

##Under work don't follow below

GUI interactions

{
   "_comment": " command name and GUI elements ",
    "gui": [
         { 
            "element_name": "btnConnect",
            "command_name" : "btnConnect_click",
            "event" : "click" 
        }
    ]
}



{
    "btnCommand" : {

        "click" : "command_name",
        "response" : "ui-element-name"
    },
   
    "Responses" : {
       "on_done" : {
           "execute" : "command_name",
           "response" : "save 
       }
   }

}
  • name : Plugin name

  • title : Plugin title

  • description : Plugin description must be brief

  • version: Plugin version

  • parentMenu: Should be "menuNode" if plugin is in Node

  • menuName: Plugin menu name which comes flavours menu. It will add action if we have single action inside actions else it will add menu with all action under that menu.

  • actions:

  • name: functionname in Node file which be called on this action

  • title: Internal title

  • parentMenu: menuNode is default and should be mention in file.

  • shortcutKeys: Shortcut keys for this action

  • type: * This is file type. * There are three options. * Extension, Regex and Standard File types * Extension examples .css, .js etc * Regex examples .php so it will cover .php ,.php5 etc * Standard File Type

    • Use camelcase name
    • Examples Css File, Php File
    • TODO will add all supported file types
  • trigger_event * type: File type like Css File,Php File or file extension * signal: * command: example is @node application.js lint lint_css@ * available_methods: example are @selected_text,file_path@ * after_success_methods * after_failure_methods

  • icons: It contains icons

    • size: filename ( Full path of file relative to resources path)
  • license: Opensource licenses like Apache, MIT, BSD etc

Clone this wiki locally