Skip to content

Commit

Permalink
Add documentation style guide and tool configs (#5320)
Browse files Browse the repository at this point in the history
* Add eslint, markdownlint, and prettier configs

* Update node engine version

* Fix generated CLI docs path

* Add style guide and update README

* Bump tools and add Dependabot group for eslint

* Add license header
  • Loading branch information
danbarr authored Jan 18, 2025
1 parent 19c31fe commit 45e84c4
Show file tree
Hide file tree
Showing 13 changed files with 3,569 additions and 214 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# linguist-generated causes generated files to not be expanded during code review.

/database/mock/*.go linguist-generated=true
/docs/docs/cli/*.md linguist-generated=true
/docs/docs/ref/cli/*.md linguist-generated=true
/docs/docs/ref/schema.md linguist-generated=true
/docs/docs/ref/proto.md linguist-generated=true
/pkg/api/openapi/** linguist-generated=true
Expand Down
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ updates:
docusaurus:
patterns:
- "*docusaurus*"
eslint:
patterns:
- "*eslint*"
ignore:
# facebook/docusaurus#4029 suggests MDX v2 will only be in the v3 release.
# facebook/docusaurus#9053 has some more details on the migration.
Expand Down
11 changes: 11 additions & 0 deletions docs/.markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"gitignore": true,
"globs": ["**/*.md"],
"ignores": [
"node_modules/",
".docusaurus",
"build/",
"docs/ref/cli/",
"docs/ref/proto.md",
],
}
37 changes: 37 additions & 0 deletions docs/.markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"code-block-style": {
"style": "fenced"
},
"code-fence-style": {
"style": "backtick"
},
"emphasis-style": {
"style": "underscore"
},
"heading-style": {
"style": "atx"
},
"hr-style": {
"style": "---"
},
"line-length": {
"code_blocks": false,
"line_length": 80,
"tables": false
},
"no-bare-urls": false,
"no-duplicate-heading": false,
"proper-names": {
"code_blocks": false,
"names": ["GitHub", "GitLab", "Bitbucket"]
},
"strong-style": {
"style": "asterisk"
},
"table-pipe-style": {
"style": "leading_and_trailing"
},
"ul-style": {
"style": "dash"
}
}
7 changes: 7 additions & 0 deletions docs/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
.docusaurus/
build/

# Auto-generated files
docs/ref/cli/*.md
docs/ref/proto.md
9 changes: 9 additions & 0 deletions docs/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"jsxSingleQuote": true,
"printWidth": 80,
"proseWrap": "always",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}
59 changes: 50 additions & 9 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,66 @@
# Docs for Minder
# Minder documentation

This directory contains the user documentation for Minder, hosted at
<https://mindersec.github.io>.

The docs are built with [Docusaurus](<[https://](https://docusaurus.io/)>), an
open source static website generator optimized for documentation use cases.

## Contributing to docs

We welcome community contributions to the Minder documentation - if you find
something missing, wrong, or unclear, please let us know via an issue or open a
PR!

Please review the [style guide](./STYLE-GUIDE.md) for help with voice, tone, and
formatting.

## Building the docs locally

Start from the top level directory of the repository.
Start from the top level directory of the `minder` repository and generate the
CLI docs:

Generate the CLI docs
```
```bash
make cli-docs
```

Build the docs
```
cd docs
```
Run a preview server:

```bash
npm run start
```

Your browser should automatically open to <http://localhost:3000>

Build the docs:

```bash
cd docs
npm run build
```

Serve the docs
```

```bash
npm run serve -- --port 3001
```

Visit http://localhost:3001/ to view the docs.

## Formatting

Before you submit a PR, please check for formatting and linting issues:

```bash
npm run prettier
npm run markdownlint
npm run eslint
```

To automatically fix issues:

```bash
npm run prettier:fix
npm run markdownlint:fix
npm run eslint:fix
```
Loading

0 comments on commit 45e84c4

Please sign in to comment.