Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ zeroapi.egg-info
coverage.*

# code generation test directory
test_codegen
test_codegen

# Documentation
node_modules
docs/.vitepress/cache
docs/.vitepress/dist
120 changes: 120 additions & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
export default {
title: 'Zero',
description: 'Zero Documentation',
// base : '/zero/',
lastUpdated: true,
lang: 'en-US',
cleanUrls: true,

markdown: {
theme: 'material-theme-palenight',
lineNumbers: true,
anchors: {
slugify(str) {
return encodeURIComponent(str)
}
}
},

// Google Analytics
// head: [
// [ 'script', { async: '' , src: "https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX" } ],
// [ 'script', {} , "window.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\ngtag('config', 'G-XXXXXXXXXX');" ],
// ],

themeConfig: {
siteTitle: 'Zero',
logo : '/logo.png',

// DocSearch by Algolia
// algolia: {
// appId: 'XXXXXXXXXXXX',
// apiKey: 'XXXXXXXXXXXXXXXXXXXX',
// indexName: 'XXXXX'
// },

editLink: {
pattern: 'https://github.com/Ananto30/zero/tree/main/docs/:path',
text: 'Edit this page on GitHub'
},

// Navigation Section
nav: [
{ text: 'Home', link: '/' },
{ text: 'Documentation', link: 'getting_started/overview.md' },
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/Ananto30/zero' },
],

// Sidebar Section
sidebar: [

{
text: 'Getting Started',
collapsed: false,
items: [
{ text: 'Overview',link: 'getting_started/overview.md' },
{ text: 'About',link: 'getting_started/about.md' },
{ text: 'Benchmark',link: 'getting_started/benchmark.md' },
{ text: 'Install',link: 'getting_started/install.md' },
{ text: 'Uninstall',link: 'getting_started/uninstall.md' },
],
},

{
text: 'Concepts',
collapsed: true,
items: [
{ text: 'Architecture',link: 'concept/architecture.md' },
{ text: 'Lifecycle',link: 'concept/lifecycle.md' },
],
},

{
text: 'The Basics',
collapsed: true,
items: [
{ text: 'Routing',link: 'basic/routing.md' },
{ text: 'Request',link: 'basic/request.md' },
{ text: 'Response',link: 'basic/response.md' },
{ text: 'Middleware',link: 'basic/middleware.md' },
],
},

{
text: 'Advanced',
collapsed: true,
items: [
{ text: 'Code Generation',link: 'advanced/code_generation.md' },
],
},

{
text: 'Testing',
collapsed: true,
items: [
{ text: 'Getting Started',link: 'testing/getting_started.md' },
{ text: 'Http Testing',link: 'testing/http_testing.md' },
],
},

{
text: 'Prologue',
collapsed: true,
items: [
{ text: 'Release Note',link: 'prologue/release_note.md' },
{ text: 'Upgrade Guide',link: 'prologue/upgrade_guide.md' },
{ text: 'Contribution Guide',link: 'prologue/contribution_guide.md' },
],
},

],

// Footer Section
footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2023 zero'
},
},
}
40 changes: 40 additions & 0 deletions docs/.vitepress/theme/components/AsideSponsors.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<script setup>
import { useData } from "vitepress";
import sponsorsJson from "@theme/data/sponsor.json";

const { frontmatter } = useData();

const sponsors = sponsorsJson.platinum;

</script>

<template>
<div v-if="frontmatter.sponsors !== false">
<a v-for="sponsor in sponsors" :key="sponsor.name" :href="sponsor.link" target="_blank">
<img class="img" :src="sponsor.image" :alt="sponsor.name" />
</a>

<a class="b-sponsor" href="https://www.buymeacoffee.com/ananto30" target="_blank">
<p>Become Sponsor</p>
</a>
</div>
</template>

<style>
.img {
margin-top: 4px;
margin-bottom: px;
}

.b-sponsor {
font-size: 16px;
padding: 10px;
font-weight: normal;
text-align: center;
}

.b-sponsor:hover {
text-decoration: underline;
color: blueviolet;
}
</style>
18 changes: 18 additions & 0 deletions docs/.vitepress/theme/components/BuyMeACoffee.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script setup lang="ts">
import { useData } from "vitepress";
const { frontmatter } = useData();
</script>

<template>
<div v-if="frontmatter.sponsors !== false">
<a href="https://www.buymeacoffee.com/ananto30" target="_blank">
<img class="img" src="/advertisement/bmc.jpg" alt="buy me a coffee" />
</a>
</div>
</template>

<style>
.img {
border: 1px solid #ddd;
}
</style>
83 changes: 83 additions & 0 deletions docs/.vitepress/theme/components/Sponsors.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<script setup>

import sponsorsJson from "@theme/data/sponsor.json";

const platinumSponsors = sponsorsJson.platinum;
const goldSponsors = sponsorsJson.average;

</script>

<template>
<h1 class="title">Platinum Sponsors</h1>
<div class="sponsors">
<a class="sponsor" v-for="sponsor in platinumSponsors" :key="sponsor.name" :href="sponsor.link" target="_blank">
<img :src="sponsor.image" :alt="sponsor.name" />
</a>
</div>
<h1 class="title">Gold Sponsors</h1>
<div class="sponsors">
<a class="sponsor" v-for="sponsor in goldSponsors" :key="sponsor.name" :href="sponsor.link" target="_blank">
<img :src="sponsor.image" :alt="sponsor.name" />
</a>
</div>
</template>

<style scoped>
.title {
font-size: 3rem;
font-weight: bold;
margin-top: 120px;
margin-bottom: 60px;
text-align: center;
}

.sponsors {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
margin: 0 auto;
max-width: 100%;
}

.sponsor {
background-color: #f1f1f1;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100px;
border-radius: 10px;
}

.sponsor img {
max-width: 100%;
height: auto;
padding: 20px;
}

@media (min-width: 400px) {
.sponsor {
width: calc(50% - 20px);
height: 100px;
margin: 10px;
}
}

@media (min-width: 768px) {
.sponsor {
width: calc(33.33% - 20px);
height: 100px;
}
}

@media (min-width: 992px) {
.sponsor {
width: calc(25% - 20px);
height: 120px;
}
.sponsors {
max-width: 1160px;
}
}
</style>
33 changes: 33 additions & 0 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

/* options : https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css */


/* import fonr */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,500;0,600;0,700;1,500;1,600;1,700&display=swap');


:root {

--vp-font-family-base: 'Verdana';
/* --vp-font-family-base: 'Verdana'; */
/* --vp-font-family-base: 'Monaco' ; */


--vp-c-brand: #8e43b6;
--vp-c-brand-light: #712b94;

--vp-c-green: #660099;
--vp-c-green-light: #7f4b98;
--vp-c-green-lighter: #8f7e98;
--vp-c-green-dark: #500077;
--vp-c-green-darker: #1d002c;

/* Typography */
/* --vp-font-family-base: 'Quicksand', sans-serif; */

/* Code Snippet font */
--vp-font-family-mono: 'Roboto Mono' , monospace;

}

70 changes: 70 additions & 0 deletions docs/.vitepress/theme/data/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"platinum":
[
{
"name": "Sponsor 1",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor 1",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor 3",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor 4",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
}
],

"average":
[
{
"name": "Sponsor1",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor2",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor3",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor4",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor5",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor6",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor7",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
},
{
"name": "Sponsor8",
"image": "/advertisement/bmc.png",
"link": "https://tabpole.github.io"
}
]

}
12 changes: 12 additions & 0 deletions docs/.vitepress/theme/data/sponsor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"platinum":
[

],

"average":
[

]

}
Loading