Skip to content

Commit

Permalink
docs: added doc-website ui and initial demo contents
Browse files Browse the repository at this point in the history
  • Loading branch information
mahabubx7 committed Oct 14, 2024
1 parent e85e8d5 commit 9619737
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 17 deletions.
44 changes: 38 additions & 6 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from "vitepress"
// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Akar.js",
description: "Lightweight data validation library",
description: "Simple & lightweight data validation library",
base: "/akarjs/",
// lang: "en",
sitemap: {
Expand All @@ -26,22 +26,54 @@ export default defineConfig({
message:
'Released under the <a href="https://github.com/mahabubx7/akarjs/blob/main/LICENSE">MIT License</a>.',
copyright:
'Copyright © 2024-present <a href="https://github.com/mahabubx7">Mahabub</a>'
'Copyright © 2024-present <a href="https://github.com/mahabubx7">@mahabubx7</a>'
},

logo: "/akar-js-logo.png",

sidebar: [
{
text: "Greetings",
link: "/greetings"
},
{
text: "Guides",
link: "/",
base: "/guide",
items: [
{ text: "Markdown Examples", link: "/markdown-examples" },
{ text: "Runtime API Examples", link: "/api-examples" }
{ text: "Get Started", link: "/get-started" },
{ text: "Define Schema", link: "/schema" },
{ text: "Data Validation", link: "/validation" }
]
},
{
text: "API",
items: [{ text: "API Reference", link: "/api" }]
text: "API References",
link: "/",
base: "/api",
items: [
{
text: "Object",
link: "/object"
},
{
text: "Array",
link: "/array"
},
{
text: "Number",
link: "/number"
},
{
text: "String",
link: "/string"
},
{ text: "Enum", link: "/enum" },

{
text: "Boolean",
link: "/boolean"
}
]
}
],

Expand Down
6 changes: 5 additions & 1 deletion docs/api/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# API index
# API References

## Introduction

Welcome to the `Akar.js`. This page will walk you through the available API references of this library.
8 changes: 8 additions & 0 deletions docs/greetings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Welcome!

::: info
This package is almost ready for its first release `v1.0.0-beta`.
It is still in `development` and very soon will be available in npm.
:::

If you consider this project useful or worth the attentions of developers, then please give its GitHub repository a star. Also, you can contribute to this open-source project. Follow the guidelines to contribute.
73 changes: 73 additions & 0 deletions docs/guide/get-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Get Started

## Introduction

Welcome to the `Akar.js`. This page will walk you through the step-by-step process of installing an npm package and provide a sample usage with a theme-based table of contents.

## Table of Contents

- [Installation](#installation)
- [Sample Usage](#sample-usage)
- [Conclusion](#conclusion)

## Installation

To install the npm package, follow these steps:

1. Open your terminal.
2. Run the following command to install the package:

<Tabs>
<TabItem value="npm" label="npm">

```sh
npm install akar
```

</TabItem>

<TabItem value="yarn" label="yarn">

```sh
yarn add akar
```

</TabItem>
</Tabs>

3. Verify the installation by checking the package version:

```sh
npm list akar
```

## Sample Usage

After installing the package, you can use it in your project as follows:

1. Import the package in your JavaScript file:

```ts
import Akar from "akar"
// or
import { a } from "akar"
```

2. Use the package in your code:

```ts
const objectSchema = a.object({ message: a.string().min(3) })
console.log(objectSchema.parse({ message: "Hello!" }))
// output :=>
/*
{
value: {
message: "Hello!"
}
}
*/
```

## Conclusion

You have successfully installed and used the npm package. Refer to the package documentation for more detailed information and advanced usage.
10 changes: 9 additions & 1 deletion docs/guide/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# Guide index
# Welcome to the Guide

## Requirements

We recommend `Node.js` >= `20.x` as the runtime to use our library without any unknown errors or bugs. We support ESM by default, but it is compatiable with CJS too.

## Conclusion

This pkg was developed in Node.js runtime. Still it can be used in other `node.js` like runtimes such as `bun` or `deno2` _(coming soon)_
32 changes: 32 additions & 0 deletions docs/guide/schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Define Schema

## Summary

We need to define schema for the validation process and each schema will contain its own rules, types-casts and other utilities.

## Table of Contents

- [Hello Schema](#hello-schema)
- [Array](#array)
- [Object](#object)
- [String](#string)
- [Number](#number)
- [Enum](#enum)
- [Boolean](#boolean)
- [Conclusion](#conclusion)

## Hello Schema

## Array

## Object

## String

## Number

## Enum

## Boolean

## Conclusion
Empty file added docs/guide/validation.md
Empty file.
18 changes: 9 additions & 9 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ layout: home
title: Home
hero:
name: Akar.js
text: Schema first data validation library.
tagline: Data validation made easy and more.
text: Type-safe data validation library.
tagline: Schema based & typescript-first validation.
image:
src: /akar-js-logo.png
alt: Akar.js
actions:
- theme: brand
text: Get Started
link: /guide/index.md
link: /greetings.md
- theme: alt
text: Documentation
link: /api/index.md

features:
- icon: 🛠️
title: Simple and minimal, always
details: Lorem ipsum...
title: Type-safety first approach
details: Ensure your data validation is type-safe, reducing runtime errors and improving code reliability.
- icon: 🛠️
title: Another cool feature
details: Lorem ipsum...
title: Smooth error handlers
details: Handle validation errors gracefully with built-in error handling mechanisms.
- icon: 🛠️
title: Another cool feature
details: Lorem ipsum...
title: Rich type inferer
details: Leverage advanced type inference to infer the type directly from your defined schema.
---

0 comments on commit 9619737

Please sign in to comment.