Skip to content
Merged
15 changes: 12 additions & 3 deletions .vuepress/configs/navbar/zh-CN.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import type { NavbarConfig } from '@vuepress/theme-default';

export const navbarZhCN: NavbarConfig = [
{ text: '书', link: '/zh-CN/book/' },
// { text: "Contributor Book", link: "/contributor-book/" },
{ text: 'Cookbook', link: '/cookbook/' },
{ text: '安装 Nu !', link: '/zh-CN/book/installation' },
{ text: '快速开始', link: '/zh-CN/book/getting_started' },
{
text: '文档',
children: [
{ text: 'Nushell 之书', link: '/zh-CN/book/' },
{ text: '命令参考列表', link: '/commands/' },
{ text: '实战指南', link: '/zh-CN/cookbook/' },
{ text: '语言参考指南', link: '/lang-guide/' },
{ text: '贡献指南', link: '/zh-CN/contributor-book/' },
],
},
{ text: '博客', link: '/blog/' },
];
172 changes: 132 additions & 40 deletions .vuepress/configs/sidebar/zh-CN.ts
Original file line number Diff line number Diff line change
@@ -1,80 +1,172 @@
import type { SidebarConfig } from '@vuepress/theme-default';
import { commandCategories } from './command_categories';

export const sidebarZhCN: SidebarConfig = {
'/zh-CN/book/': [
{
text: '入门篇',
text: '简介',
link: '/zh-CN/book/README.md',
collapsible: false,
},
{
text: '安装',
link: '/zh-CN/book/installation.md',
collapsible: false,
children: ['/zh-CN/book/default_shell.md'],
},
{
text: '快速入门',
link: '/zh-CN/book/getting_started.md',
collapsible: false,
children: [
'/zh-CN/book/README.md',
'/zh-CN/book/installation',
'/zh-CN/book/thinking_in_nu',
'/zh-CN/book/moving_around',
'/zh-CN/book/quick_tour.md',
'/zh-CN/book/moving_around.md',
'/zh-CN/book/thinking_in_nu.md',
'/zh-CN/book/cheat_sheet.md',
],
},
{
text: 'Nu 基础篇',
link: '/zh-CN/book/nu_fundamentals.md',
collapsible: false,
children: [
'/zh-CN/book/types_of_data',
'/zh-CN/book/loading_data',
'/zh-CN/book/working_with_strings',
'/zh-CN/book/working_with_lists',
'/zh-CN/book/working_with_tables',
'/zh-CN/book/pipelines',
'/zh-CN/book/command_reference',
'/zh-CN/book/types_of_data.md',
'/zh-CN/book/loading_data.md',
'/zh-CN/book/pipelines.md',
'/zh-CN/book/working_with_strings.md',
'/zh-CN/book/working_with_lists.md',
'/zh-CN/book/working_with_records.md',
'/zh-CN/book/working_with_tables.md',
'/zh-CN/book/navigating_structured_data.md',
'/zh-CN/book/special_variables.md',
],
},
{
text: 'Nushell 编程',
link: '/zh-CN/book/programming_in_nu.md',
collapsible: false,
children: [
'/zh-CN/book/custom_commands',
'/zh-CN/book/aliases',
'/zh-CN/book/operators',
'/zh-CN/book/variables_and_subexpressions',
'/zh-CN/book/scripts',
'/zh-CN/book/modules',
'/zh-CN/book/overlays',
'/zh-CN/book/custom_commands.md',
'/zh-CN/book/aliases.md',
'/zh-CN/book/operators.md',
'/zh-CN/book/variables.md',
'/zh-CN/book/control_flow.md',
'/zh-CN/book/scripts.md',
{
text: '模块',
link: '/zh-CN/book/modules.md',
collapsible: false,
children: [
'/zh-CN/book/modules/using_modules.md',
'/zh-CN/book/modules/creating_modules.md',
],
},
'/zh-CN/book/overlays.md',
'/zh-CN/book/sorting.md',
'/zh-CN/book/testing.md',
'/zh-CN/book/style_guide.md',
],
},
{
text: 'Nu 作为 Shell 使用',
link: '/zh-CN/book/nu_as_a_shell.md',
collapsible: false,
children: [
'/zh-CN/book/configuration',
'/zh-CN/book/environment',
'/zh-CN/book/stdout_stderr_exit_codes',
'/zh-CN/book/escaping',
'/zh-CN/book/3rdpartyprompts',
'/zh-CN/book/shells_in_shells',
'/zh-CN/book/line_editor',
'/zh-CN/book/externs',
'/zh-CN/book/custom_completions',
'/zh-CN/book/coloring_and_theming',
'/zh-CN/book/configuration.md',
'/zh-CN/book/environment.md',
'/zh-CN/book/stdout_stderr_exit_codes.md',
'/zh-CN/book/running_externals.md',
'/zh-CN/book/3rdpartyprompts.md',
'/zh-CN/book/directory_stack.md',
'/zh-CN/book/line_editor.md',
'/zh-CN/book/custom_completions.md',
'/zh-CN/book/externs.md',
'/zh-CN/book/coloring_and_theming.md',
'/zh-CN/book/hooks.md',
'/zh-CN/book/background_jobs.md',
],
},
{
text: '迁移到 Nu',
link: '/zh-CN/book/coming_to_nu.md',
collapsible: false,
children: [
'/zh-CN/book/coming_from_bash',
'/zh-CN/book/nushell_map',
'/zh-CN/book/nushell_map_imperative',
'/zh-CN/book/nushell_map_functional',
'/zh-CN/book/nushell_operator_map',
'/zh-CN/book/coming_from_bash.md',
'/zh-CN/book/coming_from_cmd.md',
'/zh-CN/book/nushell_map.md',
'/zh-CN/book/nushell_map_imperative.md',
'/zh-CN/book/nushell_map_functional.md',
'/zh-CN/book/nushell_operator_map.md',
],
},
{
text: '高级篇',
text: '设计说明',
link: '/zh-CN/book/design_notes.md',
collapsible: false,
children: ['/zh-CN/book/how_nushell_code_gets_run.md'],
},
{
text: '(不怎么)高级篇',
link: '/zh-CN/book/advanced.md',
collapsible: false,
children: [
'/zh-CN/book/standard_library.md',
'/zh-CN/book/dataframes.md',
'/zh-CN/book/metadata.md',
'/zh-CN/book/creating_errors.md',
'/zh-CN/book/parallelism.md',
'/zh-CN/book/plugins.md',
'/zh-CN/book/explore.md',
],
},
],
'/commands/': [
{
text: '命令分类',
collapsible: false,
children: commandCategories,
},
],
'/zh-CN/contributor-book/': [
{
text: '贡献者指南',
link: '/zh-CN/contributor-book/README.md',
collapsible: false,
children: [
'/zh-CN/contributor-book/README.md',
'/zh-CN/contributor-book/philosophy',
'/zh-CN/contributor-book/philosophy_0_80',
'/zh-CN/contributor-book/commands',
'/zh-CN/contributor-book/plugins',
'/zh-CN/contributor-book/plugin_protocol_reference',
],
},
],
'/zh-CN/cookbook/': [
{
text: '实战指南',
collapsible: false,
children: [
'/zh-CN/book/dataframes',
'/zh-CN/book/metadata',
'/zh-CN/book/creating_errors',
'/zh-CN/book/parallelism',
'/zh-CN/book/plugins',
'/zh-CN/cookbook/README.md',
'/zh-CN/cookbook/setup',
'/zh-CN/cookbook/help',
'/zh-CN/cookbook/system',
'/zh-CN/cookbook/parsing',
'/zh-CN/cookbook/foreign_shell_scripts',
'/zh-CN/cookbook/pattern_matching',
'/zh-CN/cookbook/custom_completers',
'/zh-CN/cookbook/external_completers',
'/zh-CN/cookbook/modules',
'/zh-CN/cookbook/files',
'/zh-CN/cookbook/git',
'/zh-CN/cookbook/parsing_git_log',
'/zh-CN/cookbook/input_listen_keys',
'/zh-CN/cookbook/http',
'/zh-CN/cookbook/direnv',
'/zh-CN/cookbook/ssh_agent',
'/zh-CN/cookbook/tables',
'/zh-CN/cookbook/polars_v_pandas_v_nushell',
'/zh-CN/cookbook/jq_v_nushell',
],
},
],
Expand Down
7 changes: 4 additions & 3 deletions cookbook/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Because you can append a list of paths, you can append multiple at once. You can
$env.PATH ++= [ '~/.local/bin', ($env.CARGO_HOME | path join "bin") ]
```

Because PATH order makes a difference, you may want to *prepend* your paths instead, so that they take precedence over other executables with the same name:
Because PATH order makes a difference, you may want to _prepend_ your paths instead, so that they take precedence over other executables with the same name:

```
use std/util "path add"
Expand Down Expand Up @@ -84,6 +84,7 @@ You should now be able to run `config nu` or `config env` and edit those files e
```nu
$env.APPDATA
```

---

### Use hooks to export state via environment variables
Expand All @@ -95,11 +96,11 @@ To be most compatible, the `starship` binary will run every prompt render and
is absolute stateless.
Nushell, however, is very stateful in a single instance.

[Hooks](https://www.nushell.sh/book/hooks.html#hooks) allow registration of
[Hooks](../book/hooks.md) allow registration of
custom callback functions.
In this case, the `pre_prompt` hook is very useful.
With it, we can export state information as an environment variable, for
example, what [overlays](https://www.nushell.sh/book/overlays.html) are
example, what [overlays](../book/overlays.md) are
currently activated.

```nu
Expand Down
23 changes: 21 additions & 2 deletions zh-CN/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ actionText: 点此了解更多 →
actionLink: /zh-CN/book/
features:
- title: 利用管道控制任意系统
details: Nu 可以在 Linux、macOS 和 Windows 上运行。一次学习,处处可用。
details: Nu 可以在 Linux、macOS、BSD 和 Windows 上运行。一次学习,处处可用。
- title: 一切皆数据
details: Nu 管道使用结构化数据,你可以用同样的方式安全地选择,过滤和排序。停止解析字符串,开始解决问题。
- title: 强大的插件系统
Expand All @@ -34,20 +34,39 @@ Nushell 可以通过 [你喜欢的软件包管理器](https://repology.org/proje

#### macOS / Linux:

##### Homebrew

```shell
$ brew install nushell
```

##### Nix profile

```shell
$ nix profile install nixpkgs#nushell
```

#### Windows:

```powershell
# 安装到用户范围(默认)。
winget install nushell
# 系统范围安装(以管理员身份运行)。
winget install nushell --scope machine
```

完成安装后,输入 `nu` 来启动 Nu。

## 文档

- [入门](/zh-CN/book/getting_started.html) 指引你熟悉 Nushell
- [Nu 之异同](/zh-CN/book/coming_to_nu.html) 描述了 Nu 与其他语言和 Shell 的异同之处
- [Nu 基础](/zh-CN/book/nu_fundamentals.html) 是对 Nu 基础知识更详尽、更有条理的描述
- [Nu 编程](/zh-CN/book/programming_in_nu.html) 将 Nu 作为一门编程语言进行描述
- [作为 Shell 的 Nu](/zh-CN/book/nu_as_a_shell.html) 让你深入了解 Shell 环境中的交互功能和可配置性

## 社区

如果你有任何问题可以在 [Discord](https://discord.gg/NtAbbGn) 上找到我们。

您可以通过 [意见反馈](https://github.com/nushell/nushell.github.io/issues) 或者 [贡献 PR](https://github.com/nushell/nushell.github.io/pulls) 来帮助我们完善此网站。
你可以通过 [意见反馈](https://github.com/nushell/nushell.github.io/issues) 或者 [贡献 PR](https://github.com/nushell/nushell.github.io/pulls) 来帮助我们完善此网站。
Loading