Skip to content

Commit 32c3ccb

Browse files
Merge pull request #5350 from himeshsiriwardana/vale-spellcheck
added markdownlint to the workflow and integrated a spell checker for Vale
2 parents 5d20ebf + bc5f3d1 commit 32c3ccb

File tree

11 files changed

+1393
-19
lines changed

11 files changed

+1393
-19
lines changed

.github/workflows/markdownlint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Markdown Lint
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**/*.md'
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
- uses: tj-actions/changed-files@v46
16+
id: changed-files
17+
with:
18+
files: '**/*.md'
19+
separator: ","
20+
- uses: DavidAnson/markdownlint-cli2-action@v20
21+
if: steps.changed-files.outputs.any_changed == 'true'
22+
with:
23+
globs: ${{ steps.changed-files.outputs.all_changed_files }}
24+
separator: ","

.markdownlint-cli2.jsonc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
{
3+
"config": {
4+
"MD010": false,
5+
"MD013": false,
6+
"MD033": false,
7+
"MD034": false,
8+
"MD041": false,
9+
"MD046": false,
10+
"MD055": false
11+
},
12+
13+
"customRules": [
14+
"./lint-config/no-consecutive-headings.js" // no consecutive headings
15+
]
16+
}

.vale.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
StylesPath = .vale/styles
22
MinAlertLevel = suggestion
3+
enableSpellCheck = true
4+
5+
[spelling]
6+
dictionary = en-US
7+
accept = .vale/styles/Vale/accept.txt
38

49
[*.md]
510
BasedOnStyles = Microsoft, write-good, WSO2-IAM
11+
spelling = yes
612

713
[**/restapis/**/*.yml]
814
BasedOnStyles = Microsoft, write-good, WSO2-IAM
15+
Spelling = no

.vale/styles/WSO2-IAM/ISTerms.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
extends: existence
22
message: "'%s' is not allowed. Use 'WSO2 Identity Server' instead."
3-
link: https://example.com/style-guide#wso2-identity-server
43
level: error
54
ignorecase: false
65
tokens:

.vale/styles/WSO2-IAM/Spelling.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extends: spelling
2+
message: "Did you really mean '%s'?"
3+
level: warning
4+
ignore:
5+
- words.txt
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Asgardeo
2+
WSO2
3+
OIDC
4+
OAuth2
5+
IdP
6+
SAML
7+
product_name
8+
keystore
9+
truststore
10+
truststores
11+
is_version
12+
endif
13+
browserpwd
14+
Kibana
15+
VSCode
16+
Markdownlint
17+
markdownlint
18+
dev

README.md

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# WSO2 Identity Server and Asgardeo Documentation
22

3+
34
This is the WSO2 Identity Server and Asgardeo documentation repository. This repository is open source and we welcome your contributions!
45

