Skip to content

Commit 8522961

Browse files
authored
Merge pull request #24 from IPLSplatoon/new-docs
New documentation site
2 parents 09c3b27 + 7d16c6d commit 8522961

File tree

121 files changed

+11095
-7897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+11095
-7897
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
webpack.config.js
2-
webpack.config.example-page.js
32
node_modules/**/*
43
dist/**/*

.github/workflows/ci.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout this repository
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
13+
14+
- name: Enable Corepack before setting up Node
15+
run: corepack enable
1316

1417
- name: Set up Node.js
15-
uses: actions/setup-node@v2
18+
uses: actions/setup-node@v4
1619
with:
17-
node-version: '16'
20+
node-version-file: '.node-version'
1821
cache: 'yarn'
1922

2023
- name: Install dependencies
@@ -39,18 +42,21 @@ jobs:
3942
runs-on: ubuntu-latest
4043
steps:
4144
- name: Checkout this repository
42-
uses: actions/checkout@v2
45+
uses: actions/checkout@v4
46+
47+
- name: Enable Corepack before setting up Node
48+
run: corepack enable
4349

4450
- name: Set up Node.js
45-
uses: actions/setup-node@v2
51+
uses: actions/setup-node@v4
4652
with:
47-
node-version: '16'
53+
node-version-file: '.node-version'
4854
registry-url: 'https://registry.npmjs.org'
4955
cache: 'yarn'
5056

5157
- name: Install dependencies
5258
run: yarn
5359
- run: yarn build
54-
- run: yarn publish
60+
- run: yarn npm publish
5561
env:
5662
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
node_modules
2+
.pnp.*
3+
.yarn/*
4+
!.yarn/patches
5+
!.yarn/plugins
6+
!.yarn/releases
7+
!.yarn/sdks
8+
!.yarn/versions
29
dist
310

411
result.json
512

613
# Files from packaging for local testing
714
/*.tgz
15+
16+
docs/.vitepress/dist
17+
docs/.vitepress/cache

.idea/Components.iml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.5.1

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 2.10.1
2+
3+
- Move docs to a vitepress-powered concoction, combining the previously separate plain-text docs and locally built examples into a single site
4+
15
# 2.10.0
26

37
- ipl-select emits the full option object on update as an additional parameter

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# @iplsplatoon/vue-components
22

3-
[Docs](https://ipl-vue-components.readthedocs.io)
3+
[Docs](https://vue-components.iplabs.work/)
44

55
Vue components for internal Inkling Performance Labs utilities, most notably [ipl-overlay-controls.](https://github.com/inkfarer/ipl-overlay-controls)
66

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import MarkdownIt from 'markdown-it'
2+
import container from 'markdown-it-container'
3+
4+
export const demoPlugin = (md: MarkdownIt) => {
5+
md.use(container, 'demo', {
6+
validate(params) {
7+
return params.trim().match(/^demo\s+(.*)$/) != null
8+
},
9+
10+
render(tokens, idx, _options, env) {
11+
const token = tokens[idx];
12+
if (token.type.endsWith('open')) {
13+
const componentName = token.info.trim().split(' ')[1]
14+
return md.render(`
15+
<div class="demo-section">\n
16+
<demo source-file="${componentName}" />\n
17+
<IplExpandingSpace title="View Source" class="source-example">\n
18+
<<< @/examples/${componentName}.vue#example{vue-html}
19+
</IplExpandingSpace>\n
20+
</div>
21+
`, env)
22+
} else {
23+
return ''
24+
}
25+
}
26+
} satisfies container.ContainerOpts)
27+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<template>
2+
<div class="demo-preview">
3+
<component :is="component" />
4+
</div>
5+
</template>
6+
7+
<script setup lang="ts">
8+
import { shallowRef } from 'vue';
9+
10+
const props = defineProps<{
11+
sourceFile: string
12+
}>()
13+
14+
const component = shallowRef(null)
15+
import(`../../examples/${props.sourceFile}.vue`).then(result => {
16+
component.value = result.default
17+
})
18+
</script>
19+
20+
<style lang="scss">
21+
@use 'src/styles/colors';
22+
23+
html.dark .demo-preview > *:first-child {
24+
--line-color: #37445C;
25+
}
26+
27+
.demo-preview {
28+
display: flex;
29+
flex-direction: column;
30+
align-items: center;
31+
32+
> * {
33+
width: 100%;
34+
}
35+
}
36+
37+
.demo-preview > *:first-child {
38+
$grid-size: 8px;
39+
$grid-width: 1px;
40+
--line-color: #E5E9F0;
41+
42+
background-size: $grid-size $grid-size;
43+
background-position: $grid-size $grid-size;
44+
background-color: var(--vp-c-bg);
45+
background-image:
46+
linear-gradient(to right, var(--line-color) $grid-width, transparent $grid-width),
47+
linear-gradient(to bottom, var(--line-color) $grid-width, transparent $grid-width);
48+
49+
font-family: 'Roboto', sans-serif;
50+
font-weight: 400;
51+
padding: 24px;
52+
53+
&.resizable {
54+
resize: horizontal;
55+
overflow: hidden;
56+
max-width: 100%;
57+
min-width: 150px;
58+
}
59+
}
60+
61+
.demo-preview > *.alt-background:first-child {
62+
background-color: var(--vp-c-bg-alt);
63+
}
64+
65+
.demo-preview > *.gray-background:first-child {
66+
background-color: #bbb;
67+
--line-color: #999 !important;
68+
}
69+
70+
.width-capped-content > * {
71+
max-width: 400px;
72+
margin: 0 auto;
73+
}
74+
75+
.demo-preview > *:not(:first-child, .ipl-expansion-panel__content) {
76+
background-color: var(--vp-c-bg);
77+
border-radius: 8px;
78+
padding: 8px;
79+
}
80+
81+
.demo-preview > *:not(:first-child) {
82+
margin-top: 8px;
83+
}
84+
</style>

0 commit comments

Comments
 (0)