Skip to content

Commit 2849f4a

Browse files
committed
Freshen up example tab
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent 926a6fa commit 2849f4a

2 files changed

Lines changed: 52 additions & 24 deletions

File tree

_tabs/example.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,60 +7,66 @@ The CLI configure context is generated from the loaded [YANG][1] models
77
and their corresponding [sysrepo][2] plugins. The following is brief
88
example of how to set the IP address of an interface.
99

10-
> The `<TAB>` shown here means press the Tab key to show possible
10+
> The <kbd>TAB</kbd> shown here means press the Tab key to show possible
1111
> command completions.
1212
{: .prompt-tip }
1313

14-
```console
15-
admin@infix-12-34-56:/> configure
16-
admin@infix-12-34-56:/config/> edit interface eth0
17-
admin@infix-12-34-56:/config/interface/eth0/> set ipv4 <TAB>
18-
address autoconf bind-ni-name enabled
19-
forwarding mtu neighbor
20-
admin@infix-12-34-56:/config/interface/eth0/> set ipv4 address 192.168.2.200 prefix-length 24
21-
admin@infix-12-34-56:/config/interface/eth0/> show
14+
<div class="language-console">
15+
<div class="code-header">
16+
<span data-label-text="CLI"><i class="fas fa-code fa-fw small"></i></span>
17+
<button aria-label="copy" data-title-succeed="Copied!"><i class="fas fa-terminal"></i></button></div>
18+
<pre class="highlight"><code class="language-console">admin@infix-12-34-56:/> <b>configure</b>
19+
admin@infix-12-34-56:/config/> <b>edit interface eth0</b>
20+
admin@infix-12-34-56:/config/interface/eth0/> <b>set ipv4 <kbd>TAB</kbd></b>
21+
address autoconf bind-ni-name dhcp
22+
enabled forwarding mtu neighbor
23+
admin@infix-12-34-56:/config/interface/eth0/> <b>set ipv4 address 192.168.2.200 prefix-length 24</b>
24+
admin@infix-12-34-56:/config/interface/eth0/> <b>show</b>
2225
type ethernet;
2326
ipv4 {
2427
address 192.168.2.200 {
2528
prefix-length 24
2629
}
2730
}
28-
ipv6
29-
```
31+
ipv6</code></pre></div>
3032

3133
Whenever you've made a change in configure context, you can see inspect
3234
the modifications with the `diff` command:
3335

3436

35-
```diff
36-
admin@infix-12-34-56:/config/interface/eth0/> diff
37+
<div class="language-console">
38+
<div class="code-header">
39+
<span data-label-text="diff"><i class="fas fa-code fa-fw small"></i></span>
40+
<button aria-label="copy" data-title-succeed="Copied!"><i class="fas fa-terminal"></i></button></div>
41+
<pre class="highlight"><code class="language-diff">admin@infix-12-34-56:/config/interface/eth0/> <b>diff</b>
3742
interfaces {
3843
interface eth0 {
39-
+ ipv4 {
44+
<span class="gi">+ ipv4 {
4045
+ address 192.168.2.200 {
4146
+ prefix-length 24
4247
+ }
43-
+ }
48+
+ }</span>
4449
}
45-
}
46-
```
50+
}</code></pre></div>
4751

4852
To activate the changes you can issue the `leave` command anywhere.
4953
(Use the `abort` command to cancel all changes.) Inspect the changes
5054
made, and remember to save your changes to `startup-config`.
5155

52-
```console
53-
admin@infix-12-34-56:/config/interface/eth0/> leave
54-
admin@infix-12-34-56:/> show interfaces
56+
<div class="language-console">
57+
<div class="code-header">
58+
<span data-label-text="CLI"><i class="fas fa-code fa-fw small"></i></span>
59+
<button aria-label="copy" data-title-succeed="Copied!"><i class="fas fa-terminal"></i></button></div>
60+
<pre class="highlight"><code class="language-console">admin@infix-12-34-56:/config/interface/eth0/> <b>leave</b>
61+
admin@infix-12-34-56:/> <b>show interfaces</b>
5562
INTERFACE PROTOCOL STATE DATA
5663
lo ethernet UP 00:00:00:00:00:00
5764
ipv4 127.0.0.1/8 (static)
5865
ipv6 ::1/128 (static)
5966
eth0 ethernet UP 52:54:00:12:34:56
6067
ipv4 192.168.2.200/24 (static)
6168
ipv6 fe80::5054:ff:fe12:3456/64 (link-layer)
62-
admin@infix-12-34-56:/> copy running-config startup-config
63-
```
69+
admin@infix-12-34-56:/> <b>copy running-config startup-config</b></code></pre></div>
6470

6571
> In the CLI all changes are made to the `running-config`, providing you
6672
> with a basic "undo" mechanism -- in case you make a change that locks
@@ -77,5 +83,5 @@ Curious? Continue reading:
7783

7884
[1]: https://datatracker.ietf.org/doc/html/rfc7950
7985
[2]: https://www.sysrepo.org/
80-
[3]: https://github.com/kernelkit/infix/tree/main/doc/cli
81-
[6]: https://github.com/kernelkit/infix/blob/main/doc/networking.md
86+
[3]: /infix/latest/cli/introduction/
87+
[6]: /infix/latest/networking/
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
---
3+
4+
@import 'main
5+
{%- if jekyll.environment == 'production' -%}
6+
.bundle
7+
{%- endif -%}
8+
';
9+
10+
/* append your custom style below */
11+
pre.highlight {
12+
line-height: 1.2em;
13+
}
14+
15+
/* Raw HTML code blocks (with code-header title bar) lack the Rouge table
16+
structure that normally provides padding via td.rouge-code. */
17+
div[class^='language-'] > pre.highlight {
18+
padding-top: 0.6rem;
19+
padding-bottom: 0.75rem;
20+
padding-left: 1rem;
21+
padding-right: 1.5rem;
22+
}

0 commit comments

Comments
 (0)