56
- WSO2 Identity Server Docs: [https://is.docs.wso2.com/](https://is.docs.wso2.com/)
@@ -9,7 +10,7 @@ This is the WSO2 Identity Server and Asgardeo documentation repository. This rep
910

1011
* [Run the project locally](#run-the-project-locally)
1112
+ [With Python Virtual Environments](#with-python-virtual-environments)
12-
+ [With Devcontainers](#with-devcontainers)
13+
+ [With Dev containers](#with-dev-containers)
1314
* [Install linters](#install-linters)
1415
* [Contribute to documentation](#contribute-to-documentation)
1516
* [Survey On Open Source Community Communication](#survey-on-open-source-community-communication)
@@ -29,28 +30,28 @@ Choose one of the following methods depending on your preference.
2930

3031
You can run the Asgardeo docs and WSO2 Identity Server docs locally using Python virtual environments as well.
3132

32-
> #### Prerequisites
33-
>
33+
#### Prerequisites
34+
>
3435
> To run the project locally, it requires [python](https://www.python.org/downloads/) & [pip](https://pypi.org/project/pip/).
35-
>
36+
>
3637
> - Install Python
37-
>
38+
>
3839
> Check if you already have Python installed by running the following command.
39-
>
40+
>
4041
> ```bash
4142
> $ python3 --version
4243
> Python 3.8.0
4344
> ```
44-
>
45-
> If you receive a response similar to the one shown above, `Python 3.8.0` is your default Python version.
46-
>
45+
>
46+
> If you receive a response similar to the one shown above, `Python 3.8.0` is your default Python version.
47+
>
4748
> If you don't seem to have `Python` installed, grab the latest release from the [official downloads page](https://www.python.org/downloads/).
48-
>
49+
>
4950
> - Install pip
50-
>
51+
>
5152
> `pip` is already installed if you are using Python 3 (>=3.4) downloaded from [python.org][python-org] or if you are working in a [Virtual Environment][virtual-env-guide] created by
5253
> [virtualenv][virtualenv] or [pyvenv][pyenv]. Just make sure to [upgrade pip][pip-upgrade-guide].
53-
>
54+
>
5455
> [python-org]: https://www.python.org
5556
> [virtual-env-guide]: https://packaging.python.org/tutorials/installing-packages/#creating-and-using-virtual-environments
5657
> [virtualenv]: https://packaging.python.org/key_projects/#virtualenv
@@ -70,13 +71,13 @@ You can run the Asgardeo docs and WSO2 Identity Server docs locally using Python
7071
```bash
7172
cd en/identity-server/{version}
7273
```
73-
74+
7475
3. Initialize a Python virtual environment.
7576
7677
```bash
7778
python3 -m venv .venv
7879
```
79-
80+
8081
4. Activate the created virtual environment.
8182
8283
```bash
@@ -110,9 +111,9 @@ mkdocs serve
110111
> python3 -m mkdocs serve
111112
> ```
112113
113-
### With Devcontainers
114+
### With dev containers
114115
115-
This repository supports the VS Code dev containers feature, which allows you to create a consistent and isolated development environment inside a Docker container. To use this feature, you need to have the following pre requisites:
116+
This repository supports the VS Code dev containers feature, which allows you to create a consistent and isolated development environment inside a Docker container. To use this feature, you need to have the following prerequisites:
116117
117118
- VS Code
118119
- Docker installed on your system
@@ -130,9 +131,29 @@ For more information on how to use VS Code dev containers, please refer to the o
130131
131132
To uphold documentation quality, the CI pipeline includes linters to check for writing quality and style. Before creating a pull request (PR), make sure to install the required IDE extensions and test your changes locally to pass these checks.
132133
134+
## Markdownlint
135+
136+
[markdownlint](https://github.com/DavidAnson/markdownlint) checks markdown files for style and syntax issues, helping maintain consistent, clean and readable documentation.
137+
138+
To install markdownlint on Visual Studio Code (VSCode),
139+
140+
1. Install the **markdownlint** extension.
141+
142+
2. In the extension's settings page, provide the absolute path of the `.markdownlint.jsonc` configuration file as the `Config File`.
143+
144+
The configuration file and rule sets live in the following locations of the repository:
145+
146+
.
147+
├── .markdownlint-cli2.jsonc # Configuration file for markdownlint-cli2
148+
└── lint-config/ # Custom lints
149+
└── custom lint `.js` files
150+
151+
3. Reload the extension to load the rules.
152+
4. Fix all markdownlint errors underlined in yellow.
153+
133154
### Vale
134155
135-
[Vale](https://github.com/errata-ai/vale) offers a fast, open-source solution for linting prose, ensuring consistency, clarity, and quality in documentation. It checks text against style rules, like a code linter analyzes source code.
156+
[Vale](https://github.com/errata-ai/vale) offers a fast, open-source solution for linting prose, ensuring consistency, clarity, and quality in documentation.
136157
137158
The current setup uses well-established industry rule sets such as [Microsoft](https://github.com/errata-ai/Microsoft) and [write-good](https://github.com/errata-ai/write-good), which provide guidelines for grammar, tone, and readability. We're working on adding custom rules to align with evolving style and voice requirements.
138159
@@ -151,6 +172,7 @@ To install Vale in Visual Studio Code (VSCode),
151172
└── styles/ #Contains style guides
152173
├── Microsoft/
153174
└── write-good/
175+
154176
```
155177
156178
3. Enable the extension for syntax highlighting.

en/identity-server/next/docs/deploy/elk-analytics-sso-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@ Follow the steps below to try out single sign-on to the Kibana dashboard using W
124124

125125
8. You will be redirected to the WSO2 Identity Server login page. Try logging in with the credentials of the user that you created.
126126

127-
![]( {{base_path}}/assets/img/elk-analytics/elk-analytics-sso/elk-sso-9.png){: width="400" style="display: block; margin: 0;"}
127+
![]( {{base_path}}/assets/img/elk-analytics/elk-analytics-sso/elk-sso-9.png){: width="400" style="display: block; margin: 0;"}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/** @type {import("markdownlint").Rule} */
2+
module.exports = {
3+
names: ["no-consecutive-headings"],
4+
description: "Disallow consecutive headings",
5+
tags: ["headings"],
6+
function: function noConsecutiveHeadings(params, onError) {
7+
const tokens = params.tokens;
8+
9+
let lastTokenWasHeading = false;
10+
11+
tokens.forEach((token) => {
12+
if (token.type === "heading_open") {
13+
if (lastTokenWasHeading) {
14+
onError({
15+
lineNumber: token.lineNumber,
16+
detail: "Consecutive headings are not allowed.",
17+
context: params.lines[token.lineNumber - 1],
18+
});
19+
}
20+
lastTokenWasHeading = true;
21+
} else if (token.type !== "heading_close" && token.type !== "inline" && token.type !== "text") {
22+
// Reset flag if any non-heading block token found
23+
lastTokenWasHeading = false;
24+
}
25+
});
26+
},
27+
};

0 commit comments

Comments
 (0)