Skip to content

Commit f361cdf

Browse files
committed
build: restrict the markdown languages to use for code blocks
1 parent 26d3c71 commit f361cdf

6 files changed

Lines changed: 39 additions & 10 deletions

File tree

.markdownlint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,32 @@ single-title: # MD025
4141
# Markdown files we must use whatever works in the final HTML generated docs.
4242
# Suppress Markdownlint warning: Link fragments should be valid.
4343
link-fragments: false # MD051
44+
45+
# Restrict the languages and language identifiers to use for code blocks.
46+
# We only want those supported by both Hugo and GitHub. These are documented
47+
# here:
48+
# https://gohugo.io/content-management/syntax-highlighting/#languages
49+
# https://docs.github.com//get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting
50+
# In addition, we only want to allow identifiers (aliases) that correspond to
51+
# the same language in Hugo and GitHub, and preferrably also VSCode and other
52+
# commonly used tools, to avoid confusion. An example of this is that "shell"
53+
# by some are considered an identifier for shell scripts, i.e. an alias for
54+
# "sh", while others consider it an identifier for shell sessions, i.e. an
55+
# alias for "console". Although Hugo and GitHub in this case are consistent and
56+
# have choosen the former, using "sh" instead, and not allowing use of "shell",
57+
# avoids the confusion entirely.
58+
fenced-code-language: # MD040
59+
allowed_languages:
60+
- text
61+
- console
62+
- sh
63+
- bat
64+
- ini
65+
- json
66+
- yaml
67+
- go
68+
- python
69+
- c++
70+
- c#
71+
- java
72+
- powershell

docs/content/docker.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ token = {"access_token":...}
126126
Now create the file named `example.yml` with a swarm stack description
127127
like this:
128128

129-
```yml
129+
```yaml
130130
version: '3'
131131
services:
132132
heimdall:
@@ -295,7 +295,7 @@ Each of them should be named after its volume and have at least two
295295
elements, the self-explanatory `driver: rclone` value and the
296296
`driver_opts:` structure playing the same role as `-o key=val` CLI flags:
297297

298-
```yml
298+
```yaml
299299
volumes:
300300
volume_name_1:
301301
driver: rclone
@@ -463,7 +463,7 @@ to inform the docker daemon that a volume is (un-)available.
463463
As a workaround you can setup a healthcheck to verify that the mount
464464
is responding, for example:
465465

466-
```yml
466+
```yaml
467467
services:
468468
my_service:
469469
image: my_image

docs/content/docs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3210,13 +3210,13 @@ at rest or transfer. Detailed instructions for popular OSes:
32103210

32113211
- Generate and store a password
32123212

3213-
```pwsh
3213+
```powershell
32143214
New-Object -TypeName PSCredential -ArgumentList "rclone", (ConvertTo-SecureString -String ([System.Web.Security.Membership]::GeneratePassword(40, 10)) -AsPlainText -Force) | Export-Clixml -Path "rclone-credential.xml"
32153215
```
32163216

32173217
- Add the password retrieval instruction
32183218

3219-
```pwsh
3219+
```powershell
32203220
[Environment]::SetEnvironmentVariable("RCLONE_PASSWORD_COMMAND", "[System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR((Import-Clixml -Path "rclone-credential.xml").Password))")
32213221
```
32223222

docs/content/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ the port on the host.
260260

261261
A simple solution may be restarting the Host Network Service with eg. Powershell
262262

263-
```pwsh
263+
```powershell
264264
Restart-Service hns
265265
```
266266

docs/content/install.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ Instructions
511511
your local roles-directory
512512
2. add the role to the hosts you want rclone installed to:
513513

514-
```yml
514+
```yaml
515515
- hosts: rclone-hosts
516516
roles:
517517
- rclone
@@ -638,7 +638,7 @@ Example of a PowerShell command that creates a Windows service for mounting
638638
some `remote:/files` as drive letter `X:`, for *all* users (service will be
639639
running as the local system account):
640640

641-
```pwsh
641+
```powershell
642642
New-Service -Name Rclone -BinaryPathName 'c:\rclone\rclone.exe mount remote:/files X: --config c:\rclone\config\rclone.conf --log-file c:\rclone\logs\mount.txt'
643643
```
644644

librclone/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ either.
130130
The interface of librclone is so simple, that all you need is to define the
131131
small struct `RcloneRPCResult`, from [librclone.go](librclone.go):
132132

133-
```C++
133+
```c++
134134
struct RcloneRPCResult {
135135
char* Output;
136136
int Status;
@@ -161,7 +161,7 @@ own escaping. This is not a Windows-specific issue, but there is the
161161
additional challenge that native filesystem path separator is the same as
162162
the escape character, and you may end up with strings like this:
163163
164-
```C++
164+
```c++
165165
const char* input = "{"
166166
"\"fs\": \"C:\\\\Temp\","
167167
"\"remote\": \"sub/folder\","

0 commit comments

Comments
 (0)