Skip to content
This repository was archived by the owner on Apr 9, 2025. It is now read-only.

Commit 64a3102

Browse files
authored
Merge pull request #3 from dbssman/feature/2-documentation-with-vitepress
🚀 Vitepress setup and structure
2 parents 2f9668a + 4e7dae1 commit 64a3102

22 files changed

+1589
-73
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
26+
# Vitepress
27+
docs/.vitepress/cache

docs/.vitepress/config.cts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { defineConfig } from "vitepress"
2+
3+
export default defineConfig({
4+
title: 'Vue form handler',
5+
description: 'Discover the easy way of handling your vue forms',
6+
themeConfig: {
7+
nav: [
8+
{ text: 'Home', link: '/' },
9+
{ text: 'Get started', link: '/getting-started' },
10+
],
11+
sidebar: [
12+
{
13+
text: 'Documentation', items: [
14+
{ text: 'Get started', link: '/getting-started' },
15+
{ text: 'Tutorial', link: '/tutorial' },
16+
{
17+
text: 'Guides', items: [
18+
{ text: 'Validation', link: '/guides/validation' },
19+
{ text: 'Typescript', link: '/guides/typescript' },
20+
{ text: 'Form submission', link: '/guides/form-submission' },
21+
{ text: 'Custom components', link: '/guides/custom-components' },
22+
{ text: 'Native support', link: '/guides/native-support' },
23+
]
24+
},
25+
{
26+
text: 'Examples', items: [
27+
{ text: 'Basic', link: '/examples/basic' },
28+
{ text: 'Async validations', link: '/examples/async-validations' },
29+
{ text: 'Typescript', link: '/examples/typescript' },
30+
{ text: 'Interceptor', link: '/examples/interceptor' },
31+
{ text: 'Dependent fields', link: '/examples/dependent-fields' },
32+
{ text: 'More examples', link: '/examples/more-examples' }
33+
]
34+
},
35+
]
36+
},
37+
{
38+
text: 'API Reference', items: [
39+
{ text: 'useFormHandler()', link: '/api/use-form-handler' },
40+
{ text: `FormHandler`, link: '/api/form-handler' }
41+
]
42+
}
43+
]
44+
}
45+
})

docs/api/form-handler.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# \<FormHandler/>

docs/api/use-form-handler.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# useFormHandler()

docs/examples/async-validations.md

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

docs/examples/basic.md

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

docs/examples/dependent-fields.md

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

docs/examples/interceptor.md

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

docs/examples/more-examples.md

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

docs/examples/typescript.md

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

docs/getting-started.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Getting started
2+
3+
## Some section
4+
5+
Some content here
6+
7+
8+
## Another section
9+
10+
More content there
11+
12+
13+
## Basic example
14+
15+
Some code there
16+
17+
``` vue
18+
<template>
19+
<form @submit.prevent="handleSubmit(successFn)">
20+
<input v-bind="register('firstName')" />
21+
<input v-bind="register('lastName')" />
22+
<input v-bind="register('age')" />
23+
<input type="submit"/>
24+
</form>
25+
</template>
26+
<script setup>
27+
import { useFormHandler } from 'vue-form-handler';
28+
const { values, formState, register, handleSubmit } = useFormHandler();
29+
const successFn = (form) => {console.log({form})}
30+
</script>
31+
```

docs/guides/custom-components.md

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

docs/guides/form-submission.md

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

docs/guides/native-support.md

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

docs/guides/typescript.md

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

docs/guides/validation.md

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

docs/index.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
layout: home
3+
4+
hero:
5+
name: Vue form handler
6+
text: Vue & TS powered form handler.
7+
tagline: The only handler you'll need to easily work with forms in vue
8+
image:
9+
src: /logo.png
10+
alt: Vue form handler
11+
actions:
12+
- theme: brand
13+
text: Get Started
14+
link: /getting-started
15+
- theme: alt
16+
text: View on GitHub
17+
link: https://github.com/dbssman/vue-form-handler
18+
19+
features:
20+
- title: Fully tree shakeable
21+
details: Only take what you want
22+
icon:
23+
- title: Type Strong
24+
details: Written in TypeScript, with full TS docs
25+
icon: 💪
26+
- title: Flexible
27+
details: You can wrap the handler over native inputs or any other like the ones from material libraries or custom inputs
28+
icon: 🔩
29+
- title: Super light
30+
details: Small package size
31+
icon: 🪶
32+
- title: DX
33+
details: Great development experience
34+
icon: 💻
35+
- title: Interactive demos
36+
details: Documentation of functions also come with interactive demos!
37+
icon: 🎪
38+
---

docs/tutorial.md

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

0 commit comments

Comments
 (0)