Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency of bash scripts in the tutorial #760

Closed
timKraeuter opened this issue Apr 14, 2024 · 2 comments
Closed

Inconsistency of bash scripts in the tutorial #760

timKraeuter opened this issue Apr 14, 2024 · 2 comments

Comments

@timKraeuter
Copy link
Contributor

timKraeuter commented Apr 14, 2024

The bash scripts are displayed inconsistently across the tutorial, which is a bit confusing and sometimes less ergonomic when following the tutorial.

Problem

For example, in Hello tokio and Spawning the following is used (mind the $, and language=bash):

```bash
$ cargo install mini-redis

In Streams, $ is used but not language=bash, which is fine but could be changed.

However, later in Channels, IO, and Framing scripts are shown as follows (mind the missing $, and language=text not bash):

```text
mkdir src/bin
mv src/main.rs src/bin/server.rs

This is probably because the commands in Channels, IO, and Framing do not create any output, and without $, multiple commands are easier to copy and paste (more ergonomic).
In contrast, in Hello tokio there is a command with output:

$ cargo run
got value from the server; result=Some(b"world")

Solutions

Thus, there are multiple solutions:

  1. Use $ consistently
    • Less ergonomic for multiple commands in one block; see the first block in Hello Tokio.
  2. Drop $ consistently
    • More ergonomic, but commands are less evident due to missing $ Means rewriting the command in Hello Tokio shown above to distinguish commands from output. This is already done at the end of the Setup section.
    • We could highlight bash scripts differently (currently, I do not see a difference between text and bash) to distinguish them from other code blocks representing the output (not exactly sure how to do this yet).
  3. Leave it as is.

Let me know what you think!

I can draft a pull request for 1 or 2 if you like.

@Darksonn
Copy link
Contributor

Thanks for pointing this out. I'm leaning towards consistent use of $.

@timKraeuter
Copy link
Contributor Author

timKraeuter commented Apr 14, 2024

I also think that makes the most sense and seems consistent with what I have seen in other documentation.

I made a minimal pull request (#761) which fixes the issue and subsumes an old pull request (#691).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants