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
Update code blocks and add guidelines on usage to style guide (#74)
I've attempted to fix up some code blocks. Whatever was obviously a terminal (ehm, console) session I've updated to use `console`. Turns out `terminal` isn't a valid lexer, and just does no highlighting. I've changed some types to `bash` or `console` a bit depending on the contents of the code block, but I have not tried to fix everything.
I've added a section about code blocks to the style guide, which we can try to follow when updating existing or adding new docs.
>git commit -m 'update the ssh docs with aliases for all user lab vclusters'
23
-
>git push origin 'fix/ssh-alias'
21
+
git add <files>
22
+
git commit -m 'update the ssh docs with aliases for all user lab vclusters'
23
+
git push origin 'fix/ssh-alias'
24
24
```
25
25
Then navigate to GitHub, and create a pull request.
26
26
27
27
The `serve` script in the root path of the repository can be used to view the docs locally:`
28
-
```
29
-
> ./serve
28
+
```bash
29
+
./serve
30
30
...
31
31
INFO - [08:33:34] Serving on http://127.0.0.1:8000/
32
32
```
@@ -228,3 +228,56 @@ They stand out better from the main text, and can be collapsed by default if nee
228
228
This note is collapsed, because it uses `???`.
229
229
230
230
If an admonition is collapsed by default, it should have a title.
231
+
232
+
### Code blocks
233
+
234
+
Use [code blocks](https://squidfunk.github.io/mkdocs-material/reference/code-blocks/) when you want to display monospace text in a programming language, terminal output, configuration files etc.
235
+
The documentation uses [pygments](https://pygments.org) for highlighting.
236
+
See [list of available lexers](https://pygments.org/docs/lexers/#) for the languages that you can use for code blocks.
237
+
238
+
Use [`console`](https://pygments.org/docs/lexers/#pygments.lexers.shell.BashSessionLexer) for interactive sessions with prompt-output pairs:
239
+
240
+
=== "Markdown"
241
+
242
+
````markdown
243
+
```console title="Hello, world!"
244
+
$ echo "Hello, world!"
245
+
Hello, world!
246
+
```
247
+
````
248
+
249
+
=== "Rendered"
250
+
251
+
```console title="Hello, world!"
252
+
$ echo "Hello, world!"
253
+
Hello, world!
254
+
```
255
+
256
+
!!! warning
257
+
`terminal` is not a valid lexer, but MkDocs or pygments will not warn about using it as a language.
258
+
The text will be rendered without highlighting.
259
+
260
+
!!! warning
261
+
Use `$` as the prompt character, optionally preceded by text.
262
+
`>` as the prompt character will not be highlighted correctly.
263
+
264
+
Note the use of `title=...`, which will give the code block a heading.
265
+
266
+
!!! tip
267
+
Include a title whenever possible to describe what the code block does or is.
268
+
269
+
If you want to display commands without output that can easily be copied, use `bash` as the language:
Copy file name to clipboardExpand all lines: docs/guides/gb2025.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,12 +42,12 @@ This confines system processes and operations to the first core of each of the f
42
42
43
43
The consequence of this setting is that only 71 cores per socket can be requested by an application (for a total of 284 cores instead of 288 cores per node).
44
44
45
-
!!! warning "Unable to allocate resources: Requested node configuration is not availabl"
45
+
!!! warning "Unable to allocate resources: Requested node configuration is not available"
46
46
If you try to use all 72 cores on each socket, SLURM will give a hard error, because only 71 are available:
The `linaro-forge` uenv is always mounted at the `/user-tools` mount point, and a script `/user-tools/activate` is provided to load both ddt and map into your environment, without needing to use a view.
52
52
53
-
```bash
54
-
> uenv start linaro-forge/14.1.1
55
-
> source /user-tools/activate
56
-
> ddt --version
53
+
```console
54
+
$ uenv start linaro-forge/14.1.1
55
+
$ source /user-tools/activate
56
+
$ ddt --version
57
57
Linaro DDT Part of Linaro Forge.
58
58
Copyright (c) 2023-2024 Linaro Limited. All rights reserved.
0 commit comments