The chapter exercise documentation (in the chapters/ directory) is written in markdown, and is shown in the "challenge doc" pane (the upper-right pane) in the sys playground.
sys supports GitHub Flavored Markdown (GFM), which supports syntax highlighting for source code.
The current challenge docs do not have syntax highlighting because the code blocks do not have any language identifier. For example, this file has the following fenced code block:
1. Spot the mistake(s) in the following code:
```
for(len = 0; len <5 ; len++) {
write(STDOUT_FNO,"I think", 6);
write(STDOUT_FILENUM,"\n", 6);
}
```
which is rendered as
- Spot the mistake(s) in the following code:
for(len = 0; len <5 ; len++) {
write(STDOUT_FNO,"I think", 6);
write(STDOUT_FILENUM,"\n", 6);
}
This can be syntax-highlighted by using the "c" language identifier:
> 1. Spot the mistake(s) in the following code:
```c
for(len = 0; len <5 ; len++) {
write(STDOUT_FNO,"I think", 6);
write(STDOUT_FILENUM,"\n", 6);
}
```
which will render as
- Spot the mistake(s) in the following code:
for(len = 0; len <5 ; len++) {
write(STDOUT_FNO,"I think", 6);
write(STDOUT_FILENUM,"\n", 6);
}
which is a much better appearance.
The task is to go through current chapters and modify them to use syntax highlighting, and write a document directing future documentation to be written this way.
The chapter exercise documentation (in the
chapters/directory) is written in markdown, and is shown in the "challenge doc" pane (the upper-right pane) in the sys playground.sys supports GitHub Flavored Markdown (GFM), which supports syntax highlighting for source code.
The current challenge docs do not have syntax highlighting because the code blocks do not have any language identifier. For example, this file has the following fenced code block:
which is rendered as
This can be syntax-highlighted by using the "c" language identifier:
which will render as
which is a much better appearance.
The task is to go through current chapters and modify them to use syntax highlighting, and write a document directing future documentation to be written this way.