-
-
Notifications
You must be signed in to change notification settings - Fork 30
docs: create vitepress site #848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
0221d7a
docs: create vitepress site
Lehoczky 32071cb
docs: fix changelog url
Lehoczky 30d1738
docs: fix editLink
Lehoczky c178c79
docs: shorten title
Lehoczky ee75d85
chore(deps-dev): bump @typescript-eslint/parser from 5.59.9 to 5.59.11
dependabot[bot] 0362911
chore(deps-dev): bump @types/node from 20.2.5 to 20.3.0
dependabot[bot] f11f720
chore(deps): bump aria-query from 5.1.3 to 5.2.0
dependabot[bot] b1e2891
chore(deps): bump vue-eslint-parser from 9.3.0 to 9.3.1
dependabot[bot] f28edfd
chore(deps-dev): bump np from 8.0.2 to 8.0.4
dependabot[bot] a47054a
chore(deps): bump aria-query from 5.2.0 to 5.2.1
dependabot[bot] 530c6dd
chore(deps-dev): bump @types/node from 20.3.0 to 20.3.1
dependabot[bot] 98d4f9f
chore(deps-dev): bump eslint from 8.42.0 to 8.43.0
dependabot[bot] 3b5e47a
chore(deps-dev): bump @types/node from 20.3.1 to 20.3.2
dependabot[bot] 3f9fc30
chore(deps): bump aria-query from 5.2.1 to 5.3.0
dependabot[bot] b308fcd
chore(deps-dev): bump typescript from 5.1.3 to 5.1.5
dependabot[bot] 8268c57
chore(deps-dev): bump typescript from 5.1.5 to 5.1.6
dependabot[bot] 513144e
chore(deps-dev): bump @types/node from 20.3.2 to 20.3.3
dependabot[bot] 46720aa
chore(deps-dev): bump jest from 29.5.0 to 29.6.0
dependabot[bot] fe4e7cd
chore(deps-dev): bump ts-jest from 29.1.0 to 29.1.1
dependabot[bot] 042c208
chore(deps-dev): bump prettier from 2.8.8 to 3.0.0
dependabot[bot] da8a0f7
chore(deps-dev): bump @types/node from 20.3.3 to 20.4.0
dependabot[bot] e9a0c9f
chore(deps-dev): bump jest from 29.6.0 to 29.6.1
dependabot[bot] bd80809
chore(deps-dev): bump @types/node from 20.4.0 to 20.4.1
dependabot[bot] f11efd7
chore(deps-dev): bump @types/jest from 29.5.2 to 29.5.3
dependabot[bot] dd3b15d
chore(deps): bump semver from 6.3.0 to 6.3.1
dependabot[bot] badc841
chore(deps-dev): bump @types/node from 20.4.1 to 20.4.2
dependabot[bot] 68d93f8
chore: update vitepress
Lehoczky f67e2fe
refactor(docs): use description from package.json
Lehoczky d9092c9
docs: add website url, add icons to README
Lehoczky d1fd013
ci: setup documentation deployment
Lehoczky c3254b6
chore: update lockfile
Lehoczky e900781
chore: update lockfile
Lehoczky 59833e7
ci: use newest node lts version
Lehoczky 76f66a1
fix: downgrade `aria-query` to v5.1.x
Lehoczky 3ac3b3b
Merge remote-tracking branch 'upstream/main'
7257b3e
chore: revert `aria-query` downgrade
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Docs | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Build docs | ||
run: npm run docs:build | ||
|
||
# https://github.com/crazy-max/ghaction-github-pages | ||
- name: Deploy to GitHub Pages | ||
uses: crazy-max/ghaction-github-pages@v3 | ||
with: | ||
target_branch: gh-pages | ||
build_dir: docs/.vitepress/dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ | |
/.idea/ | ||
/dist/ | ||
/node_modules/ | ||
/docs/.vitepress/dist | ||
/docs/.vitepress/cache | ||
yarn-error.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { defineConfig } from "vitepress"; | ||
import { rules } from "./rulesForSidebar"; | ||
import { description, version } from "../../package.json"; | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
title: "eslint-plugin-vuejs-a11y", | ||
base: "/eslint-plugin-vuejs-accessibility/", | ||
description, | ||
themeConfig: { | ||
// https://vitepress.dev/reference/default-theme-config | ||
nav: [ | ||
{ | ||
text: version, | ||
items: [ | ||
{ | ||
text: "Changelog", | ||
link: "https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility/blob/main/CHANGELOG.md" | ||
} | ||
] | ||
} | ||
], | ||
|
||
sidebar: [ | ||
{ | ||
text: "Introduction", | ||
items: [ | ||
{ text: "Getting Started", link: "/" }, | ||
{ text: "Rule Overview", link: "/rule-overview/index" } | ||
] | ||
}, | ||
{ | ||
text: "Rules", | ||
items: rules | ||
} | ||
], | ||
|
||
editLink: { | ||
pattern: | ||
"https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility/edit/master/docs/:path" | ||
}, | ||
|
||
socialLinks: [ | ||
{ | ||
icon: "github", | ||
link: "https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility" | ||
} | ||
], | ||
|
||
search: { | ||
provider: "local" | ||
} | ||
} | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { join, parse } from "node:path"; | ||
import { Dirent, readdirSync } from "node:fs"; | ||
|
||
export const rules = getRulesForSideBar(); | ||
|
||
function getRulesForSideBar() { | ||
const rulesDirectory = join(__dirname, "../", "rules"); | ||
return readdirSync(rulesDirectory, { withFileTypes: true }) | ||
.filter(isFile) | ||
.filter(isMarkdown) | ||
.map(fileNameWithoutExtension) | ||
.map(ruleToSidebarItem); | ||
} | ||
|
||
function isFile(dirent: Dirent) { | ||
return !dirent.isDirectory(); | ||
} | ||
|
||
function isMarkdown(dirent: Dirent) { | ||
return dirent.name.endsWith(".md"); | ||
} | ||
|
||
function fileNameWithoutExtension(file: Dirent) { | ||
const parsedFileName = parse(file.name); | ||
const nameWithoutExtension = parsedFileName.name; | ||
return nameWithoutExtension; | ||
} | ||
|
||
function ruleToSidebarItem(ruleName: string) { | ||
return { | ||
text: ruleName, | ||
link: `/rules/${ruleName}` | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Getting Started | ||
|
||
An `eslint` plugin for checking accessibility rules from within `.vue` files. | ||
|
||
## 💿 Installation | ||
|
||
::: code-group | ||
|
||
```bash [yarn] | ||
yarn add --dev eslint-plugin-vuejs-accessibility | ||
``` | ||
|
||
```bash [npm] | ||
npm install --save-dev eslint-plugin-vuejs-accessibility | ||
``` | ||
|
||
```bash [pnpm] | ||
pnpm add -D eslint-plugin-vuejs-accessibility | ||
``` | ||
|
||
::: | ||
|
||
## 📖 Usage | ||
|
||
Add `vuejs-accessibility` to the plugins section of your `eslint` configuration. You can omit the `eslint-plugin-` prefix: | ||
|
||
```json | ||
{ | ||
"plugins": ["vuejs-accessibility"] | ||
} | ||
``` | ||
|
||
Then configure the rules you want to use under the rules section. | ||
|
||
```json | ||
{ | ||
"rules": { | ||
"vuejs-accessibility/rule-name": "error" | ||
} | ||
} | ||
``` | ||
|
||
You can also enable all the recommended rules at once. Add `plugin:vuejs-accessibility/recommended` in extends: | ||
|
||
```json | ||
{ | ||
"extends": ["plugin:vuejs-accessibility/recommended"] | ||
} | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<script setup lang="ts"> | ||
import { data as rules } from "./rule-overview.data"; | ||
</script> | ||
|
||
<template> | ||
<div class="rule-table-container"> | ||
<div>✅ - Recommended</div> | ||
|
||
<table> | ||
<tr> | ||
<th>Rule</th> | ||
<th></th> | ||
</tr> | ||
|
||
<tr v-for="{ name, link, recommended } of rules"> | ||
<td> | ||
<a :href="link">{{ name }}</a> | ||
</td> | ||
|
||
<td v-if="recommended">✅</td> | ||
<td v-else></td> | ||
</tr> | ||
</table> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.rule-table-container { | ||
margin-top: 24px; | ||
} | ||
|
||
table { | ||
width: 100%; | ||
display: table; | ||
} | ||
|
||
td:last-of-type { | ||
width: 50px; | ||
} | ||
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
prev: | ||
text: Getting Started | ||
link: / | ||
next: | ||
text: alt-text | ||
link: /rules/alt-text | ||
--- | ||
|
||
<script setup lang="ts"> | ||
import RuleTable from './RuleTable.vue' | ||
</script> | ||
|
||
# Rule Overview | ||
|
||
<RuleTable /> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.