Skip to content

Commit 5da57fa

Browse files
committed
accept hustcer's review
1 parent 0a10ec1 commit 5da57fa

File tree

7 files changed

+47
-47
lines changed

7 files changed

+47
-47
lines changed

.vuepress/configs/navbar/zh-CN.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const navbarZhCN: NavbarConfig = [
88
children: [
99
{ text: 'Nushell 之书', link: '/zh-CN/book/' },
1010
{ text: '命令参考列表', link: '/zh-CN/commands/' },
11-
{ text: '食谱', link: '/zh-CN/cookbook/' },
11+
{ text: '实战指南', link: '/zh-CN/cookbook/' },
1212
{ text: '语言参考指南', link: '/zh-CN/lang-guide/' },
1313
{ text: '贡献指南', link: '/zh-CN/contributor-book/' },
1414
],

.vuepress/configs/sidebar/zh-CN.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export const sidebarZhCN: SidebarConfig = {
144144
],
145145
'/zh-CN/cookbook/': [
146146
{
147-
text: '实用技巧',
147+
text: '实战指南',
148148
collapsible: false,
149149
children: [
150150
'/zh-CN/cookbook/README.md',

zh-CN/book/cheat_sheet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Nushell 备忘单
1+
# Nushell 速查表
22

33
## 数据类型
44

@@ -11,7 +11,7 @@
1111
将当前日期转换为提供的时区:
1212

1313
```nu
14-
date now | date to-timezone "Europe/London"
14+
date now | date to-timezone "Asia/Shanghai"
1515
```
1616

1717
更新记录的语言,如果未指定,则插入提供的值:

zh-CN/book/how_nushell_code_gets_run.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Nushell代码执行原理
22

3-
[用Nu思考](./thinking_in_nu.md#think-of-nushell-as-a-compiled-language)中,我们建议您"将Nushell视为编译型语言",这是因为Nushell代码的处理方式。我们还介绍了一些由于这种处理方式而在Nushell中无法工作的代码示例。
3+
[用Nu的方式思考](./thinking_in_nu.md#think-of-nushell-as-a-compiled-language)中,我们建议您"将Nushell视为编译型语言",这是因为Nushell代码的处理方式。我们还介绍了一些由于这种处理方式而在Nushell中无法工作的代码示例。
44

55
其根本原因是Nushell严格分离了 **_解析和评估_** 阶段,并 **_禁止类似`eval`的功能_** 。在本节中,我们将详细解释这意味着什么、为什么这样做以及其影响。解释尽可能简单,但如果您之前使用过其他编程语言可能会更容易理解。
66

@@ -206,7 +206,7 @@ hello()
206206

207207
换句话说,每个REPL调用都是独立的解析-求值序列。通过将环境合并回Nushell状态,我们保持了REPL调用之间的连续性。
208208

209-
比较 _"用Nu思考"_ 中的简化版[`cd`示例](./thinking_in_nu.md#example-change-to-a-different-directory-cd-and-source-a-file)
209+
比较 _"用Nu的方式思考"_ 中的简化版[`cd`示例](./thinking_in_nu.md#example-change-to-a-different-directory-cd-and-source-a-file)
210210

211211
```nu
212212
cd spam
@@ -277,7 +277,7 @@ source-env foo.nu
277277

278278
因此,我们可以将常量用作[`source`](/zh-CN/commands/docs/source.md)[`use`](/zh-CN/commands/docs/use.md)等解析时关键字的安全已知参数。
279279

280-
考虑 _"用Nu思考"_ 中的[这个示例](./thinking_in_nu.md#example-dynamically-creating-a-filename-to-be-sourced)
280+
考虑 _"用Nu的方式思考"_ 中的[这个示例](./thinking_in_nu.md#example-dynamically-creating-a-filename-to-be-sourced)
281281

282282
```nu
283283
let my_path = "~/nushell-files"

zh-CN/book/modules/creating_modules.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ use increment.nu *
7676
# => name, or export `main` command.
7777
```
7878

79-
如错误消息中很有帮助地提到的,您可以简单地将导出重命名为 `main`,在这种情况下,导入时将采用模块的名称。编辑 `increment.nu` 文件:
79+
就像错误消息中提到的那样,您可以简单地将导出重命名为 `main`,在这种情况下,导入时将采用模块的名称。编辑 `increment.nu` 文件:
8080

8181
```nu
8282
export def main []: int -> int {
@@ -208,11 +208,11 @@ export def by [amount: int]: int -> int {
208208

209209
3. 测试它:
210210

211-
```nu
212-
use range-into-list.nu
213-
1..5 | range-into-list | describe
214-
# => list<int> (stream)
215-
```
211+
```nu
212+
use range-into-list.nu
213+
1..5 | range-into-list | describe
214+
# => list<int> (stream)
215+
```
216216

217217
4. 我们现在应该有一个包含以下内容的 `my-utils` 目录:
218218

@@ -234,17 +234,17 @@ export def by [amount: int]: int -> int {
234234

235235
2. 我们现在有一个带有两个子模块的 `my-utils` 模块。试试看:
236236

237-
```nu
238-
# 转到 my-utils 的父目录
239-
cd ..
240-
use my-utils *
241-
5 | increment by 4
242-
# => 9
243-
244-
let file_indices = 0..2..<10 | range-into-list
245-
ls | select ...$file_indices
246-
# => 返回目录中的第 1、3、5、7 和 9 个文件
247-
```
237+
```nu
238+
# 转到 my-utils 的父目录
239+
cd ..
240+
use my-utils *
241+
5 | increment by 4
242+
# => 9
243+
244+
let file_indices = 0..2..<10 | range-into-list
245+
ls | select ...$file_indices
246+
# => Returns the 1st, 3rd, 5th, 7th, and 9th file in the directory
247+
```
248248

249249
在继续下一节之前,运行 `scope modules` 并查找 `my-utils` 模块。请注意,它本身没有命令;只有两个子模块。
250250

@@ -270,7 +270,7 @@ use my-utils *
270270
271271
let file_indices = 0..2..<10 | range-into-list
272272
ls / | sort-by modified | select ...$file_indices
273-
# => 返回目录中从最旧到最新的第 1、3、5、7 和 9 个文件
273+
# => Returns the 1st, 3rd, 5th, 7th, and 9th file in the directory, oldest-to-newest
274274
```
275275

276276
再次运行 `scope modules`,请注意子模块的所有命令都重新导出到 `my-utils` 模块中。
@@ -300,7 +300,7 @@ export use ./range-into-list.nu
300300
use my-utils *
301301
help my-utils
302302
303-
# => 一组有用的实用函数
303+
# => A collection of helpful utility functions
304304
```
305305

306306
另请注意,由于 `increment``range-into-list` 的命令使用 `export use ...` 重新导出,这些命令也显示在主模块的帮助中。
@@ -325,7 +325,7 @@ export-env {
325325
```nu
326326
use my-utils
327327
$env.NU_MODULES_DIR
328-
# => 返回目录名
328+
# => Returns the directory name
329329
cd $env.NU_MODULES_DIR
330330
```
331331

@@ -374,9 +374,9 @@ export def --env modules [] {
374374
```nu
375375
use go.nu
376376
go home
377-
# => 有效
377+
# => Works
378378
go modules
379-
# => 错误:$env.NU_MODULES_DIR 未找到
379+
# => Error: $env.NU_MODULES_DIR is not found
380380
```
381381

382382
这不起作用,因为在这种情况下的 `my-utils` 没有被*求值*;它仅在导入 `go.nu` 模块时被*解析*。虽然这会将所有其他导出带入作用域,但它不会*运行* `export-env` 块。
@@ -474,8 +474,8 @@ use is-alphanumeric.nu *
474474
'Some punctuation?!' | str is-alphanumeric
475475
# => false
476476
'a' in (alpha-num-range)
477-
# => 错误:
478-
# => 帮助:`alpha-num-range` 既不是 Nushell 内置命令也不是已知的外部命令
477+
# => Error:
478+
# => help: `alpha-num-range` is neither a Nushell built-in or a known external command
479479
```
480480

481481
### 子模块的选择性导出
@@ -527,9 +527,9 @@ export use ./go.nu [home, modules]
527527
```nu
528528
use my-utils *
529529
home
530-
# => 有效
530+
# => works
531531
go home
532-
# => 错误:命令未找到
532+
# => Error: command not found
533533
```
534534

535535
要将它们导出为 `go home``go modules`,请对 `my-utils/mod.nu` 进行以下更改:
@@ -547,7 +547,7 @@ export module go {
547547
use my-utils *
548548
# => 如预期:
549549
go home
550-
# => 有效
550+
# => works
551551
home
552-
# => 错误:命令未找到
552+
# => Error: command not found
553553
```

zh-CN/book/modules/using_modules.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ log info "你好哇,模块"
114114

115115
```nu
116116
use std/log
117-
log info "你好,std/log模块"
117+
log info "Hello, std/log Module"
118118
```
119119

120120
注意这将导入`log`子模块及其所有*子命令*(如`log info``log error`等)到当前作用域。
@@ -123,7 +123,7 @@ log info "你好哇,模块"
123123

124124
```nu
125125
use std
126-
std log info "你好,std模块"
126+
std log info "Hello, std Module"
127127
```
128128

129129
- **从模块导入所有定义**
@@ -210,18 +210,18 @@ $PI
210210
```nu
211211
use std/assert
212212
assert equal 1 2
213-
# => 断言失败
213+
# => Assertion failed
214214
assert true
215-
# => 断言通过
215+
# => Assertion passes
216216
217217
hide assert
218218
assert equal 1 1
219-
# => 错误:
220-
# => 帮助:该名称的命令存在于模块`assert`中。尝试用`use`导入它
219+
# => Error:
220+
# => help: A command with that name exists in module `assert`. Try importing it with `use`
221221
222222
assert true
223-
# => 错误:
224-
# => 帮助:该名称的命令存在于模块`assert`中。尝试用`use`导入它
223+
# => Error:
224+
# => help: A command with that name exists in module `assert`. Try importing it with `use`
225225
```
226226

227227
就像你可以`use`模块定义的一个子集一样,你也可以选择性地`hide`它们:
@@ -230,11 +230,11 @@ assert true
230230
use std/assert
231231
hide assert main
232232
assert equal 1 1
233-
# => 断言通过
233+
# => assertion passes
234234
235235
assert true
236-
# => 错误:
237-
# => 帮助:该名称的命令存在于模块`assert`中。尝试用`use`导入它
236+
# => Error:
237+
# => help: A command with that name exists in module `assert`. Try importing it with `use`
238238
```
239239

240240
::: tip

zh-CN/book/thinking_in_nu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 以 Nushell 的方式思考
1+
# 用 Nu 的方式思考
22

33
Nushell 与众不同!新用户通常会带着来自其他 Shell 或语言的现有"习惯"或思维模式。
44

0 commit comments

Comments
 (0)