Skip to content

Commit

Permalink
Add docs checks
Browse files Browse the repository at this point in the history
  • Loading branch information
evroon committed Nov 27, 2023
1 parent e19b616 commit ee7e0b0
Show file tree
Hide file tree
Showing 14 changed files with 3,114 additions and 199 deletions.
67 changes: 67 additions & 0 deletions docs/.markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"config": {
"default": true,
"header-increment": false,
"first-header-h1": false,
"header-style": false,
"ul-style": false,
"list-indent": false,
"ul-start-left": false,
"ul-indent": false,
"no-trailing-spaces": true, // Nice to have, easy to fix automatically
"no-hard-tabs": false,
"no-reversed-links": true,
"no-multiple-blanks": false,
"line-length": false, // Nice to have, lot of work
"commands-show-output": false,
"no-missing-space-atx": true,
"no-multiple-space-atx": true,
"no-missing-space-closed-atx": true,
"no-multiple-space-closed-atx": true,
"blanks-around-headers": false,
"header-start-left": false,
"no-duplicate-header": false,
"single-h1": false,
"no-trailing-punctuation": false,
"no-multiple-space-blockquote": true,
"no-blanks-blockquote": true,
"ol-prefix": false,
"list-marker-space": false,
"blanks-around-fences": false,
"blanks-around-lists": false,
"no-inline-html": false,
"no-bare-urls": false,
"hr-style": true,
"no-emphasis-as-header": false,
"no-space-in-emphasis": true,
"no-space-in-code": false,
"no-space-in-links": false,
"fenced-code-language": false,
"first-line-h1": false,
"no-empty-links": false,
"required-headers": true,
"proper-names": true,
"no-alt-text": false,
"code-block-style": true,
"single-trailing-newline": true,
"code-fence-style": true,
"emphasis-style": false,
"strong-style": false,
"link-fragments": true,
"reference-links-images": false,
"link-image-reference-definitions": true,

// part of the markdownlint-rule-relative-links plugin
"relative-links": true
},
"globs": [
"**/*.{md,mdx}"
],
"ignores": [
"node_modules",
"static"
],
"customRules": [
"markdownlint-rule-relative-links"
]
}
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation
## Installation

```
$ yarn
```

### Local Development
## Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build
## Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment
## Deployment

Using SSH:

Expand Down
2 changes: 1 addition & 1 deletion docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
};
1 change: 1 addition & 0 deletions docs/docs/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Copy `ci.env` to `prod.env` and fill in the values:
- `ALLOW_INSECURE_HTTP_SSO`: Should not be used in production. Allows use of INSECURE requests for SSO auth.

## Example configuration file

This is an example of how the config file should look like:
```bash
PG_DSN='postgresql://bracket_ci:bracket_ci@localhost:5532/bracket_ci'
Expand Down
8 changes: 7 additions & 1 deletion docs/docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ sidebar_position: 1
---

# Installation

This guide explains how to run Bracket without Docker. If you quickly want to get up and running, please read [quickstart.md](quickstart.md).

## Database

First create a `bracket` cluster:
```bash
sudo pg_createcluster -u postgres -p 5532 13 bracket
Expand All @@ -22,18 +24,22 @@ You can do the same but replace the user and database name with:
- `bracket_ci`: for running tests
- `bracket_prod`: for a production database

