Skip to content

Commit

Permalink
Clean up contributor book (#1153)
Browse files Browse the repository at this point in the history
* Delete solidly out of date sections

* Update `commands.md` in contributor book

* Remove contributor book translations

* Tweak readme to point to the repo dev docs

* Remove translation index (commented out)

* Readd sidebar to contributor book
  • Loading branch information
sholderbach committed Nov 21, 2023
1 parent 92373c0 commit 2a53464
Show file tree
Hide file tree
Showing 27 changed files with 25 additions and 1,197 deletions.
1 change: 0 additions & 1 deletion .vuepress/configs/navbar/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { NavbarConfig } from '@vuepress/theme-default';

export const navbarEs: NavbarConfig = [
{ text: 'Libro', link: '/es/book/' },
// { text: "Libro Colaborador", link: "/es/contributor-book/" },
{ text: 'Cookbook', link: '/cookbook/' },
{ text: 'Blog', link: '/blog/' },
];
1 change: 0 additions & 1 deletion .vuepress/configs/navbar/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { NavbarConfig } from '@vuepress/theme-default';

export const navbarPtBR: NavbarConfig = [
{ text: 'Livro', link: '/pt-BR/book/' },
// { text: "Livro de Contribuidor", link: "/pt-BR/contributor-book/" },
{ text: 'Cookbook', link: '/cookbook/' },
{ text: 'Blog', link: '/blog/' },
];
30 changes: 14 additions & 16 deletions .vuepress/configs/sidebar/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,20 @@ export const sidebarEn: SidebarConfig = {
children: commandCategories,
},
],
// "/contributor-book/": [
// {
// text: "Contributor Book",
// collapsible: false,
// children: [
// "",
// "philosophy",
// "values",
// "commands",
// "streams",
// "metadata",
// "plugins",
// "shells",
// ],
// },
// ],
'/contributor-book/': [
{
text: 'Contributor Book',
link: '/contributor-book/README.md',
collapsible: false,
children: [
'README.md',
'philosophy',
'philosophy_0_80',
'commands',
'plugins',
],
},
],
'/cookbook/': [
{
text: 'Cookbook',
Expand Down
13 changes: 0 additions & 13 deletions .vuepress/configs/sidebar/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,4 @@ export const sidebarEs: SidebarConfig = {
],
},
],
// "/es/contributor-book/": [
// {
// text: "Contributor Book",
// collapsable: false,
// children: [
// "introduccion",
// "filosofia",
// "valores",
// "comandos",
// "metadatos",
// ],
// },
// ],
};
16 changes: 0 additions & 16 deletions .vuepress/configs/sidebar/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,4 @@ export const sidebarPtBR: SidebarConfig = {
],
},
],
// "/pt-BR/contributor-book/": [
// {
// text: "Contributor Book",
// collapsable: false,
// children: [
// "introdução",
// "filosofia",
// "valores",
// "comandos",
// "streams",
// "metadados",
// "plugins",
// "shells",
// ],
// },
// ],
};
6 changes: 4 additions & 2 deletions contributor-book/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ Hello and welcome to the Nushell Contributor Book. Nushell, or Nu as its often c

Contributing to Nu will require at least some basic programmer experience, and it's helpful to have some experience with Rust. That said, we've had people contribute to Nu who have never written a line of Rust before writing their submission. If you are interested in contributing, there's a growing community of people who would like to help you succeed.

This covers three separate areas:
This aims to cover three separate areas:

1. The Design Philosophy of Nu
1. The Implementation of Nu
1. Best practices of coding for Nu
1. Best practices for coding for Nu

The latter two topics are primarily covered directly in the [Nushell repository](https://github.com/nushell/nushell) in developer documentation crossreferenced from its [`CONTRIBUTING.md` file](https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md).
7 changes: 3 additions & 4 deletions contributor-book/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ Commands are the building blocks for pipelines in Nu. They do the action of the

## Internal commands

All commands inside of Nu, including plugins, are internal commands. Internal commands communicate with each other using streams of [Tagged<Value>](https://github.com/nushell/nushell/blob/d30c40b40ebfbb411a503ad7c7bceae8029c6689/crates/nu-source/src/meta.rs#L91) and [ShellError](https://github.com/nushell/nushell/blob/main/crates/nu-errors/src/lib.rs#L179).
All commands inside of Nu, including plugins, are internal commands. Internal commands communicate with each other using [`PipelineData`](https://docs.rs/nu-protocol/latest/nu_protocol/enum.PipelineData.html).

### Signature

Commands use a light typechecking pass to ensure that arguments passed to them can be handled correctly. To enable this, each command provides a Signature which tells Nu:
Commands use a light typechecking pass to ensure that arguments passed to them can be handled correctly. To enable this, each [`Command`](https://docs.rs/nu-protocol/latest/nu_protocol/engine/trait.Command.html) provides a [`Signature`](https://docs.rs/nu-protocol/latest/nu_protocol/struct.Signature.html) which tells Nu:

- The name of the command
- The positional arguments (e.g. in `start x y` the `x` and `y` are positional arguments)
- If the command takes an unbounded number of additional positional arguments (e.g. `start a1 a2 a3 ... a99 a100`)
- The named arguments (e.g. `ansi gradient --fgstart '0x40c9ff'`)
- If the command is a filter or a sink

With this information, a pipeline can be checked for potential problems before it's executed.

Expand All @@ -34,7 +33,7 @@ Internal commands communicate with each other using the complete value stream th

### Internal to external

Internal commands that send text to external commands need to have prepared text strings ahead of time. If an object is sent directly to an external command, that is considered an error as there is no way to infer how the structured data should be represented for the external command. The user is expected to either narrow down to a simple data cell or to use one of the file type converters (like `to-json`) to convert the table into a string representation.
Internal commands that send text to external commands need to have prepared text strings ahead of time. If an object is sent directly to an external command, that is considered an error as there is no way to infer how the structured data should be represented for the external command. The user is expected to either narrow down to a simple data cell or to use one of the file type converters (like `to json`) to convert the table into a string representation.

The external command is opened so that its `stdin` is redirected, so that the data can be sent to it.

Expand Down
21 changes: 0 additions & 21 deletions contributor-book/metadata.md

This file was deleted.

4 changes: 4 additions & 0 deletions contributor-book/philosophy_0_80.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Philosophy (0.80)
---

# Nushell design philosophy

## Core philosophy
Expand Down
53 changes: 0 additions & 53 deletions contributor-book/shells.md

This file was deleted.

54 changes: 0 additions & 54 deletions contributor-book/streams.md

This file was deleted.

95 changes: 0 additions & 95 deletions contributor-book/values.md

This file was deleted.

10 changes: 0 additions & 10 deletions es/contributor-book/README.md

This file was deleted.

Loading

0 comments on commit 2a53464

Please sign in to comment.