0.0.1-alpha.10 • Published 4 years ago

@zhujianshi/slate-code-base v0.0.1-alpha.10

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

what

slate-code-base 提供了在 slate 框架下的代码块功能.

install

yarn add @zhujianshi/slate-code-base

usage

import createCodeBase from '@zhujianshi/slate-code-base';
import '@zhujianshi/slate-code-base/lib/index.css'; // Don't forget import the css file

const yourSlatePlugins = [
  //..
  createCodeBase(option),
];

option

  optiontypedefaultValuedescription
tabLengthnumber4控制一个 tab 等于多少空格

keyMap

  optiondescription
shift+mod+k删除选中行
shift+up将选中区向上移动一行
shift+down将选中区向下移动一行
mod+[将选中区向右缩进(增加缩进)
mod+]将选中区向左缩进(增加缩进)
mod+d选中当前变量

support language

  languagealias
javascriptjs,javascript,jsx
csscss
markupmarkup
cc
cppc++,cpp
htmlhtml
phpphp
haskellhs,haskell

todo

Maybe be added in future:

  • add more language support
  • add theme support