Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation website template #33

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ zeroapi.egg-info
coverage.*

# code generation test directory
test_codegen
test_codegen

3 changes: 3 additions & 0 deletions documentation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
docs/.vitepress/cache
docs/.vitepress/dist
47 changes: 47 additions & 0 deletions documentation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Documentation Guide

This documentation template has been built with [vitepress](https://vitepress.dev)

Use this extention while writing documentation : [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)

## Steps

Step 1: Clone the repository

```bash
git clone [email protected]:Ananto30/zero.git
```

Step 2: Move terminal inside documentation directory

```bash
cd documentation
```

Step 3: Install npm dependencies (your device should already have npm installed)

```bash
npm install
```

Step 4: Run the documentation site on browser for development

```bash
npm run docs:dev
```

Step 5: build website to publish

```bash
npm run docs:build
```

This command will create website files inside `documentation/docs/.vitepress/dist` directory. Inside `dist` directory generated website files will be avaliable.

Step 6 : preview the site locally before publishing.

```bash
npm run docs:preview
```

If everything is good, you can publish the website using the files existing inside `dist` directory.
122 changes: 122 additions & 0 deletions documentation/docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
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)
}
}
},

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: 'Feature',link: 'advanced/feature.md' },
],
},

{
text: 'Tools',
collapsed: true,
items: [
{ text: 'Code Generation',link: 'tool/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 documentation/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 documentation/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 documentation/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 documentation/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;

}

Loading