You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -16,14 +16,16 @@ This blog post explains how to contribute a blog article to our portal and what
16
16
17
17
<!-- more -->
18
18
19
-
!!!question "What should I write about? Or should I even start writing?"
20
-
Likely the hardest thing in writing is to start. You may have dozens of doubts preventing you start writing.
19
+
/// admonition | What should I write about? Or should I even start writing?
20
+
type: question
21
+
Likely the hardest thing in writing is to start. You may have dozens of doubts preventing you start writing.
21
22
22
-
*Is this interesting to anyone? Isn't it too obvious? Is it too short/long?*
23
+
*Is this interesting to anyone? Isn't it too obvious? Is it too short/long?*
23
24
24
-
The best advice here might be just to start writing and reiterate as you go. Nothing is perfect, and we welcome all to embrace the joy of writing, which helps to structure your own thoughts and get a firmer grip on the topic.
25
+
The best advice here might be just to start writing and reiterate as you go. Nothing is perfect, and we welcome all to embrace the joy of writing, which helps to structure your own thoughts and get a firmer grip on the topic.
25
26
26
-
SR Linux appreciates modern network architectures, network automation/orchestration and programmability. Anything that falls under and in-between these domains will make a great blog post.
27
+
SR Linux appreciates modern network architectures, network automation/orchestration and programmability. Anything that falls under and in-between these domains will make a great blog post.
28
+
///
27
29
28
30
## Creating a blog post
29
31
@@ -58,61 +60,69 @@ This portal uses the famous [mkdocs-material](https://squidfunk.github.io/mkdocs
58
60
59
61
We would like to highlight a few UI elements we use all the time and hope you'll also like them.
60
62
61
-
!!!tip
62
-
Check the [mkdocs-material reference](https://squidfunk.github.io/mkdocs-material/reference/) for a deep dive in the ocean of options and elements mkdocs-material theme provides.
63
+
/// admonition
64
+
type: tip
65
+
Check the [mkdocs-material reference](https://squidfunk.github.io/mkdocs-material/reference/) for a deep dive in the ocean of options and elements mkdocs-material theme provides.
66
+
///
63
67
64
68
### Tabs
65
69
66
70
Tabs help to visually organize the content and improve readability an awful lot.
67
71
68
-
```title="Content tabs with code blocks"
69
-
=== "C"
72
+
````title="Content tabs with code blocks"
73
+
/// tab | C
70
74
71
-
``` c
72
-
#include <stdio.h>
75
+
``` c
76
+
#include <stdio.h>
73
77
74
-
int main(void) {
75
-
printf("Hello world!\n");
76
-
return 0;
77
-
}
78
-
```
78
+
int main(void) {
79
+
printf("Hello world!\n");
80
+
return 0;
81
+
}
82
+
```
79
83
80
-
=== "C++"
84
+
///
85
+
/// tab | C++
81
86
82
-
``` c++
83
-
#include <iostream>
87
+
``` c++
88
+
#include <iostream>
84
89
85
-
int main(void) {
86
-
std::cout << "Hello world!" << std::endl;
87
-
return 0;
88
-
}
89
-
```
90
+
int main(void) {
91
+
std::cout << "Hello world!" << std::endl;
92
+
return 0;
93
+
}
90
94
```
91
95
96
+
///
97
+
98
+
````
99
+
92
100
<divclass="result"markdown>
93
101
94
-
=== "C"
102
+
/// tab | C
95
103
96
-
``` c
97
-
#include <stdio.h>
104
+
```c
105
+
#include<stdio.h>
98
106
99
-
int main(void) {
100
-
printf("Hello world!\n");
101
-
return 0;
102
-
}
103
-
```
107
+
intmain(void) {
108
+
printf("Hello world!\n");
109
+
return 0;
110
+
}
111
+
```
104
112
105
-
=== "C++"
113
+
///
114
+
/// tab | C++
106
115
107
-
``` c++
108
-
#include <iostream>
116
+
``` c++
117
+
#include <iostream>
109
118
110
-
int main(void) {
111
-
std::cout << "Hello world!" << std::endl;
112
-
return 0;
113
-
}
114
-
```
119
+
int main(void) {
120
+
std::cout << "Hello world!" << std::endl;
121
+
return 0;
122
+
}
123
+
```
115
124
125
+
///
116
126
</div>
117
127
118
128
### Code
@@ -122,14 +132,15 @@ Nowadays, code is everywhere. With a few styling aids you can make your code blo
122
132
A regular code block with a syntax highlighting uses code fences style:
123
133
124
134
````markdown title="Code block"
125
-
```py
135
+
```py
126
136
import tensorflow as tf
127
137
```
138
+
128
139
````
129
140
130
141
<divclass="result"markdown>
131
142
132
-
```py
143
+
```py
133
144
import tensorflow as tf
134
145
```
135
146
@@ -139,8 +150,8 @@ import tensorflow as tf
139
150
140
151
To add a title to a code block, use the `title` attribute:
141
152
142
-
````markdown title="Code block with title"
143
-
```py title="bubble_sort.py"
153
+
````markdown title="Code block with title"
154
+
```py title="bubble_sort.py"
144
155
def bubble_sort(items):
145
156
for i in range(len(items)):
146
157
for j in range(len(items) - 1 - i):
@@ -151,7 +162,7 @@ def bubble_sort(items):
151
162
152
163
<divclass="result"markdown>
153
164
154
-
```py title="bubble_sort.py"
165
+
```py title="bubble_sort.py"
155
166
defbubble_sort(items):
156
167
for i inrange(len(items)):
157
168
for j inrange(len(items) -1- i):
@@ -168,8 +179,8 @@ option directly after the shortcode, whereas `<start>` represents the starting
168
179
line number. A code block can start from a line number other than `1`, which
169
180
allows to split large code blocks for readability:
170
181
171
-
````markdown title="Code block with line numbers"
172
-
```py linenums="1"
182
+
````markdown title="Code block with line numbers"
183
+
```py linenums="1"
173
184
def bubble_sort(items):
174
185
for i in range(len(items)):
175
186
for j in range(len(items) - 1 - i):
@@ -180,7 +191,7 @@ def bubble_sort(items):
180
191
181
192
<divclass="result"markdown>
182
193
183
-
```py linenums="1"
194
+
```py linenums="1"
184
195
defbubble_sort(items):
185
196
for i inrange(len(items)):
186
197
for j inrange(len(items) -1- i):
@@ -196,8 +207,8 @@ Specific lines can be highlighted by passing the line numbers to the `hl_lines`
196
207
argument placed right after the language shortcode. Note that line counts start
197
208
at `1`, regardless of the starting line number specified:
198
209
199
-
````markdown title="Code block with highlighted lines"
200
-
```py hl_lines="2 3"
210
+
````markdown title="Code block with highlighted lines"
211
+
```py hl_lines="2 3"
201
212
def bubble_sort(items):
202
213
for i in range(len(items)):
203
214
for j in range(len(items) - 1 - i):
@@ -208,7 +219,7 @@ def bubble_sort(items):
208
219
209
220
<divclass="result"markdown>
210
221
211
-
```py linenums="1" hl_lines="2 3"
222
+
```py linenums="1" hl_lines="2 3"
212
223
defbubble_sort(items):
213
224
for i inrange(len(items)):
214
225
for j inrange(len(items) -1- i):
@@ -224,8 +235,8 @@ Code annotations can be placed anywhere in a code block where a comment for the
224
235
language of the block can be placed, e.g. for JavaScript in `#!js // ...` and
225
236
`#!js /* ... */`, for YAML in `#!yaml # ...`, etc.:
226
237
227
-
````markdown title="Code block with annotation"
228
-
```yaml
238
+
````markdown title="Code block with annotation"
239
+
```yaml
229
240
theme:
230
241
features:
231
242
- content.code.annotate # (1)!
@@ -243,33 +254,160 @@ theme:
243
254
- content.code.annotate # (1)!
244
255
```
245
256
246
-
1. :man_raising_hand: I'm a code annotation! I can contain `code`, __formatted
247
-
text__, images, ... basically anything that can be written in Markdown.
257
+
1. :man_raising_hand: I'm a code annotation! I can contain `code`, **formatted
258
+
text**, images, ... basically anything that can be written in Markdown.
248
259
249
260
</div>
250
261
251
262
### Admonitions
252
263
253
-
[Admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) is a great way to emphasize a piece of information. Check the original documentation for all the customizations available for admonitions.
264
+
[Admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) is a great way to emphasize a piece of information. Here is a list of admonitions you may use most often:
254
265
255
-
``` markdown title="Admonition"
256
-
!!! note
266
+
//// tab | Note
257
267
258
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
259
-
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
260
-
massa, nec semper lorem quam in massa.
268
+
```markdown
269
+
/// note
270
+
271
+
This is a note
272
+
///
261
273
```
262
274
263
275
<div class="result" markdown>
264
276
265
-
!!! note
277
+
/// note
266
278
267
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
268
-
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
269
-
massa, nec semper lorem quam in massa.
279
+
This is a note
280
+
///
281
+
</div>
282
+
////
283
+
//// tab | Warning
284
+
285
+
```markdown
286
+
/// warning
287
+
288
+
This is a warning
289
+
///
290
+
```
291
+
292
+
<div class="result" markdown>
293
+
294
+
/// warning
295
+
296
+
This is a warning
297
+
///
298
+
</div>
299
+
////
300
+
//// tab | Tip
301
+
302
+
```markdown
303
+
/// tip
304
+
305
+
This is a tip
306
+
///
307
+
```
308
+
309
+
<div class="result" markdown>
310
+
311
+
/// tip
312
+
313
+
This is a tip
314
+
///
315
+
</div>
316
+
////
317
+
318
+
#### Admonition's title
319
+
320
+
Often it is desired to name the admonition block to provide some context to the reader. To achieve this, add a title of the admonition to the block type, like this:
321
+
322
+
```markdown
323
+
/// note | This note now has a `title`
324
+
This is a note with a title
325
+
///
326
+
```
327
+
328
+
<divclass="result"markdown>
329
+
330
+
/// note | This note now has a `title`
331
+
This is a note with a title
332
+
///
333
+
</div>
334
+
335
+
#### Collapsible admonitions
336
+
337
+
A perfect way to provide large amounts of auxiliary information is to use a collapsed admonition that will only be displayed when the user clicks on the title.
338
+
To make an admonition collapsed, change the block type to `details` and add the `type` of the admonition you want to use.
339
+
340
+
For example, to make a collapsed Note, use the following code:
341
+
342
+
```markdown
343
+
/// details
344
+
type: note
345
+
346
+
This is a collapsed note
347
+
///
348
+
```
349
+
350
+
<divclass="result"markdown>
351
+
352
+
/// details | This collapsed note opens on click
353
+
type: note
354
+
355
+
This is a collapsed note
356
+
///
357
+
</div>
358
+
359
+
### Images
360
+
361
+
To add an image to your post, use the following shortcode:
The drawio/diagrams.net diagramming tool is a great way to create diagrams. Diagrams are better than images in every way. If you invest in creating diagrams instead of generating images, you will be able to version control, and easily edit them as your project evolves.
392
+
393
+
To embed a diagram, use the following shortcode and add a script element to your page at the bottom:
394
+
395
+
```markdown
396
+
-{{% raw %}}-
397
+
-{{ diagram(url='srl-labs/srlinux-getting-started/main/diagrams/get-started.drawio', title='Default SR Linux prompt', page=0) }}-
-{{ diagram(url='srl-labs/srlinux-getting-started/main/diagrams/get-started.drawio', title='Default SR Linux prompt', page=0) }}-
406
+
</div>
407
+
408
+
- The `page` parameter (0-indexed) selects which page in the drawio file to display.
409
+
- The `zoom` parameter (integer) sets x-times zoom factor. If your diagran renders too small with the default zoom factor, set it to a higher value.
410
+
273
411
### Icons
274
412
275
413
Our doc theme includes a [gazillion of icons](https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/) and emojis which are super easy to use. Use the [search tool](https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/#search) to find the icon code-block and paste it in your post.
@@ -353,3 +491,5 @@ Get notified when a new post is published using one of the [subscription options
0 commit comments