1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-13 15:37:58 +08:00

Fix layer func

This commit is contained in:
wsdjeg 2017-12-12 09:22:00 +08:00
parent eb8ed33459
commit dd589952df
2 changed files with 29 additions and 26 deletions

View File

@ -6,6 +6,7 @@ function! SpaceVim#dev#layers#update() abort
exe (start + 1) . ',' . (end - 1) . 'delete' exe (start + 1) . ',' . (end - 1) . 'delete'
endif endif
call append(start, s:generate_content()) call append(start, s:generate_content())
silent! Neoformat
endif endif
endfunction endfunction
@ -30,12 +31,12 @@ function! s:layer_list() abort
\ ] \ ]
for layer in layers for layer in layers
let name = split(layer, '/docs/layers')[1][:-4] . '/' let name = split(layer, '/docs/layers')[1][:-4] . '/'
let url = 'https://spacevim.org/layers/' . name let url = 'https://spacevim.org/layers' . name
let content = readfile(layer) let content = readfile(layer)
if len(content) > 3 if len(content) > 3
let line = '[' . name . '](' . url . ') | ' . content[2] let line = '| [' . join(split(name, '/'), '#') . '](' . url . ') | ' . content[2][14:-2] . ' | '
else else
let line = '[' . name . '](' . url . ') | can not find Description' let line = '| [' . join(split(name, '/'), '#') . '](' . url . ') | can not find Description |'
endif endif
call add(list, line) call add(list, line)
endfor endfor

View File

@ -21,28 +21,30 @@ call SpaceVim#layers#load('shell',
## Available layers ## Available layers
| Name | Description | | Name | Description |
| ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| [/autocomplete/](https://spacevim.org/layers//autocomplete/) | description: "This layer provides auto-completion to SpaceVim" | | [autocomplete](https://spacevim.org/layers/autocomplete/) | This layer provides auto-completion to SpaceVim |
| [/chat/](https://spacevim.org/layers//chat/) | --- | | [chat](https://spacevim.org/layers/chat/) | |
| [/checkers/](https://spacevim.org/layers//checkers/) | description: "This layer provides syntax checking feature" | | [checkers](https://spacevim.org/layers/checkers/) | This layer provides syntax checking feature |
| [/chinese/](https://spacevim.org/layers//chinese/) | can not find Description | | [chinese](https://spacevim.org/layers/chinese/) | can not find Description |
| [/colorscheme/](https://spacevim.org/layers//colorscheme/) | description: "colorscheme provides a list of colorscheme for SpaceVim, default colorscheme is gruvbox with dark theme." | | [colorscheme](https://spacevim.org/layers/colorscheme/) | colorscheme provides a list of colorscheme for SpaceVim, default colorscheme is gruvbox with dark theme. |
| [/default/](https://spacevim.org/layers//default/) | SpaceVim default layer contains none plugins, but it has some better default config for vim and neovim. | | [default](https://spacevim.org/layers/default/) | lt layer contains none plugins, but it has some better default config for vim and neovim |
| [/git/](https://spacevim.org/layers//git/) | description: "This layers adds extensive support for git" | | [git](https://spacevim.org/layers/git/) | This layers adds extensive support for git |
| [/index/](https://spacevim.org/layers//index/) | description: A list of available layers in SpaceVim. | | [index](https://spacevim.org/layers/index/) | list of available layers in SpaceVim |
| [/lang/c/](https://spacevim.org/layers//lang/c/) | description: "This layer is for c/c++/object-c development" | | [lang#c](https://spacevim.org/layers/lang/c/) | This layer is for c/c++/object-c development |
| [/lang/java/](https://spacevim.org/layers//lang/java/) | description: "This layer is for Java development" | | [lang#java](https://spacevim.org/layers/lang/java/) | This layer is for Java development |
| [/lang/javascript/](https://spacevim.org/layers//lang/javascript/) | description: "This layer is for JaveScript development" | | [lang#javascript](https://spacevim.org/layers/lang/javascript/) | This layer is for JaveScript development |
| [/lang/lisp/](https://spacevim.org/layers//lang/lisp/) | This layer is for lisp development. | | [lang#lisp](https://spacevim.org/layers/lang/lisp/) | for lisp development |
| [/lang/markdown/](https://spacevim.org/layers//lang/markdown/) | description: "Edit markdown within vim, autopreview markdown in the default browser, with this layer you can also format markdown file." | | [lang#markdown](https://spacevim.org/layers/lang/markdown/) | Edit markdown within vim, autopreview markdown in the default browser, with this layer you can also format markdown file. |
| [/lang/php/](https://spacevim.org/layers//lang/php/) | description: "This layer adds PHP language support to SpaceVim" | | [lang#php](https://spacevim.org/layers/lang/php/) | This layer adds PHP language support to SpaceVim |
| [/lang/python/](https://spacevim.org/layers//lang/python/) | description: "This layer is for Python development, provide autocompletion, syntax checking, code format for python file." | | [lang#python](https://spacevim.org/layers/lang/python/) | This layer is for Python development, provide autocompletion, syntax checking, code format for python file. |
| [/lang/ruby/](https://spacevim.org/layers//lang/ruby/) | --- | | [lang#ruby](https://spacevim.org/layers/lang/ruby/) | |
| [/lang/typescript/](https://spacevim.org/layers//lang/typescript/) | description: "This layer is for TypeScript development" | | [lang#typescript](https://spacevim.org/layers/lang/typescript/) | This layer is for TypeScript development |
| [/lang/vim/](https://spacevim.org/layers//lang/vim/) | --- | | [lang#vim](https://spacevim.org/layers/lang/vim/) | |
| [/shell/](https://spacevim.org/layers//shell/) | description: "This layer provide shell support in SpaceVim" | | [shell](https://spacevim.org/layers/shell/) | This layer provide shell support in SpaceVim |
| [/tags/](https://spacevim.org/layers//tags/) | description: "This layer provide tags manager for project" | | [tags](https://spacevim.org/layers/tags/) | This layer provide tags manager for project |
| [/ui/](https://spacevim.org/layers//ui/) | --- | | [ui](https://spacevim.org/layers/ui/) | |
<!-- SpaceVim layer list end --> <!-- SpaceVim layer list end -->
<!-- vim:set nowrap: -->