Skip to content

Commit 6ccdae1

Browse files
committed
Use console for CLI examples
Amazingly the rouge highlighter used by Jekyll (kramdown) has a style called `console` which highlights the prompt perfectly, and also help the eye distinguish between prompt, command, and output. The second best option is the `cisco_ios` style, and even though that looks very good too, I don't think we want to pimp another network OS in our own documentation. Signed-off-by: Joachim Wiberg <[email protected]>
1 parent 407b6c6 commit 6ccdae1

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

_posts/2024-03-08-containers.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ blog post is the first in a series of posts that aims to show this.
3030
All configuration and administration of networking and containers is
3131
done through the CLI:
3232

33-
```
33+
```console
3434
admin@infix:~$ cli
3535

3636
See the 'help' command for an introduction to the system
@@ -66,7 +66,7 @@ to the container as a regular interface.
6666

6767
Here's how you create a container bridge:
6868

69-
```
69+
```console
7070
admin@infix:/> configure
7171
admin@infix:/config> edit interface docker0
7272
admin@infix:/config/interface/docker0> set container-network
@@ -83,7 +83,7 @@ be using [docker://nginx:alpine](https://hub.docker.com/_/nginx). It's
8383
a relatively small container with the Nginx web server built on top of
8484
the Alpine Linux image.
8585

86-
```
86+
```console
8787
admin@infix:/> configure
8888
admin@infix:/config> edit container web
8989
admin@infix:/config/container/web/> set image docker://nginx:alpine
@@ -96,13 +96,13 @@ admin@infix:/config/container/web/network/> leave
9696
Issuing the command `leave` queues a job to download the image and
9797
create a container in the background. To see the progress:
9898

99-
```
99+
```console
100100
admin@infix:/> show log container
101101
```
102102

103103
or just poll the status command:
104104

105-
```
105+
```console
106106
admin@infix:/> show container
107107
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
108108
c60a6deeea4e docker.io/library/nginx:alpine nginx -g daemon o... 2 minutes ago Up 2 minutes 0.0.0.0:8080->80/tcp web
@@ -128,7 +128,7 @@ most importantly, image upgrades.
128128

129129
Here's how to add a volume to your container:
130130

131-
```
131+
```console
132132
admin@infix:/> configure
133133
admin@infix:/config/> edit container web
134134
admin@infix:/config/container/web/> edit volume content
@@ -140,7 +140,7 @@ Named volumes have the downside of being opaque to the host, so the
140140
easiest is to upload the content using `scp` or editing it directly
141141
in the container:
142142

143-
```
143+
```console
144144
admin@infix:/> container shell web
145145
d95ce9f7674d:/# vi /usr/share/nginx/html/
146146
50x.html index.html
@@ -165,7 +165,7 @@ This feature is perfectly suited for container applications that need a
165165
specific site setup. For example a configuration file. Here we use the
166166
same container image to bundle an `index.html` file:
167167

168-
```
168+
```console
169169
admin@infix:/> configure
170170
admin@infix:/config/> edit container web
171171
admin@infix:/config/container/web/> edit mount index.html
@@ -215,7 +215,7 @@ hold down Ctrl while tapping the X and C keys).
215215

216216
Leave configuration context to activate your changes:
217217

218-
```
218+
```console
219219
admin@infix:/config/container/web/mount/index.html/> leave
220220
```
221221

@@ -227,7 +227,7 @@ Reload your browser to see the change.
227227
That's the end of the first post about containers in Infix. Remember to
228228
save your changes for next boot:
229229

230-
```
230+
```console
231231
admin@infix:/> copy running-config startup-config
232232
```
233233

_posts/2024-07-24-setting-hostname.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ the hostname of a device. The default is a unique name composed from
1111
the built-in default name suffixed by the last three octets of the base
1212
MAC address.
1313

14-
```
14+
```console
1515
admin@infix-c0-ff-ee-:/>
1616
```
1717

@@ -21,7 +21,7 @@ Infix build and can be [tailored to your product][0].
2121

2222
The hostname can be changed from the system configuration context:
2323

24-
```
24+
```console
2525
admin@infix-c0-ff-ee:/> configure
2626
admin@infix-c0-ff-ee:/config/> edit system
2727
admin@infix-c0-ff-ee:/config/system/> set hostname example

_posts/2024-07-25-bridge-networking.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This is an example of how to set up a VLAN transparent bridge with a
1111
DHCP assigned IP address. We have a system with two interfaces, or
1212
ports, named `eth0` and `eth1`.
1313

14-
```
14+
```console
1515
admin@example:/> show interfaces
1616
INTERFACE PROTOCOL STATE DATA
1717
lo ethernet UP 00:00:00:00:00:00
@@ -27,7 +27,7 @@ eth1 ethernet UP 00:c0:ff:ee:00:02
2727
Creating a bridge and setting our interfaces as bridge ports is a
2828
straight forward operation.
2929

30-
```
30+
```console
3131
admin@example:/> configure
3232
admin@example:/config/> set interface br0
3333
admin@example:/config/> set interface eth0 bridge-port bridge br0
@@ -64,7 +64,7 @@ interfaces {
6464

6565
Now we enable a DHCP client on `br0` and activate the changes.
6666

67-
```
67+
```console
6868
admin@example:/config/> set dhcp-client client-if br0
6969
admin@example:/config/> leave
7070
admin@example:/>
@@ -73,7 +73,7 @@ admin@example:/>
7373
Back in admin-exec mode we inspect the changes and notice the bridge has
7474
already got a DHCP lease from the server.
7575

76-
```
76+
```console
7777
admin@example:/> show interfaces
7878
INTERFACE PROTOCOL STATE DATA
7979
lo ethernet UP 00:00:00:00:00:00
@@ -90,7 +90,7 @@ admin@example:/>
9090

9191
Remember to save your changes for next boot:
9292

93-
```
93+
```console
9494
admin@infix:/> copy running-config startup-config
9595
```
9696

_posts/2024-07-25-passwordless-login.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ User management is available in the system authentication configuration
1313
context and there is a dedicated `change` command available to simplify
1414
the process:
1515

16-
```
16+
```console
1717
admin@example:/> configure
1818
admin@example:/config/> edit system authentication user admin
1919
admin@example:/config/system/authentication/user/admin/> change password
@@ -50,7 +50,7 @@ SSH key login enabled. The following shows how to add a an authorized
5050
With SSH keys in place it is possible to disable password login, just
5151
remember to verify SSH login and network connectivity before doing so.
5252

53-
```
53+
```console
5454
admin@example:/config/> edit system authentication user admin
5555
admin@example:/config/system/authentication/user/admin/> edit authorized-key jacky@host
5656
admin@example:/config/system/authentication/user/admin/authorized-key/jacky@host/> set algorithm ssh-rsa
@@ -78,7 +78,7 @@ of.
7878
To give another user administrator rights we add them to the `admin`
7979
group:
8080

81-
```
81+
```console
8282
admin@example:/config/> edit nacm group admin
8383
admin@example:/config/nacm/group/admin/> set user-name jacky
8484
admin@example:/config/nacm/group/admin/> leave

0 commit comments

Comments
 (0)