Skip to content

Commit 42a21ea

Browse files
Added docs with vuepress
1 parent 41d17c8 commit 42a21ea

File tree

24 files changed

+319
-11
lines changed

24 files changed

+319
-11
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
* text=auto
22

33
.github/ export-ignore
4+
.run/ export-ignore
45
docs/ export-ignore
56
tests/ export-ignore
67

78
.editorconfig export-ignore
89
.gitattributes export-ignore
910
.gitignore export-ignore
1011

12+
package.json export-ignore
1113
phpunit.xml export-ignore

.gitignore

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
.idea/
2-
vendor/
2+
_site/
33
build/
4+
node_modules/
5+
tmp/
6+
vendor/
7+
8+
.cache
9+
.DS_Store
10+
.env
11+
.php_cs.cache
12+
.phpintel
13+
.temp
414

515
*.bak
616
*.cache
717
*.clover
818
*.orig
919

1020
composer.lock
21+
package-lock.json

.run/build.run.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="build" type="js.build_tools.npm" nameIsGenerated="true">
3+
<package-json value="$PROJECT_DIR$/package.json" />
4+
<command value="run" />
5+
<scripts>
6+
<script value="build" />
7+
</scripts>
8+
<node-interpreter value="project" />
9+
<package-manager value="npm" />
10+
<envs />
11+
<method v="2" />
12+
</configuration>
13+
</component>

.run/dev.run.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="dev" type="js.build_tools.npm" nameIsGenerated="true">
3+
<package-json value="$PROJECT_DIR$/package.json" />
4+
<command value="run" />
5+
<scripts>
6+
<script value="dev" />
7+
</scripts>
8+
<node-interpreter value="project" />
9+
<package-manager value="npm" />
10+
<envs />
11+
<method v="2" />
12+
</configuration>
13+
</component>

docs/.vuepress/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.cache/
2+
.temp/
3+
4+
dist/

docs/.vuepress/config.js

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
import fs from 'fs'
2+
import path from 'path'
3+
import dotenv from 'dotenv'
4+
5+
import { defaultTheme, viteBundler } from 'vuepress'
6+
7+
dotenv.config()
8+
9+
const hostname = 'actions.dragon-code.pro'
10+
11+
module.exports = {
12+
lang: 'en-US',
13+
title: 'Dragon Code: Actions',
14+
description: 'Performing actions with saving the list of called files',
15+
16+
head: [
17+
['link', { rel: 'icon', href: `https://${ hostname }/images/logo.svg` }],
18+
['meta', { name: 'twitter:image', content: `https://${ hostname }/images/logo.svg` }]
19+
],
20+
21+
bundler: viteBundler(),
22+
23+
theme: defaultTheme({
24+
hostname,
25+
base: '/',
26+
27+
logo: `https://${ hostname }/images/logo.svg`,
28+
29+
repo: 'https://github.com/TheDragonCode/laravel-migration-actions',
30+
repoLabel: 'GitHub',
31+
docsRepo: 'https://github.com/TheDragonCode/laravel-migration-actions',
32+
docsBranch: 'main',
33+
docsDir: 'docs',
34+
35+
contributors: false,
36+
editLink: true,
37+
38+
navbar: [
39+
{ text: '3.x', link: '/prologue/changelog/index.md' }
40+
],
41+
42+
sidebarDepth: 1,
43+
44+
sidebar: [
45+
{
46+
text: 'Prologue',
47+
collapsible: true,
48+
children: [
49+
{
50+
text: 'Upgrade Guide',
51+
link: '/prologue/upgrade.md'
52+
},
53+
{
54+
text: 'License',
55+
link: '/prologue/license.md'
56+
},
57+
{
58+
text: 'Changelog',
59+
link: '/prologue/changelog/index.md',
60+
collapsible: true,
61+
children: getChildren('prologue/changelog', 'desc')
62+
}
63+
]
64+
},
65+
66+
{
67+
text: 'Getting Started',
68+
collapsible: true,
69+
children: [
70+
{
71+
text: 'Installation',
72+
link: '/getting-started/installation/index.md'
73+
}
74+
]
75+
},
76+
77+
{
78+
text: 'How To Use',
79+
collapsible: true,
80+
children: getChildren('how-to-use')
81+
},
82+
83+
{
84+
text: 'Helpers',
85+
collapsible: true,
86+
children: getChildren('helpers')
87+
}
88+
]
89+
})
90+
}
91+
92+
function getChildren(folder, sort = 'asc') {
93+
const extension = ['.md']
94+
const names = ['index.md', 'readme.md']
95+
96+
const dir = `${ __dirname }/../${ folder }`
97+
98+
return fs
99+
.readdirSync(path.join(dir))
100+
.filter(item =>
101+
fs.statSync(path.join(dir, item)).isFile() &&
102+
! names.includes(item.toLowerCase()) &&
103+
extension.includes(path.extname(item))
104+
)
105+
.sort((a, b) => {
106+
a = resolveNumeric(a)
107+
b = resolveNumeric(b)
108+
109+
if (a < b) return sort === 'asc' ? -1 : 1
110+
if (a > b) return sort === 'asc' ? 1 : -1
111+
112+
return 0
113+
}).map(item => `/${ folder }/${ item }`)
114+
}
115+
116+
function resolveNumeric(value) {
117+
const sub = value.substring(0, value.indexOf('.'))
118+
119+
const num = Number(sub)
120+
121+
return isNaN(num) ? value : num
122+
}

docs/.vuepress/public/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
actions.dragon-code.pro
54.8 KB
Binary file not shown.
Lines changed: 63 additions & 0 deletions
Loading

docs/.vuepress/styles/_fonts.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@charset "UTF-8";
2+
3+
@font-face {
4+
font-family: 'Nunito';
5+
src: local('Nunito'), url(/fonts/Nunito-SemiBold.woff2) format('woff2');
6+
font-weight: 600;
7+
font-style: normal;
8+
font-display: swap;
9+
}

0 commit comments

Comments
 (0)