Skip to content

Commit

Permalink
feat: setup VitePress for documentation (#67)
Browse files Browse the repository at this point in the history
remove orama, update title, use readme as root documentation page

fix build

refactor: customize settings & nav

chore: customize theme & refactor sidebar

chore: continue to rework theme & docs

chore: continue docs & vitepress cleanup
  • Loading branch information
PierreDemailly authored Mar 29, 2024
1 parent dcc6885 commit 5be9c90
Show file tree
Hide file tree
Showing 79 changed files with 5,217 additions and 390 deletions.
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "@nodesecure/eslint-config",
"parserOptions": {
"sourceType": "module",
"requireConfigFile": false
}
}
64 changes: 64 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Sample workflow for building and deploying a VitePress site to GitHub Pages
#
name: Deploy VitePress site to Pages

on:
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
# using the `master` branch as the default branch.
push:
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
# - uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
- name: Setup Node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: npm # or pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0
- name: Install dependencies
run: npm ci # or pnpm install / yarn install / bun install
- name: Build with VitePress
run: npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: docs/.vitepress/dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,7 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# VitePress
docs/.vitepress/dist
docs/.vitepress/cache
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<span id="readme-top"></span>

<p align="center">
<img src="./docs/myunisoft_banner.png" height="300">
<img src="docs/images/github_banner.png" height="300">
</p>

<p align="center">
Expand Down Expand Up @@ -80,11 +80,11 @@ Il vous sera nécessaire de choisir l'un des deux type d'accès (ou de discuter

### Partenaire

Voici la marche à suivre concernant l'authentification si vous êtes un partenaire: [Comment s'authentifier ?](./docs/authentication/authentication.md)
Voici la marche à suivre concernant l'authentification si vous êtes un partenaire: [Comment s'authentifier ?](docs/authentication/partenaire.md)

### Formule API Cabinet (destiné aux cabinets eux-mêmes).

Voici la marche à suivre concernant l'authentification si vous êtes un cabinet ayant souscrit à l'offre API Cabinet: [Comment s'authentifier ?](./docs/authentication/authentication_by_email.md)
Voici la marche à suivre concernant l'authentification si vous êtes un cabinet ayant souscrit à l'offre API Cabinet: [Comment s'authentifier ?](docs/authentication/cabinet.md)

<p align="right">(<a href="#readme-top">retour en haut de page</a>)</p>

Expand All @@ -104,7 +104,7 @@ Pour plus d'informations nous vous invitons à consulter les sous documentations

- [🔸 Accès par société](./docs/endpoints/societe.md)
- [🔹 Accès cabinet](./docs/endpoints/cabinet.md)
- [🔑 Liste des routes accessibles](./docs/endpoints/endpoints_accessibles.md)
- [🔑 Liste des routes accessibles](docs/endpoints/keyinfo.md)

## Lien racine 🌍

Expand Down Expand Up @@ -137,8 +137,8 @@ Une liste de guides qui pourront certainement vous aider dans la réalisation de
- [Récupérer les utilisateurs et personnes physiques](docs/accounting/firm/users.md)
- [Récupérer les dossiers accessibles pour un utilisateur](docs/accounting/firm/dossier_accessible.md)
- [Récupérer les dossiers de productions (entreprises)](docs/accounting/society.md)
- [Récupérer le paramétrage comptable d'un dossier de production](docs/accounting/folder/accounting_parameters.md)
- [Récupérer les filiales associées à une entreprise](docs/accounting/folder/filiale_associate.md)
- [Récupérer le paramétrage comptable d'un dossier de production](docs/accounting/firm/accounting_parameters.md)
- [Récupérer les filiales associées à une entreprise](docs/accounting/firm/filiale_associate.md)

## Guides sur les API comptabilités

Expand Down
56 changes: 56 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { defineConfig } from "vitepress"
import sidebar from "./sidebar"

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "API Partenaire",
description: "Documentation technique",
lang: "fr-FR",
lastUpdated: true,
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
outlineTitle: "Table des matières",
nav: [
{
text: "🏠 Accueil",
link: "/"
},
{
text: "📚 Documentation",
link: "/documentation",
activeMatch: "^((?:\/(?!MAD)).+)$"
},
{
text: "⚡ MAD",
link: "/MAD/introduction.md",
activeMatch: "/MAD/"
},
{ text: "Postman", link: "https://docs.api.myunisoft.fr/" },
],
sidebar,
search: {
provider: "local"
},
socialLinks: [
{ icon: "github", link: "https://github.com/MyUnisoft/" },
{ icon: "linkedin", link: "https://www.linkedin.com/company/myunisoft" }
],
logo: {
light: "https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/e4951fd8010295ee229518551a558e0d74e9faf4c6ba3000b65cc04fad62789a",
dark: "/images/logo/white.svg"
},
editLink: {
pattern: "https://github.com/MyUnisoft/api-partenaires/edit/main/docs/:path"
}
},
markdown: {
theme: {
light: "github-light-default",
dark: "monokai"
}
},
base: "/",
vite: {
assetsInclude: ["**/*.PNG"]
},
})
Loading

0 comments on commit 5be9c90

Please sign in to comment.