markdown SublimeLinter更新中自定义样式的文档

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown SublimeLinter更新中自定义样式的文档相关的知识,希望对你有一定的参考价值。

# Docs for Custom Styling v0.0.1
by pykong

(ST v3153)

## Example Code
```
...
"styles": [
  {
    "foreground": "#DDB700",
    "icon": "circle",
    "mark_style": "outline",
    "types": [
      "warning"
    ]
  },
  {
    "foreground": "#66FFFF",
    "background": "#9966FF",
    "icon": "circle",
    "mark_style": "stippled_underline",
    "codes": [
      "F401",
      "F402"
    ]
  },
  {
    "scope": "sublimelinter.mark.error",
    "icon": "Packages/User/cross.png",
    "mark_style": "stippled_underline",
    "codes": [
      "D300",
      "D303"
    ],
    "types": [
      "warning"
    ]
  },
  {
    "foreground": "#DDB700",
    "icon": "dot",
    "mark_style": "fill",
    "codes": [
      "F900"
    ],
    "priority": 3
  }
]
...
```



## Explanation
### Where to put the style definitions?
- Base level of the settings: Define styles for the defaults: "warning" and "error"
- Under each linter definition: Define styles for warnings and errors of that linter.

### What to put into the definitions?
### 1. Define targets:
- Either a list of error codes: ``` "codes": ["F401", "F402", ... ]" ```
- Warning or error type: ``` "types": ["warning", "error"]" ```

*Both "codes" and "types" can be combined.*

### 2. Define color:
##### a) State scope to source from
``` "scope":"python.source.punctuation" ```
##### b) Give explicit color definitions
```
"foreground": "#66FFFF",
"background": "#9966FF"
```
**Note:** Format in hex, leading `#` is no longer to be omitted.

Other color formats supported by `.sublime-color-scheme` should work also. _(Untested)_

*User either a) or b) as __scope__ will always overwrite other definitions.*


### 3. Define mark style:
``` "mark_style": "stippled_underline"```

Valid keys:  `"outline", "fill", "solid_underline", "squiggly_underline", "stippled_underline", "none"`

**Note:** `snake_case` is now used instead of `word case` to be consistent with ST's vocabulary.

### 4. Define icon:
Valid keys:  `"circle", "dot", "bookmark"`

A relative path to a png file will also work:
```"icon": "Packages/User/cross.png"```

### 5. Define gutter priority _(Untested)_
Set an overwrite order: ```"priority": 3```


A rule with a higher count will replace the gutter icon of a rule with a lower one on the same line. **But** errors will always overwrite warnings.

以上是关于markdown SublimeLinter更新中自定义样式的文档的主要内容,如果未能解决你的问题,请参考以下文章

SublimeLinter-Rubocop 即使在启用并且路径中有 rubocop 时也不会运行

SublimeLinter-php 或 SublimeLinter-phplint

SublimeLinter 忽略缺少的分号

在 SublimeLinter 的 sublimelinter_executable_map 中设置相对路径

SublimeLinter javascript 与 php

sublimelinter-php 和 sublimelinter-phpcs 有啥区别?