logicspark / vitepress-theme-api Goto Github PK
View Code? Open in Web Editor NEWSimple Vitepress Theme for API Documentation
License: MIT License
Simple Vitepress Theme for API Documentation
License: MIT License
Some of the dependencies are not up to date.
Older versions of some dependencies may have security concerns.
Currently, the custom container does not have icon representations or border color.
It’s not really a problem but to make each custom container standout more so that users can review API documents quickly and easily.
Currently, on Vitepress, the way to provide response data, it either shows all at once or collapse so users need to open the section.
Show All
::: details Collapsed Section
This is a details block.
:::
Add an extension to the md support to provide a scrollable frame for response data.
Aside bar not scrolling along with headings as soon as I used DividePage in the .md file.
.md example:
---
layout: pon
aside: left
---
<script setup>import {DividePage} from 'vitepress-theme-api';</script>
<style>@import './node_modules/vitepress-theme-api/dist/style.css';</style>
# GraphQL API Guide
[GraphQL](https://graphql.org/) is a query language for APIs that offers an efficient and versatile alternative to REST APIs.
## Benefits of Using GraphQL Over REST:
1. **Single Endpoint:** GraphQL employs a single endpoint for all queries and mutations, contrasting with REST which necessitates multiple endpoints.
2. **Streamlined Data Retrieval:** With GraphQL, there's no need for intermediary datastores or additional layers when collating related data.
3. **Precise Data Retrieval:** Clients dictate the exact data they need, ensuring swift and succinct responses.
4. **HTTP-Based:** GraphQL, despite its unique query language, operates via standard HTTP, meaning any client capable of HTTP requests can interface with a GraphQL server. No GraphQL specific libraries are needed.
<DividePage>
<template #left>
## Authentication
Use the `Authorization` HTTP header with your personal access token.
</template>
<template #right>
**Header:**
Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN
</template>
</DividePage>
<DividePage>
<template #left>
### Obtaining a Personal Access Token
[PLACEHOLDER: Instructions or link for token.]
</template>
<template #right>
</template>
</DividePage>
<DividePage>
<template #left>
## Filters
Filters empower you to fine-tune your GraphQL queries, allowing you to retrieve data based on specific conditions. This guide will showcase the usage of `DeviceFilter`, `TagFilter`, and `StringConditional` filters when querying devices in the provided schema.
### DeviceFilter
The `DeviceFilter` is specifically crafted for querying devices based on specific attributes such as type, label, status, and tags.
</template>
<template #right>
#### Filtering by Connection Status
To filter devices by their connection status, use the `status` attribute of `DeviceFilter` and choose a value from the `ConnectionStatus` enum.
graphql [GraphQL]
{
myDevices(filter: { status: "GOOD" }) {
content {
id
label
type
}
}
}
This query retrieves devices with a connection status of "GOOD".
#### Filtering by Label
To query devices based on their label, employ the `label` attribute in conjunction with `StringConditional`.
graphql [GraphQL]
{
myDevices(filter: { label: { eq: "MyVehicle" } }) {
content {
id
label
type
}
}
}
In this example, devices labeled "MyVehicle" are fetched.
</template>
</DividePage>
At the moment, the number order list is based on standard md support. There is no CSS class to prettify it.
It’s not really a problem but to make the number order list different and make the document easier to read
Add a CSS class to add a circular shape around each number
Currently the package.json
specifies that only Node 18 can be used:
"engines": {
"node": ">=18 <19"
},
This seems unnecessarily restricting and prevents me from installing this theme as a dependency.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.