From 8fcae6b93e25a76d628178b840f4ee38d90de74a Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Fri, 17 Feb 2017 21:02:14 +0800 Subject: [PATCH] Fix api page --- autoload/SpaceVim/api/file.vim | 2 ++ docs/api/file.md | 5 ++++- docs/api/system.md | 2 ++ docs/apis.md | 26 +++++++++++++++++++++----- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/autoload/SpaceVim/api/file.vim b/autoload/SpaceVim/api/file.vim index 3660c60ac..f896563bb 100644 --- a/autoload/SpaceVim/api/file.vim +++ b/autoload/SpaceVim/api/file.vim @@ -3,8 +3,10 @@ let s:system = SpaceVim#api#import('system') if s:system.isWindows let s:file['separator'] = '\' + let s:file['pathSeparator'] = ';' else let s:file['separator'] = '/' + let s:file['pathSeparator'] = ':' endif function! SpaceVim#api#file#get() abort diff --git a/docs/api/file.md b/docs/api/file.md index 7ad8b90ca..562850a82 100644 --- a/docs/api/file.md +++ b/docs/api/file.md @@ -2,10 +2,13 @@ title: "file api" --- +# [APIs](https://spacevim.org/apis) : file + ## values name | values | description ----- |:----:| ------------------ -separator | `/` or `\\` | the separator based on the os +separator | `/` or `\` | The system-dependent name-separator character. +pathSeparator | `:` or `;` | The system-dependent path-separator character. ## functions diff --git a/docs/api/system.md b/docs/api/system.md index c484cc12a..e357be0f2 100644 --- a/docs/api/system.md +++ b/docs/api/system.md @@ -2,6 +2,8 @@ title: "system api" --- +# [APIs](https://spacevim.org/apis) : system + ## values name | values | description diff --git a/docs/apis.md b/docs/apis.md index 4df552846..7cdb1441f 100644 --- a/docs/apis.md +++ b/docs/apis.md @@ -4,9 +4,25 @@ title: "APIs" # SpaceVim public APIs: -SpaceVim provide many public apis, you can use this apis in your plugins. here is the list of all the apis: +SpaceVim provide many public apis, you can use this apis in your plugins. -nanme | description ------ | ------------------ -file | -system | +## Usage + +```viml + +let s:file = SpaceVim#api#import('file') +let s:system = SpaceVim#api#import('system') + +if s:system.isWindows + echom "Os is Windows" +endif +echom s:file.separator +echom s:file.pathSeparator +``` + +here is the list of all the apis, and welcome to contribute to SpaceVim. + +name | description | documentation +----- |:----:| ------- +file | basic api about file and directory | [readme](https://spacevim.org/api/file) +system | basic api about system | [readme](https://spacevim.org/api/system)