1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-13 12:49:10 +08:00

Wiki: Add labels info (#1541)

* Add labels info

* Add script for update labels info
This commit is contained in:
Wang Shidong 2018-03-24 05:01:54 -05:00 committed by GitHub
parent 85501527e7
commit 38d2653f66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 68 additions and 1 deletions

View File

@ -0,0 +1,39 @@
function! SpaceVim#dev#wiki#updateLabels() abort
let [start, end] = s:find_position()
if start != 0 && end != 0
if end - start > 1
exe (start + 1) . ',' . (end - 1) . 'delete'
endif
call append(start, s:generate_content())
silent! Neoformat
endif
endfunction
function! s:find_position() abort
let start = search('^<!-- SpaceVim Wiki labels info start -->$','bwnc')
let end = search('^<!-- SpaceVim Wiki labels info end -->$','bnwc')
return sort([start, end])
endfunction
function! s:generate_content() abort
let content = ['## Labels',
\ '',
\ 'Name | color | description',
\ '--- | ---- | ----'
\ ]
let content += s:get_labels()
return content
endfunction
function! s:get_labels() abort
let labels = github#api#labels#GetAll('SpaceVim', 'SpaceVim')
let line = []
for label in labels
call add(line, label.name . ' | #' . label.color . ' | ' . get(label, 'description', '') )
endfor
if line[-1] !=# ''
let line += ['']
endif
return line
endfunction

View File

@ -1,9 +1,37 @@
steps of sending a PR:
### Steps of sending a PR
1. fork this repo
2. checkout new branch from dev branch
3. push your commits
4. sending pull request
### Labels
<!-- SpaceVim Wiki labels info start -->
## Labels
| Name | color | description |
| ------------------ | ------- | ----------- |
| BUG | #ee0701 | |
| Discussion | #1be209 | |
| Doc Tuning | #d88d38 | |
| Duplicate | #bfdadc | |
| Feature Requesting | #0052cc | |
| Fixed | #ededed | |
| Mac | #a8b8ed | |
| PR welcome | #674eb2 | |
| RDY | #e99695 | |
| RFC | #006b75 | |
| TODO | #b60205 | |
| WIP | #5319e7 | |
| Website | #282828 | |
| Win | #036d5f | |
| bug-upstream | #7d2dc4 | |
| enhancement | #84b6eb | |
| lang:go | #8cf2c2 | |
| need help | #78db00 | |
| no-reproduce | #8851b5 | |
| unplanned | #eaf24d | |
<!-- SpaceVim Wiki labels info end -->