Skip to content

Commit 3f226de

Browse files
authored
Merge pull request #61 from botlabs-gg/mdl
workflows: add and configure a Markdown linter all: lint markdown files
2 parents 28b6362 + cda9101 commit 3f226de

26 files changed

+313
-210
lines changed

.github/CONTRIBUTING.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ General support queries and possible bugs in YAGPDB are **not** in scope and wil
1010

1111
[support server]: https://discord.gg/4udtcA5
1212

13-
1413
## Submission Guide
1514

1615
Thanks for contributing to the YAGPDB documentation! Please take a moment to review this document in order to make the
@@ -45,7 +44,7 @@ this process below.
4544
In your local clone, install the required dependencies via NPM by running the following command:
4645

4746
```shellsession
48-
$ npm install
47+
npm install
4948
```
5049

5150
This will ensure that you can fully build the documentation site locally, including the custom syntax highlighting we
@@ -117,15 +116,15 @@ In order to preview your changes locally, you will need to run a local instance
117116
you have Node.js (and NPM) and Hugo installed, you can do so by running the following command:
118117

119118
```shellsession
120-
$ npm run dev
119+
npm run dev
121120
```
122121

123122
This will run a local server on `http://localhost:1313` that will automatically update whenever you save a file, though
124123
without our custom syntax highlighting. If you prefer to view the site as it would appear on production, run the
125124
following commands instead:
126125

127126
```shellsession
128-
$ npm run build && npm run preview
127+
npm run build && npm run preview
129128
```
130129

131130
This will build the site, execute the highlighting post-processor, and run a local server on `http://localhost:4173`.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<!-- Please describe the changes this pull request does and why it should be merged -->
22

33
**Terms**
4+
45
- [ ] I have read and understood this project's [Contributing Guidelines](CONTRIBUTING.md)

.github/workflows/lint.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'content/**/*.md'
7+
8+
jobs:
9+
lint-markdown:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
- name: Lint markdown files
15+
uses: actionshub/markdownlint@main
16+
with:
17+
filesToIgnoreRegex: 'all-commands.md|scripts/.*|.github/.*'

.mdlrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
git_recurse true
2+
ignore_front_matter true
3+
style 'config/markdownlint.rb'

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ Pages are written in Markdown with additional shortcodes provided by the Doks th
2626
documentation](<(https://getdoks.org/docs/start-here/getting-started/)>) for a complete list of features.
2727

2828
If you are editing pages related to custom commands, note that codeblocks support a custom `yag` language for accurate
29-
syntax highlighting—do not use `go`. However, this feature is only enabled in production builds for performance, so `npm run dev` will _not_ highlight `yag` codeblocks. Use `npm run build` followed by `npm run preview` instead if you need to verify
30-
that code is highlighted correctly.
29+
syntax highlighting—do not use `go`. However, this feature is only enabled in production builds for performance, so
30+
`npm run dev` will _not_ highlight `yag` codeblocks. Use `npm run build` followed by `npm run preview` instead if you
31+
need to verify that code is highlighted correctly.
3132

3233
> [!TIP]
3334
> If you use VSCode, this project provides custom workspace snippets to insert callouts, which you can activate in

config/markdownlint.rb

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Enable all rules; we'll configure some of them below.
2+
all
3+
4+
# MD001: Header levels should only increment by one level at a time.
5+
# Normally, this is a fair rule, but it does not quite work for our cases,
6+
# especially in our humongous functions list. So disable it.
7+
exclude_rule 'MD001'
8+
9+
# MD002: First header should be a top level header.
10+
# Some files do not have a top-level header, because it doesn't make sense for
11+
# them, or just looks incredibly stupid on the rendered page. So disable this
12+
# entire rule.
13+
exclude_rule 'MD002'
14+
15+
# MD004: Unordered list style.
16+
# Use dashes for unordered lists. All lists. Even sublists.
17+
rule 'MD004', :style => :dash
18+
19+
# MD013: Line length.
20+
# Allow lines to be up to 120 characters long, see the .editorconfig file.
21+
# We also ignore code blocks, because they are often long and should not be
22+
# wrapped at all. Same goes for tables.
23+
rule 'MD013', :line_length => 120, :ignore_code_blocks => true, :tables => false
24+
25+
# MD024: Multiple headers with the same content.
26+
# Allow multiple headers with the same content so long they are under different
27+
# parent headers.
28+
rule 'MD024', :allow_different_nesting => true
29+
30+
# MD026: Trailling punctuation in header.
31+
# Allow question marks (FAQ-style).
32+
rule 'MD026', :punctuation => '.,;:!'
33+
34+
# MD029: Ordered list item prefix.
35+
# Should increase in numerical order.
36+
rule 'MD029', :style => :ordered
37+
38+
# MD033: Inline HTML.
39+
# Allow certain HTML elements, because we use them for nicer page layout.
40+
rule 'MD033', :allowed_elements => 'center, div, sup, br, kbd'
41+
42+
# MD037: Spaces inside emphasis markers.
43+
# This rule is broken. See https://github.com/markdownlint/markdownlint/issues/84
44+
exclude_rule 'MD037'
45+
46+
# MD041: First line in file should be a top-level header.
47+
# See comment to MD002. It makes no sense to set this to H2 for similar reasons,
48+
# we have TOML frontmatter with an automatic h1 in the rendered page.
49+
exclude_rule 'MD041'

content/discord.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
+++
2-
type = "redirect"
3-
target = "https://discord.gg/4udtcA5"
4-
title = "Discord"
5-
+++
1+
---
2+
type: redirect
3+
target: 'https://discord.gg/4udtcA5'
4+
title: 'Discord'
5+
---
66

7-
<!-- this file intentionally left blank -->
7+
<!--
8+
This file intentionally left blank.
9+
We use YAML front matter here instead of the usual TOML just so markdownlint can properly lint for blank URLs in other
10+
files without firing on this one.
11+
-->

content/docs/core/command-settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Flags and switches are **_not_** affected by your prefix setting.
3939

4040
For example, if your prefix is `?`, a command usage with flags and/or switches is as follows:
4141

42-
```
42+
```txt
4343
?wouldyourather -raw
4444
```
4545

content/docs/custom-commands/commands.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,13 @@ You must specify a channel to run time-based commands in even if the command doe
283283

284284
A cron expression represents a set of times, using 5 space-separated fields.
285285

286-
Field name | Mandatory? | Allowed values | Allowed special characters
287-
-------------- | ---------- | -------------- | --------------------------
288-
Minutes | Yes | 0-59 | * / , -
289-
Hours | Yes | 0-23 | * / , -
290-
Day of month | Yes | 1-31 | * / , - ?
291-
Month | Yes | 1-12 or JAN-DEC | * / , -
292-
Day of week (DOW)| Yes | 0-6 or SUN-SAT | * / , - ?
286+
| Field name | Mandatory? | Allowed values | Allowed special characters |
287+
| -------------- | ---------- | -------------- | -------------------------- |
288+
| Minutes | Yes | 0-59 | * / , - |
289+
| Hours | Yes | 0-23 | * / , - |
290+
| Day of month | Yes | 1-31 | * / , - ? |
291+
| Month | Yes | 1-12 or JAN-DEC | * / , - |
292+
| Day of week (DOW)| Yes | 0-6 or SUN-SAT | * / , - ? |
293293

294294
To read more about the supported format of cron expressions, visit [Robfig's Cron package documentation - Expression
295295
Format](https://pkg.go.dev/github.com/robfig/cron/v3#hdr-CRON_Expression_Format).
@@ -302,7 +302,7 @@ on Corntab Guru, but are not supported with YAGPDB.
302302

303303
{{< /callout >}}
304304

305-
**Special Characters**
305+
###### Special Characters
306306

307307
- Asterisk ( * )
308308

content/docs/fun/soundboard.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Do **not** fill in the URL if you are going uploaded from local files, and vice
3232

3333
{{< /callout >}}
3434

35-
3635
You have two options to upload sounds:
3736

3837
- Upload with local files

0 commit comments

Comments
 (0)