30s 中文文档教程

发布于 3年前 浏览 26 项目主页 更新于 3年前

30s

30 秒代码 片段。

NPM构建状态codecovdependabot status“语义发布”license

Demo


Features

  • Written in JavaScript (ES6)
  • View, view by tag and search snippets
  • Show what you find necessary by picking a layout
  • Colorful output or JSON
  • Copy all code to clipboard
  • Automatically updates with new snippet changes
  • Works on Linux, Mac and Windows

Installation

选择以下选项之一来安装命令行应用程序:

Option 1: NPM / Yarn

npm install -g 30s
yarn add -g 30s

Option 2: Source

$ git clone git@github.com:sQVe/30s.git
$ cd 30s/
$ npm install
$ node lib/index.js <command> <query>

Usage

Commands

Short versionLong versionDescription
rrandomView random snippet
ssearchFuzzy search (RegExp) snippets by id
ttagView snippets by tag
vviewView snippet with id
*View snippet with id

Options

Short versionLong versionDescription
-c--cpCopy snippet code to clipboard
-j--jsonPrint output in JSON format
-l--layoutPrint output with specified layout (default: "itced")
-h--helpOutput usage information
Layout
Layout keyDescription
iOutput snippet id
tOutput snippet tags
cOutput snippet code
eOutput snippet examples
dOutput snippet description

Examples

ExampleDescription
30s headView snippet with id head
30s v headView snippet with id head
30s view headView snippet with id head
30s rView random snippet
30s randomView random snippet
30s t arrayView snippets by tag array
30s tag arrayView snippets by tag array
30s s allFind all snippets with an id that contains all
30s search allFind all snippets with an id that contains all
30s view merge --cpView snippet with id merge and copy its code
30s view merge --jsonView snippet with id merge and output as JSON
30s search all --layout ceFind all snippets with an id that contains all and output code and example

Contributing

Bug reports & feature requests

请使用 issue tracker 报告错误或文件功能请求。

Developing

拉取请求非常受欢迎。 执行以下操作以开始提供帮助:

  1. Fork this repository to your own GitHub account and then clone it to your local device.
  2. Run npm install in the created directory to install all necessary dependencies.

可选步骤:

  1. Uninstall 30s if it's already installed: npm uninstall -g 30s
  2. Link it to the global module directory: npm link

Style guide & conventions

尝试遵循函数式编程最佳实践。 尽可能使用纯函数和 Ramda

编写提交如下:Angular Commit Message Conventions。 这使我们能够在 上与 semantic-release 一起自动发布新版本修复feat 提交类型。

prettiereslint-config-sqve(基于 standardjs 的配置) 强制我们的样式和格式。 它会在 pre-commit 上自动运行,还会在 Travis CI 上检查问题。

Roadmap

有关详细的开发路线图,请参阅开发板。 以下是重要改进的简要概述:

  • Autocomplete with omelette
  • Replace commander with basic yargs and own logic

Thanks

非常感谢 30 的核心团队和所有贡献者-seconds-of-code 用于创建精选的精彩片段集合。

License

Creative Commons License
CC0 1.0 Universal

30s

A command-line application for 30 seconds of code snippets.

NPMbuild statuscodecovdependabot statussemantic-releaselicense

Demo


Features

  • Written in JavaScript (ES6)
  • View, view by tag and search snippets
  • Show what you find necessary by picking a layout
  • Colorful output or JSON
  • Copy all code to clipboard
  • Automatically updates with new snippet changes
  • Works on Linux, Mac and Windows

Installation

Pick one of the following options to install the command-line application:

Option 1: NPM / Yarn

npm install -g 30s
yarn add -g 30s

Option 2: Source

$ git clone git@github.com:sQVe/30s.git
$ cd 30s/
$ npm install
$ node lib/index.js <command> <query>

Usage

Commands

Short versionLong versionDescription
rrandomView random snippet
ssearchFuzzy search (RegExp) snippets by id
ttagView snippets by tag
vviewView snippet with id
*View snippet with id

Options

Short versionLong versionDescription
-c--cpCopy snippet code to clipboard
-j--jsonPrint output in JSON format
-l--layoutPrint output with specified layout (default: "itced")
-h--helpOutput usage information
Layout
Layout keyDescription
iOutput snippet id
tOutput snippet tags
cOutput snippet code
eOutput snippet examples
dOutput snippet description

Examples

ExampleDescription
30s headView snippet with id head
30s v headView snippet with id head
30s view headView snippet with id head
30s rView random snippet
30s randomView random snippet
30s t arrayView snippets by tag array
30s tag arrayView snippets by tag array
30s s allFind all snippets with an id that contains all
30s search allFind all snippets with an id that contains all
30s view merge --cpView snippet with id merge and copy its code
30s view merge --jsonView snippet with id merge and output as JSON
30s search all --layout ceFind all snippets with an id that contains all and output code and example

Contributing

Bug reports & feature requests

Please use the issue tracker to report bugs or file feature requests.

Developing

Pull requests are more than welcome. Do the following to start helping out:

  1. Fork this repository to your own GitHub account and then clone it to your local device.
  2. Run npm install in the created directory to install all necessary dependencies.

Optional steps:

  1. Uninstall 30s if it's already installed: npm uninstall -g 30s
  2. Link it to the global module directory: npm link

Style guide & conventions

Try to follow functional programming best practices. Use pure functions and Ramda when possible.

Write commits following: Angular Commit Message Conventions. This enables us to automatically release new versions together with semantic-release on fix and feat commit types.

prettier and eslint-config-sqve (a config based on standardjs) enforces our styling and formatting. It runs automatically on pre-commit and is also checked for issues on Travis CI.

Roadmap

See the development board for a detailed development roadmap. Below are a short outline of important improvements:

  • Autocomplete with omelette
  • Replace commander with basic yargs and own logic

Thanks

A big thank you to the core team and all the contributers at 30-seconds-of-code for creating an awesome curated collection of snippets.

License

Creative Commons License
CC0 1.0 Universal
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文