@24hr/block-cli 中文文档教程
Block CLI
这是一个方便的 CLI 工具,用于生成遵循 Resurs Bank 项目模式的 Gutenberg 块文件。
How to use
使用 npm install -g @24hr/block-cli
全局安装 i 或使用 npx 运行它
如果全局安装,您可以运行 block-cli
.
Commands:
block-cli generate <blockName> Generate block files
block-cli completion generate completion script
Options:
--version Show version number [boolean]
--help Show help [boolean]
Generate block
通过运行后跟块名称的 generate
命令将生成所有文件到当前目录。 确保在要生成块文件的文件夹的根目录下运行此命令。
注意 CLI 将始终将文件放在新文件夹中。
Examples
生成块:
block-cli generate my-new-block
在古腾堡编辑器中生成带有自定义标题的块
block-cli generate my-new-block --title "My New Custom Block"
Block CLI
This is a handy CLI tool to generate Gutenberg block files that follows the Resurs Bank project's pattern.
How to use
Either install i globally with npm install -g @24hr/block-cli
or run it with npx
If installed globally you can run block-cli
.
Commands:
block-cli generate <blockName> Generate block files
block-cli completion generate completion script
Options:
--version Show version number [boolean]
--help Show help [boolean]
Generate block
By running the generate
command followed by the block name will generate all files to the current directory. Be sure that you run this command at the root of the folder where you want the block files to be generated.
NOTE that the CLI will always put the files in a new folder.
Examples
Generate block:
block-cli generate my-new-block
Generate block with custom title in Gutenberg editor
block-cli generate my-new-block --title "My New Custom Block"