mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 13:10:04 +08:00
Add layer doc example
This commit is contained in:
parent
c14d85ca5d
commit
ac568458b3
@ -183,20 +183,27 @@ here is an example for creating a new layer names `foo`:
|
|||||||
" @parentsection layers
|
" @parentsection layers
|
||||||
" This the doc for this layer:
|
" This the doc for this layer:
|
||||||
"
|
"
|
||||||
" @subsection Mappings
|
" @subsection Key Bindings
|
||||||
" >
|
" >
|
||||||
" Mode Key Function
|
" Mode Key Function
|
||||||
" -------------------------------------------------------------
|
" -------------------------------------------------------------
|
||||||
" normal <leader>jA generate accessors
|
" normal <leader>jA generate accessors
|
||||||
" normal <leader>js generate setter accessor
|
" normal <leader>js generate setter accessor
|
||||||
" <
|
" <
|
||||||
" @subsection options
|
" @subsection Layer options
|
||||||
" >
|
" >
|
||||||
" Name Description Default
|
" Name Description Default
|
||||||
" -------------------------------------------------------------
|
" -------------------------------------------------------------
|
||||||
" g:foo_option1 Set option1 for foo layer 1
|
" option1 Set option1 for foo layer ''
|
||||||
" g:foo_option2 Set option2 for foo layer 2
|
" option2 Set option2 for foo layer []
|
||||||
" g:foo_option3 Set option3 for foo layer 3
|
" option3 Set option3 for foo layer {}
|
||||||
|
" <
|
||||||
|
" @subsection Global options
|
||||||
|
" >
|
||||||
|
" Name Description Default
|
||||||
|
" -------------------------------------------------------------
|
||||||
|
" g:pluginA_opt1 Set opt1 for plugin A ''
|
||||||
|
" g:pluginB_opt2 Set opt2 for plugin B []
|
||||||
" <
|
" <
|
||||||
|
|
||||||
function! SpaceVim#layers#foo#plugins() abort
|
function! SpaceVim#layers#foo#plugins() abort
|
||||||
@ -215,7 +222,47 @@ function! SpaceVim#layers#foo#config() abort
|
|||||||
endfunction
|
endfunction
|
||||||
```
|
```
|
||||||
|
|
||||||
4. send PR to SpaceVim.
|
4. Add layer document `docs/layers/foo.md` for `foo` layer.
|
||||||
|
|
||||||
|
```md
|
||||||
|
---
|
||||||
|
title: "SpaceVim foo layer"
|
||||||
|
description: "This is a short discription for the foo layer"
|
||||||
|
---
|
||||||
|
|
||||||
|
# [SpaceVim Layers:](https://spacevim.org/layers) foo
|
||||||
|
|
||||||
|
<!-- vim-markdown-toc GFM -->
|
||||||
|
|
||||||
|
- [Description](#description)
|
||||||
|
- [Installation](#installation)
|
||||||
|
- [Layer](#layer)
|
||||||
|
- [Syntax checking && Code formatting](#syntax-checking--code-formatting)
|
||||||
|
- [Key bindings](#key-bindings)
|
||||||
|
- [Inferior REPL process](#inferior-repl-process)
|
||||||
|
- [RuboCop](#rubocop)
|
||||||
|
- [Running current script](#running-current-script)
|
||||||
|
|
||||||
|
<!-- vim-markdown-toc -->
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
This layer is for ruby development.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### Layer
|
||||||
|
|
||||||
|
To use this configuration layer, add `call SpaceVim#layers#load('foo')` to your custom configuration file.
|
||||||
|
|
||||||
|
### Other dependences
|
||||||
|
|
||||||
|
## Key bindings
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
5. Open `docs/layers/index.md`, run `:call SpaceVim#dev#layers#update()` to update layer list.
|
||||||
|
5. send PR to SpaceVim.
|
||||||
|
|
||||||
##### Contributor to an existing layer
|
##### Contributor to an existing layer
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user