The database URL can be specified per environment in the `.env` files (see [config](#config)).
The database URL can be specified per environment in the `.env` files (see [config](configuration.md)).

## Running the frontend and backend

The following starts the frontend and backend for local development:

### Frontend

```bash
cd frontend
yarn
npm run dev
```

### Backend

```bash
cd backend
pipenv install -d
Expand Down
3 changes: 2 additions & 1 deletion docs/docs/getting-started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ sidebar_position: 2
---

# Quickstart

To quickly run bracket to see how it works, clone it and run `docker-compose up`:
```bash
git clone git@github.com:evroon/bracket.git
Expand All @@ -17,4 +18,4 @@ and password `aeGhoe1ahng2Aezai0Dei6Aih6dieHoo`.
To insert dummy rows into the database, run:
```shell
sudo docker exec bracket-backend pipenv run ./cli.py create-dev-db
```
```
86 changes: 43 additions & 43 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,122 +1,122 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const {themes} = require('prism-react-renderer');
const { themes } = require("prism-react-renderer");
const lightCodeTheme = themes.github;
const darkCodeTheme = themes.dracula;

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Bracket',
tagline: 'Free and open source tournament scheduling system',
favicon: 'img/logo.svg',
title: "Bracket",
tagline: "Free and open source tournament scheduling system",
favicon: "img/logo.svg",

// Set the production url of your site here
url: 'https://your-docusaurus-test-site.com',
url: "https://your-docusaurus-test-site.com",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/bracket/',
baseUrl: "/bracket/",

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'evroon', // Usually your GitHub org/user name.
projectName: 'bracket', // Usually your repo name.
organizationName: "evroon", // Usually your GitHub org/user name.
projectName: "bracket", // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
defaultLocale: "en",
locales: ["en"],
},

presets: [
[
'classic',
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
},
blog: {
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
customCss: require.resolve("./src/css/custom.css"),
},
}),
],
],

plugins: [require.resolve('docusaurus-lunr-search')],
plugins: [require.resolve("docusaurus-lunr-search")],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: 'img/logo.svg',
image: "img/logo.svg",
navbar: {
title: 'Bracket',
title: "Bracket",
logo: {
alt: 'Bracket Logo',
src: 'img/logo.svg',
alt: "Bracket Logo",
src: "img/logo.svg",
},
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Docs',
type: "docSidebar",
sidebarId: "tutorialSidebar",
position: "left",
label: "Docs",
},
{
href: 'https://github.com/evroon/bracket',
label: 'GitHub',
position: 'right',
href: "https://github.com/evroon/bracket",
label: "GitHub",
position: "right",
},
],
},
colorMode: {
defaultMode: 'dark',
defaultMode: "dark",
respectPrefersColorScheme: false,
disableSwitch: true
disableSwitch: true,
},
footer: {
style: 'dark',
style: "dark",
links: [
{
title: 'Docs',
title: "Docs",
items: [
{
label: 'Introduction',
to: '/docs/intro',
label: "Introduction",
to: "/docs/intro",
},
{
label: 'Configuration',
to: '/docs/getting-started/configuration',
label: "Configuration",
to: "/docs/getting-started/configuration",
},
],
},
{
title: 'More',
title: "More",
items: [
{
label: 'GitHub',
href: 'https://github.com/evroon/bracket',
label: "GitHub",
href: "https://github.com/evroon/bracket",
},
{
label: 'Changelog',
href: 'https://github.com/evroon/bracket/releases',
label: "Changelog",
href: "https://github.com/evroon/bracket/releases",
},
],
},
Expand All @@ -126,7 +126,7 @@ const config = {
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ['bash', 'diff', 'json'],
additionalLanguages: ["bash", "diff", "json"],
},
}),
};
Expand Down
31 changes: 29 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
"write-heading-ids": "docusaurus write-heading-ids",
"prettier:check": "prettier --check \"**/*.{js,jsx,ts,tsx}\"",
"prettier:write": "prettier --write \"**/*.{js,jsx,ts,tsx}\"",
"test": "tsc --noEmit && npm run prettier:write && npm run lint && npm run jest -- --passWithNoTests"
},
"dependencies": {
"@docusaurus/core": "^3.0.0",
Expand All @@ -34,9 +37,33 @@
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.0.0",
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@types/jest": "^29.5.4",
"@types/node": "^20.6.0",
"@types/react": "^18.2.21",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"babel-loader": "^9.1.3",
"eslint": "^8.49.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-mantine": "^2.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-testing-library": "^6.0.1",
"jest": "^29.6.4",
"jest-environment-jsdom": "^29.6.4",
"markdownlint-cli2": "^0.11.0",
"markdownlint-rule-relative-links": "^2.1.1",
"postcss": "^8.4.31",
"postcss-preset-mantine": "^1.11.0",
"postcss-simple-vars": "^7.0.1"
"postcss-simple-vars": "^7.0.1",
"prettier": "^3.0.3",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
tutorialSidebar: [{ type: "autogenerated", dirName: "." }],

// But you can create a sidebar manually
/*
Expand Down
Loading

0 comments on commit ee7e0b0

Please sign in to comment.