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

feat: move the $ shell line indicator to scss #1354

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions assets/scss/_grpc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,19 @@ body:not(.td-blog) .td-content:not(.list-page) {
}
}

// Render the bash $ prefix indicator to enable easier copy of cli commands
.td-content div.highlight pre {
padding-left: 0.5rem;
code.language-sh:before {
content: "$";
margin-left: 0.5rem;
}
code.language-sh span {
display: inline !important;
margin-left: 0.25rem;
}
}

/*
The following contains some styles in use on the top-level pages
(About, Community...). Bootstrap provides many responsive utilities
Expand Down
8 changes: 4 additions & 4 deletions content/en/docs/languages/cpp/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ Get the example code and build gRPC:
2. From the repo folder, change to the route guide example directory:

```sh
$ cd examples/cpp/route_guide
cd examples/cpp/route_guide
```
3. Run `cmake`

```sh
$ mkdir -p cmake/build
$ cd cmake/build
$ cmake -DCMAKE_PREFIX_PATH=$MY_INSTALL_DIR ../..
mkdir -p cmake/build
cd cmake/build
cmake -DCMAKE_PREFIX_PATH=$MY_INSTALL_DIR ../..
```

### Defining the service
Expand Down
28 changes: 14 additions & 14 deletions content/en/docs/languages/cpp/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ following these instructions:
- Linux

```sh
$ sudo apt install -y cmake
sudo apt install -y cmake
```

- macOS:

```sh
$ brew install cmake
brew install cmake
```

- For general `cmake` installation instructions, see [Installing CMake][].
Expand Down Expand Up @@ -82,13 +82,13 @@ Install the basic tools required to build gRPC:
- Linux

```sh
$ sudo apt install -y build-essential autoconf libtool pkg-config
sudo apt install -y build-essential autoconf libtool pkg-config
```

- macOS:

```sh
$ brew install autoconf automake libtool pkg-config
brew install autoconf automake libtool pkg-config
```

#### Clone the `grpc` repo
Expand Down Expand Up @@ -140,16 +140,16 @@ the steps of the previous section.
1. Change to the example's directory:

```sh
$ cd examples/cpp/helloworld
cd examples/cpp/helloworld
```

2. Build the example using `cmake`:

```sh
$ mkdir -p cmake/build
$ pushd cmake/build
$ cmake -DCMAKE_PREFIX_PATH=$MY_INSTALL_DIR ../..
$ make -j 4
mkdir -p cmake/build
pushd cmake/build
cmake -DCMAKE_PREFIX_PATH=$MY_INSTALL_DIR ../..
make -j 4
```

{{% alert title="Note" color="info" %}}
Expand All @@ -166,13 +166,13 @@ Run the example from the example **build** directory
1. Run the server:

```sh
$ ./greeter_server
./greeter_server
```

1. From a different terminal, run the client and see the client output:

```sh
$ ./greeter_client
./greeter_client
Greeter received: Hello world
```

Expand Down Expand Up @@ -330,19 +330,19 @@ from the example **build** directory `examples/cpp/helloworld/cmake/build`:
1. Build the client and server after having made changes:

```sh
$ make -j 4
make -j 4
```

2. Run the server:

```sh
$ ./greeter_server
./greeter_server
```

3. On a different terminal, run the client:

```sh
$ ./greeter_client
./greeter_client
```

You'll see the following output:
Expand Down
18 changes: 9 additions & 9 deletions content/en/docs/languages/dart/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ spelling: cSpell:ignore Iprotos
the following command:

```sh
$ dart pub global activate protoc_plugin
dart pub global activate protoc_plugin
```

2. Update your `PATH` so that the `protoc` compiler can find the plugin:

```sh
$ export PATH="$PATH:$HOME/.pub-cache/bin"
export PATH="$PATH:$HOME/.pub-cache/bin"
```

{{% alert title="Note" color="info" %}}
Expand All @@ -43,13 +43,13 @@ The example code is part of the [grpc-dart][] repo.
the repo:

```sh
$ git clone https://github.com/grpc/grpc-dart
git clone https://github.com/grpc/grpc-dart
```

2. Change to the quick start example directory:

```sh
$ cd grpc-dart/example/helloworld
cd grpc-dart/example/helloworld
```

### Run the example
Expand All @@ -59,19 +59,19 @@ From the `example/helloworld` directory:
1. Download package dependencies:

```sh
$ dart pub get
dart pub get
```

2. Run the server:

```sh
$ dart bin/server.dart
dart bin/server.dart
```

3. From another terminal, run the client:

```sh
$ dart bin/client.dart
dart bin/client.dart
Greeter client received: Hello, world!
```

Expand Down Expand Up @@ -200,14 +200,14 @@ from the `example/helloworld` directory:
1. Run the server:

```sh
$ dart bin/server.dart
dart bin/server.dart
```

2. From another terminal, run the client. This time, add a name as a command-line
argument:

```sh
$ dart bin/client.dart Alice
dart bin/client.dart Alice
```

You'll see the following output:
Expand Down
8 changes: 4 additions & 4 deletions content/en/docs/languages/go/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ The example code is part of the [grpc-go][] repo.
the repo:

```sh
$ git clone -b {{< param grpc_vers.go >}} --depth 1 https://github.com/grpc/grpc-go
git clone -b {{< param grpc_vers.go >}} --depth 1 https://github.com/grpc/grpc-go
```

2. Change to the example directory:

```sh
$ cd grpc-go/examples/route_guide
cd grpc-go/examples/route_guide
```

### Defining the service
Expand Down Expand Up @@ -566,13 +566,13 @@ Execute the following commands from the `examples/route_guide` directory:
1. Run the server:

```sh
$ go run server/server.go
go run server/server.go
```

2. From another terminal, run the client:

```sh
$ go run client/client.go
go run client/client.go
```

You'll see output like this:
Expand Down
18 changes: 9 additions & 9 deletions content/en/docs/languages/go/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ spelling: cSpell:ignore Fatalf GOPATH
1. Install the protocol compiler plugins for Go using the following commands:

```sh
$ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
```

2. Update your `PATH` so that the `protoc` compiler can find the plugins:

```sh
$ export PATH="$PATH:$(go env GOPATH)/bin"
export PATH="$PATH:$(go env GOPATH)/bin"
```

### Get the example code
Expand All @@ -39,13 +39,13 @@ The example code is part of the [grpc-go][] repo.
the repo:

```sh
$ git clone -b {{< param grpc_vers.go >}} --depth 1 https://github.com/grpc/grpc-go
git clone -b {{< param grpc_vers.go >}} --depth 1 https://github.com/grpc/grpc-go
```

2. Change to the quick start example directory:

```sh
$ cd grpc-go/examples/helloworld
cd grpc-go/examples/helloworld
```

### Run the example
Expand All @@ -55,14 +55,14 @@ From the `examples/helloworld` directory:
1. Compile and execute the server code:

```sh
$ go run greeter_server/main.go
go run greeter_server/main.go
```

2. From a different terminal, compile and execute the client code to see the
client output:

```sh
$ go run greeter_client/main.go
go run greeter_client/main.go
Greeting: Hello world
```

Expand Down Expand Up @@ -178,14 +178,14 @@ from the `examples/helloworld` directory:
1. Run the server:

```sh
$ go run greeter_server/main.go
go run greeter_server/main.go
```

2. From another terminal, run the client. This time, add a name as a
command-line argument:

```sh
$ go run greeter_client/main.go --name=Alice
go run greeter_client/main.go --name=Alice
```

You'll see the following output:
Expand Down
16 changes: 8 additions & 8 deletions content/en/docs/languages/java/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ The example code is part of the [grpc-java][] repo.
the repo:

```sh
$ git clone -b {{< param grpc_vers.java >}} --depth 1 https://github.com/grpc/grpc-java
git clone -b {{< param grpc_vers.java >}} --depth 1 https://github.com/grpc/grpc-java
```

2. Change to the examples directory:

```sh
$ cd grpc-java/examples
cd grpc-java/examples
```

### Run the example
Expand All @@ -32,20 +32,20 @@ From the `examples` directory:
1. Compile the client and server

```sh
$ ./gradlew installDist
./gradlew installDist
```

2. Run the server:

```sh
$ ./build/install/examples/bin/hello-world-server
./build/install/examples/bin/hello-world-server
INFO: Server started, listening on 50051
```

3. From another terminal, run the client:

```sh
$ ./build/install/examples/bin/hello-world-client
./build/install/examples/bin/hello-world-client
INFO: Will try to greet world ...
INFO: Greeting: Hello world
```
Expand Down Expand Up @@ -206,20 +206,20 @@ from the `examples` directory:
1. Compile the client and server:

```sh
$ ./gradlew installDist
./gradlew installDist
```

2. Run the server:

```sh
$ ./build/install/examples/bin/hello-world-server
./build/install/examples/bin/hello-world-server
INFO: Server started, listening on 50051
```

3. From another terminal, run the client:

```sh
$ ./build/install/examples/bin/hello-world-client
./build/install/examples/bin/hello-world-client
INFO: Will try to greet world ...
INFO: Greeting: Hello world
INFO: Greeting: Hello again world
Expand Down
Loading