-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: setup formatting with prettier
- Loading branch information
Showing
36 changed files
with
1,064 additions
and
460 deletions.
There are no files selected for viewing
This file contains 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,22 @@ | ||
name: Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
paths: | ||
- 'docs/**' | ||
|
||
jobs: | ||
check_formatting: | ||
runs-on: ubuntu-latest | ||
name: Docs formatting | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Check formatting | ||
run: npm run format:check |
This file contains 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 |
---|---|---|
|
@@ -6,6 +6,8 @@ on: | |
- main | ||
|
||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
|
||
jobs: | ||
lint: | ||
|
This file contains 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,3 @@ | ||
**/node_modules | ||
**/dist | ||
**/cache |
This file contains 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 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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
const localStorageKey = "vitepress:tabsSharedState"; | ||
const ls = typeof localStorage !== "undefined" ? localStorage : null; | ||
const localStorageKey = 'vitepress:tabsSharedState' | ||
const ls = typeof localStorage !== 'undefined' ? localStorage : null | ||
|
||
const getLocalStorageValue = (): Record<string, string> => { | ||
const rawValue = ls?.getItem(localStorageKey); | ||
const rawValue = ls?.getItem(localStorageKey) | ||
if (rawValue) { | ||
try { | ||
return JSON.parse(rawValue); | ||
return JSON.parse(rawValue) | ||
} catch {} | ||
} | ||
return {}; | ||
}; | ||
return {} | ||
} | ||
|
||
const setLocalStorageValue = (v: Record<string, string>) => { | ||
if (!ls) return; | ||
ls.setItem(localStorageKey, JSON.stringify(v)); | ||
}; | ||
if (!ls) return | ||
ls.setItem(localStorageKey, JSON.stringify(v)) | ||
} | ||
|
||
export const setupFrameworksTabs = () => { | ||
const v = getLocalStorageValue(); | ||
const v = getLocalStorageValue() | ||
if (!v.frameworks) { | ||
setLocalStorageValue({ frameworks: "React" }); | ||
setLocalStorageValue({ frameworks: 'React' }) | ||
} | ||
}; | ||
} |
This file contains 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 |
---|---|---|
@@ -1,22 +1,22 @@ | ||
// https://vitepress.dev/guide/custom-theme | ||
import { h } from "vue"; | ||
import type { Theme } from "vitepress"; | ||
import DefaultTheme from "vitepress/theme"; | ||
import { enhanceAppWithTabs } from "vitepress-plugin-tabs/client"; | ||
import { setupFrameworksTabs } from "./frameworksTabs"; | ||
import "./style.css"; | ||
import type { Theme } from 'vitepress' | ||
import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client' | ||
import DefaultTheme from 'vitepress/theme' | ||
import { h } from 'vue' | ||
import { setupFrameworksTabs } from './frameworksTabs' | ||
import './style.css' | ||
|
||
export default { | ||
extends: DefaultTheme, | ||
Layout: () => { | ||
return h(DefaultTheme.Layout, null, { | ||
// https://vitepress.dev/guide/extending-default-theme#layout-slots | ||
}); | ||
}) | ||
}, | ||
enhanceApp({ app, router, siteData }) { | ||
enhanceAppWithTabs(app); | ||
enhanceAppWithTabs(app) | ||
}, | ||
setup() { | ||
setupFrameworksTabs(); | ||
setupFrameworksTabs() | ||
}, | ||
} satisfies Theme; | ||
} satisfies Theme |
This file contains 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
Oops, something went wrong.