diff --git a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/api_reference.md b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/api_reference.md index 8e3f0fcb..3ba44d2d 100644 --- a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/api_reference.md +++ b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/api_reference.md @@ -15,12 +15,10 @@ task [--flags] [tasks...] [-- CLI_ARGS...] :::tip - 如果 `--` 给出,所有剩余参数将被分配给一个特殊的 `CLI_ARGS` 变量 ::: - | 缩写 | 标志 | 类型 | 默认 | 描述 | | ---- | --------------------------- | -------- | -------------------------------- | --------------------------------------------------------------------------------------------------- | | `-c` | `--color` | `bool` | `true` | 彩色输出。 默认开启。 设置为 `false` 或使用 `NO_COLOR=1` 禁用。 | @@ -137,7 +135,6 @@ task [--flags] [tasks...] [-- CLI_ARGS...] :::info - 像下面这样只赋值一个字符串,和把这个值设置到 `taskfile` 属性是一样的。 ```yaml @@ -147,7 +144,6 @@ includes: ::: - ### Task | 属性 | 类型 | 默认 | 描述 | @@ -179,7 +175,6 @@ includes: :::info - 这些替代语法可用。 他们会将给定值设置为 `cmds`,其他所有内容都将设置为其默认值: ```yaml @@ -196,7 +191,6 @@ tasks: ::: - ### Dependency | 属性 | 类型 | 默认 | 描述 | @@ -206,7 +200,6 @@ tasks: :::tip - 如果你不想设置额外的变量,将依赖关系声明为一个字符串列表就足够了(它们将被分配给 `task`)。 ```yaml @@ -217,7 +210,6 @@ tasks: ::: - ### Command | 属性 | 类型 | 默认 | 描述 | @@ -234,7 +226,6 @@ tasks: :::info - 如果以字符串形式给出,该值将分配给 `cmd`: ```yaml @@ -247,7 +238,6 @@ tasks: ::: - ### Variable | 属性 | 类型 | 默认 | 描述 | @@ -257,7 +247,6 @@ tasks: :::info - 静态和动态变量有不同的语法,如下所示: ```yaml @@ -269,7 +258,6 @@ vars: ::: - ### Precondition | 属性 | 类型 | 默认 | 描述 | @@ -279,7 +267,6 @@ vars: :::tip - 如果你不想设置不同的消息,你可以像这样声明一个前提条件,值将被分配给 `sh`: ```yaml diff --git a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/installation.md b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/installation.md index 1df25622..d540e44b 100644 --- a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/installation.md +++ b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/installation.md @@ -35,7 +35,7 @@ sudo snap install task --classic ### Chocolatey -如果 Windows 上安装了 [Chocolatey](https://chocolatey.org/),再安装 Task 只要这样: +如果 Windows 上安装了 [Chocolatey][choco],再安装 Task 只要这样: ```bash choco install go-task @@ -45,7 +45,7 @@ choco install go-task ### Scoop -如果 Windows 上安装了 [Scoop](https://scoop.sh/),再安装 Task 只要这样: +如果 Windows 上安装了 [Scoop][scoop],再安装 Task 只要这样: ```cmd scoop install task @@ -125,12 +125,10 @@ sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin :::caution - 在 macOS 和 Windows 上,`~/.local/bin` 和 `~/bin` 默认情况下不会添加到 `$PATH`。 ::: - ### GitHub Actions 如果你想在 GitHub Actions 中安装 Task,你可以尝试使用 Arduino 团队的 [这个 action](https://github.com/arduino/setup-task): @@ -162,12 +160,10 @@ env GOBIN=/bin go install github.com/go-task/task/v3/cmd/task@latest :::tip - 对于 CI 环境,我们建议改用 [安装脚本](#get-the-binary),它更快更稳定,因为它只会下载最新发布的二进制文件。 ::: - ## 自动完成 下载与您的 shell 对应的自动完成文件。 @@ -229,3 +225,6 @@ notepad $profile ```shell Invoke-Expression -Command path/to/task.ps1 ``` + +[choco]: https://chocolatey.org/ +[scoop]: https://scoop.sh/ diff --git a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/intro.md b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/intro.md index 6dff60ad..47f37190 100644 --- a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/intro.md +++ b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/intro.md @@ -14,7 +14,7 @@ Task 是一个任务运行器/构建工具,旨在比 [GNU Make](https://www.gn 由于它是用 [Go](https://go.dev/) 编写的,Task 只是一个二进制文件,没有其他依赖项,这意味着您不需要为了使用构建工具而搞乱任何复杂的安装设置。 -[安装](installation.md) 后,您只需在名为 `Taskfile.yml` 的文件中使用简单的 [YAML](http://yaml.org/) 规则描述您的构建任务: +[安装](installation.md) 后,您只需在名为 `Taskfile.yml` 的文件中使用简单的 [YAML][yaml] 规则描述您的构建任务: ```yaml title="Taskfile.yml" version: '3' @@ -46,3 +46,4 @@ tasks: | [![Appwrite](/img/appwrite.svg)][appwrite] | +[yaml]: http://yaml.org/ diff --git a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/taskfile_versions.md b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/taskfile_versions.md index c8f2c05b..f93ff8c7 100644 --- a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/taskfile_versions.md +++ b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/taskfile_versions.md @@ -89,7 +89,7 @@ tasks: ## 版本 2.1 -2.1 版包括一个全局 `output` 选项,以允许更好地控制如何将命令输出打印到控制台(有关更多信息,请参阅 [文档](usage.md#输出语法)): +2.1 版包括一个全局 `output` 选项,以允许更好地控制如何将命令输出打印到控制台(有关更多信息,请参阅 [文档][output]): ```yaml version: '2' @@ -103,7 +103,7 @@ tasks: prefix: server ``` -从这个版本开始,也可以忽略命令或 task 的错误(在 [此处](usage.md#忽略错误) 查看文档): +从这个版本开始,也可以忽略命令或 task 的错误(在 [此处][ignore_errors] 查看文档): ```yaml version: '2' @@ -149,7 +149,7 @@ tasks: - aws s3 cp .env s3://myenvironment ``` -请检查 [文档](usage.md#包含其他-taskfile) +请检查 [文档][includes] ## 版本 3 @@ -202,3 +202,7 @@ tasks: - 全局或 CLI 变量 - 调用变量 - Task 内的变量 + +[output]: usage.md#输出语法 +[ignore_errors]: usage.md#忽略错误 +[includes]: usage.md#包含其他-taskfile diff --git a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/translate.md b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/translate.md new file mode 100644 index 00000000..7061903f --- /dev/null +++ b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/translate.md @@ -0,0 +1,15 @@ +--- +slug: /translate/ +sidebar_position: 13 +--- + +# Translate + +Want to help us translate this documentation? In this document we explain how. + +Do NOT edit translated markdown files directly on the GitHub repository! We use [Crowdin][crowdin] to allow contributors on work on translations. The repository is periodically updated with progress from Crowdin. + +If you want to have access to the Crowdin project to be able to suggest translations, please ask for access on the [#translations channel on our Discord server][discord]. If a given language is not being shown to Crowdin yet, just ask and we can configure it. + +[crowdin]: https://crowdin.com/project/taskfile +[discord]: https://discord.gg/6TY36E39UK diff --git a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage.md b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage.md index 6a3edd4b..949d564e 100644 --- a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage.md +++ b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/current/usage.md @@ -71,7 +71,6 @@ This is useful to have automation that you can run from anywhere in your system! :::info - When running your global Taskfile with `-g`, tasks will run on `$HOME` by default, and not on your working directory! As mentioned in the previous section, the `{{.USER_WORKING_DIR}}` special variable can be very handy here to run stuff on the directory you're calling `task -g` from. @@ -92,7 +91,6 @@ tasks: ::: - ## 环境变量 ### Task @@ -126,12 +124,10 @@ tasks: :::info - `env` supports expansion and retrieving output from a shell command just like variables, as you can see in the [Variables](#variables) section. ::: - ### .env 文件 You can also ask Task to include `.env` like files by using the `dotenv:` setting: @@ -192,12 +188,10 @@ tasks: :::info - Please note that you are not currently able to use the `dotenv` key inside included Taskfiles. ::: - ## 包含其他 Taskfile If you want to share tasks between different projects (Taskfiles), you can use the importing mechanism to include other Taskfiles using the `includes` keyword: @@ -240,12 +234,10 @@ includes: :::info - The included Taskfiles must be using the same schema version as the main Taskfile uses. ::: - ### Optional includes Includes marked as optional will allow Task to continue execution as normal if the included file is missing. @@ -311,12 +303,10 @@ includes: :::info - Vars declared in the included Taskfile have preference over the variables in the including Taskfile! If you want a variable in an included Taskfile to be overridable, use the [default function](https://go-task.github.io/slim-sprig/defaults.html): `MY_VAR: '{{.MY_VAR | default "my-default-value"}}'`. ::: - ## 内部 task Internal tasks are tasks that cannot be called directly by the user. They will not appear in the output when running `task --list|--list-all`. Other tasks may call internal tasks in the usual way. This is useful for creating reusable, function-like tasks that have no useful purpose on the command line. @@ -398,12 +388,10 @@ If there is more than one dependency, they always run in parallel for better per :::tip - You can also make the tasks given by the command line run in parallel by using the `--parallel` flag (alias `-p`). Example: `task --parallel js css`. ::: - If you want to pass information to dependencies, you can do that the same manner as you would to [call another task](#calling-another-task): ```yaml @@ -536,12 +524,10 @@ The above syntax is also supported in `deps`. :::tip - NOTE: If you want to call a task declared in the root Taskfile from within an [included Taskfile](#including-other-taskfiles), add a leading `:` like this: `task: :task-name`. ::: - ## Prevent unnecessary work ### By fingerprinting locally generated files and their sources @@ -596,7 +582,6 @@ In situations where you need more flexibility the `status` keyword can be used. :::info - By default, task stores checksums on a local `.task` directory in the project's directory. Most of the time, you'll want to have this directory on `.gitignore` (or equivalent) so it isn't committed. (If you have a task for code generation that is committed it may make sense to commit the checksum of that task as well, though). If you want these files to be stored in another directory, you can set a `TASK_TEMP_DIR` environment variable in your machine. It can contain a relative path like `tmp/task` that will be interpreted as relative to the project directory, or an absolute or home path like `/tmp/.task` or `~/.task` (subdirectories will be created for each project). @@ -607,33 +592,26 @@ export TASK_TEMP_DIR='~/.task' ::: - :::info - Each task has only one checksum stored for its `sources`. If you want to distinguish a task by any of its input variables, you can add those variables as part of the task's label, and it will be considered a different task. This is useful if you want to run a task once for each distinct set of inputs until the sources actually change. For example, if the sources depend on the value of a variable, or you if you want the task to rerun if some arguments change even if the source has not. ::: - :::tip - The method `none` skips any validation and always run the task. ::: - :::info - For the `checksum` (default) or `timestamp` method to work, it is only necessary to inform the source files. When the `timestamp` method is used, the last time of the running the task is considered as a generate. ::: - ### Using programmatic checks to indicate a task is up to date. Alternatively, you can inform a sequence of tests as `status`. If no error is returned (exit status 0), the task is considered up-to-date: @@ -787,12 +765,10 @@ $ TASK_VARIABLE=a-value task do-something :::tip - A special variable `.TASK` is always available containing the task name. ::: - Since some shells do not support the above syntax to set environment variables (Windows) tasks also accept a similar style when not at the beginning of the command. ```bash @@ -897,15 +873,13 @@ tasks: :::info - Due to the nature of how the [Go's own `defer` work](https://go.dev/tour/flowcontrol/13), the deferred commands are executed in the reverse order if you schedule multiple of them. ::: - ## Go 的模板引擎 -Task parse commands as [Go's template engine](https://golang.org/pkg/text/template/) before executing them. Variables are accessible through dot syntax (`.VARNAME`). +Task parse commands as [Go's template engine][gotemplate] before executing them. Variables are accessible through dot syntax (`.VARNAME`). All functions by the Go's [slim-sprig lib](https://go-task.github.io/slim-sprig/) are available. The following example gets the current date in a given format: @@ -1289,12 +1263,10 @@ $ task default :::tip - The `output` option can also be specified by the `--output` or `-o` flags. ::: - ## 交互式 CLI 应用 When running interactive CLI applications inside Task they can sometimes behave weirdly, especially when the [output mode](#output-syntax) is set to something other than `interleaved` (the default), or when interactive apps are run in parallel with other tasks. @@ -1345,14 +1317,14 @@ tasks: :::info - Keep in mind that not all options are available in the [shell interpreter library](https://github.com/mvdan/sh) that Task uses. ::: - ## 观察任务 With the flags `--watch` or `-w` task will watch for file changes and run the task again. This requires the `sources` attribute to be given, so task knows which files to watch. The default watch interval is 5 seconds, but it's possible to change it by either setting `interval: '500ms'` in the root of the Taskfile passing it as an argument like `--interval=500ms`. + +[gotemplate]: https://golang.org/pkg/text/template/