pressbooks / pb-cli
Pressbooks 的 wp-cli 命令集合。
3.1.0
2022-11-16 16:49 UTC
Requires
- php: ^8.0
Requires (Dev)
- wp-cli/entity-command: ^2.1
- wp-cli/extension-command: ^2.1
- wp-cli/scaffold-command: ^2.0
- wp-cli/wp-cli: ^2.5
- wp-cli/wp-cli-tests: ^3.0
README
Pressbooks 的 wp-cli 命令集合。
使用
此软件包实现了以下命令
wp scaffold book-theme
生成 Pressbooks 书籍主题所需的文件。
wp scaffold book-theme <slug> <vendor> [--theme_name=<title>] [--description=<description>] [--uri=<uri>] [--author=<author>] [--author_uri=<author_uri>] [--github_account=<github_account>] [--github_repo=<github_repo>] [--license=<license>] [--textdomain=<textdomain>] [--version=<version>] [--dir=<dir>] [--activate] [--enable-network] [--force]
默认行为是创建以下文件
- functions.php
- .gitignore, .editorconfig, package.json, composer.json, composer.lock, yarn.lock
- README.md
除非指定了 --dir=<dir>
,否则主题将被放置在主题目录中。
选项
<slug>
Slug for the new theme.
<vendor>
Vendor for the new theme. Used in composer.json and package.json.
[--theme_name=<title>]
What to put in the 'Theme Name:' header in 'style.css'. Defaults to <slug>.
[--description=<description>]
Human-readable description for the theme.
[--uri=<uri>]
What to put in the 'Theme URI:' header in 'style.css'.
[--author=<author>]
What to put in the 'Author:' header in 'style.css'.
[--author_uri=<author_uri>]
What to put in the 'Author URI:' header in 'style.css'.
[--github_account=<github_account>]
The GitHub account that owns this project (e.g. 'pressbooks'). Defaults to vendor.
[--github_repo=<github_repo>]
The GitHub repo name for this project (e.g. 'pressbooks-book'). Defaults to slug.
[--license=<license>]
What to put in the 'License:' header in 'style.css'.
---
default: GPL 2.0+
---
[--textdomain=<textdomain>]
Text domain for the theme. Defaults to <slug>.
[--version=<version>]
Version for the theme.
---
default: 1.0
---
[--dir=<dir>]
Specify a destination directory for the command. Defaults to the themes directory.
[--activate]
Activate the newly created book theme.
[--enable-network]
Enable the newly created book theme for the entire network.
[--force]
Overwrite files that already exist.
wp pb issue-template
为 Pressbooks 主题或插件生成问题模板,并将其放置在 .github/ISSUE_TEMPLATE.md。
wp pb issue-template <slug> --type=<type> --owner=<owner> [--dir=<dir>] [--force]
选项
<slug>
Slug for the theme or plugin (e.g. pressbooks, pressbooks-book).
--type=<type>
The type of repo for which we're generating an issue template. Must be `theme` or `plugin`.
--owner=<owner>
The GitHub username of this repo's owner (e.g. pressbooks).
[--dir=<dir>]
Specify a destination directory for the command. Defaults to the theme or plugin's directory.
[--force]
Overwrite files that already exist.
wp pb theme lock
锁定书籍的主题。
wp pb theme lock --url=<url>
选项
--url=<url>
The URL of the target book.
wp pb theme unlock
解锁书籍的主题。
wp pb theme unlock --url=<url>
选项
--url=<url>
The URL of the target book.
wp pb clone
克隆书籍。
wp pb clone <source> <destination> --user=<user>
选项
<source>
URL
<destination>
Book slug on the current network
--user=<user>
sets request to a specific WordPress user
安装
安装此软件包需要 WP-CLI v2.5.0 或更高版本。使用 wp cli update
更新到最新稳定版本。
完成此操作后,您可以使用以下命令安装此软件包
wp package install git@github.com:pressbooks/pb-cli.git
更新通知
2.1.0
- PB-CLI 需要 Pressbooks >= 5.21.0