Skip to content

Commit

Permalink
Merge pull request #185 from AniList/vitepress
Browse files Browse the repository at this point in the history
Migrate docs to Vitepress
  • Loading branch information
TehNut authored Sep 28, 2024
2 parents 69b0210 + 6563038 commit aa8e46d
Show file tree
Hide file tree
Showing 289 changed files with 23,462 additions and 1,708 deletions.
File renamed without changes
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules/
.vitepress/cache/
.vitepress/dist/
158 changes: 158 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
import { defineConfig } from 'vitepress'
import referenceSidebar from "../docs/reference/sidebar.json";

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "AniList API Docs",
description: "Developer documentation for the AniList API.",
srcDir: "docs",
cleanUrls: true,
head: [
['link', { rel: 'icon', href: '/anilist.png' }]
],
themeConfig: {
logo: "/anilist.png",
search: {
provider: "local"
},
outline: "deep",
nav: [
{
text: "Guide",
link: "/guide/introduction",
activeMatch: "^/guide/"
},
{
text: "Reference",
link: "/reference/",
activeMatch: "^/reference/"
},
{
text: "AniList",
link: "https://anilist.co/",
},
{
text: "AniChart",
link: "https://anichart.net"
},
],
sidebar: {
"/guide/": [
{
text: 'Introduction',
items: [
{
text: "What is AniList?",
link: "/guide/introduction"
},
{
text: "Terms of Use",
link: "/guide/terms-of-use"
},
{
text: "Considerations",
link: "/guide/considerations"
},
{
text: "Rate Limiting",
link: "/guide/rate-limiting"
}
]
},
{
text: "GraphQL",
collapsed: false,
items: [
{
text: "Getting Started",
link: "/guide/graphql/",
},
{
text: "Pagination",
link: "/guide/graphql/pagination",
},
{
text: "Connections",
link: "/guide/graphql/connections",
},
{
text: "Errors",
link: "/guide/graphql/errors",
},
{
text: "What's next?",
link: "/guide/graphql/whats-next",
},
{
text: "Mutations",
link: "/guide/graphql/mutations",
}
]
},
{
text: "Authentication",
collapsed: false,
items: [
{
text: "Getting Started",
link: "/guide/auth/",
},
{
text: "Authorization Code Grant",
link: "/guide/auth/authorization-code"
},
{
text: "Implicit Grant",
link: "/guide/auth/implicit"
},
{
text: "Authenticated Requests",
link: "/guide/auth/authenticated-requests"
}
]
},
{
text: "Query Examples",
link: "/guide/graphql/queries/",
collapsed: true,
items: [
{
text: "Media",
link: "/guide/graphql/queries/media"
},
{
text: "Media List",
link: "/guide/graphql/queries/media-list"
},
{
text: "User",
link: "/guide/graphql/queries/user"
}
]
},
{
text: "Migration",
collapsed: true,
items: [
{
text: "Migrating from API v1",
link: "/guide/migration/version-1/"
}
],
}
],
"/reference/": referenceSidebar,
},
socialLinks: [
{ icon: 'discord', link: 'https://discord.gg/anilist' },
{ icon: 'twitter', link: 'https://twitter.com/AniListco' },
{
icon: {
svg: `<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Bluesky</title><path d="M12 10.8c-1.087-2.114-4.046-6.053-6.798-7.995C2.566.944 1.561 1.266.902 1.565.139 1.908 0 3.08 0 3.768c0 .69.378 5.65.624 6.479.815 2.736 3.713 3.66 6.383 3.364.136-.02.275-.039.415-.056-.138.022-.276.04-.415.056-3.912.58-7.387 2.005-2.83 7.078 5.013 5.19 6.87-1.113 7.823-4.308.953 3.195 2.05 9.271 7.733 4.308 4.267-4.308 1.172-6.498-2.74-7.078a8.741 8.741 0 0 1-.415-.056c.14.017.279.036.415.056 2.67.297 5.568-.628 6.383-3.364.246-.828.624-5.79.624-6.478 0-.69-.139-1.861-.902-2.206-.659-.298-1.664-.62-4.3 1.24C16.046 4.748 13.087 8.687 12 10.8Z"/></svg>`
},
link: "https://bsky.app/profile/anilist.co"
},
{ icon: 'github', link: 'https://github.com/AniList' },
]
}
})
17 changes: 17 additions & 0 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// https://vitepress.dev/guide/custom-theme
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './style.css'

export default {
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
},
enhanceApp({ app, router, siteData }) {
// ...
}
} satisfies Theme
139 changes: 139 additions & 0 deletions .vitepress/theme/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
/**
* Customize default theme styling by overriding CSS variables:
* https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
*/

/**
* Colors
*
* Each colors have exact same color scale system with 3 levels of solid
* colors with different brightness, and 1 soft color.
*
* - `XXX-1`: The most solid color used mainly for colored text. It must
* satisfy the contrast ratio against when used on top of `XXX-soft`.
*
* - `XXX-2`: The color used mainly for hover state of the button.
*
* - `XXX-3`: The color for solid background, such as bg color of the button.
* It must satisfy the contrast ratio with pure white (#ffffff) text on
* top of it.
*
* - `XXX-soft`: The color used for subtle background such as custom container
* or badges. It must satisfy the contrast ratio when putting `XXX-1` colors
* on top of it.
*
* The soft color must be semi transparent alpha channel. This is crucial
* because it allows adding multiple "soft" colors on top of each other
* to create a accent, such as when having inline code block inside
* custom containers.
*
* - `default`: The color used purely for subtle indication without any
* special meanings attched to it such as bg color for menu hover state.
*
* - `brand`: Used for primary brand colors, such as link text, button with
* brand theme, etc.
*
* - `tip`: Used to indicate useful information. The default theme uses the
* brand color for this by default.
*
* - `warning`: Used to indicate warning to the users. Used in custom
* container, badges, etc.
*
* - `danger`: Used to show error, or dangerous message to the users. Used
* in custom container, badges, etc.
* -------------------------------------------------------------------------- */

:root {
--vp-c-default-1: var(--vp-c-gray-1);
--vp-c-default-2: var(--vp-c-gray-2);
--vp-c-default-3: var(--vp-c-gray-3);
--vp-c-default-soft: var(--vp-c-gray-soft);

--vp-c-brand-1: var(--vp-c-indigo-1);
--vp-c-brand-2: var(--vp-c-indigo-2);
--vp-c-brand-3: var(--vp-c-indigo-3);
--vp-c-brand-soft: var(--vp-c-indigo-soft);

--vp-c-tip-1: var(--vp-c-brand-1);
--vp-c-tip-2: var(--vp-c-brand-2);
--vp-c-tip-3: var(--vp-c-brand-3);
--vp-c-tip-soft: var(--vp-c-brand-soft);

--vp-c-warning-1: var(--vp-c-yellow-1);
--vp-c-warning-2: var(--vp-c-yellow-2);
--vp-c-warning-3: var(--vp-c-yellow-3);
--vp-c-warning-soft: var(--vp-c-yellow-soft);

--vp-c-danger-1: var(--vp-c-red-1);
--vp-c-danger-2: var(--vp-c-red-2);
--vp-c-danger-3: var(--vp-c-red-3);
--vp-c-danger-soft: var(--vp-c-red-soft);
}

/**
* Component: Button
* -------------------------------------------------------------------------- */

:root {
--vp-button-brand-border: transparent;
--vp-button-brand-text: var(--vp-c-white);
--vp-button-brand-bg: var(--vp-c-brand-3);
--vp-button-brand-hover-border: transparent;
--vp-button-brand-hover-text: var(--vp-c-white);
--vp-button-brand-hover-bg: var(--vp-c-brand-2);
--vp-button-brand-active-border: transparent;
--vp-button-brand-active-text: var(--vp-c-white);
--vp-button-brand-active-bg: var(--vp-c-brand-1);
}

/**
* Component: Home
* -------------------------------------------------------------------------- */

:root {
--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: -webkit-linear-gradient(
120deg,
#bd34fe 30%,
#41d1ff
);

--vp-home-hero-image-background-image: linear-gradient(
-45deg,
#bd34fe 50%,
#47caff 50%
);
--vp-home-hero-image-filter: blur(44px);
}

@media (min-width: 640px) {
:root {
--vp-home-hero-image-filter: blur(56px);
}
}

@media (min-width: 960px) {
:root {
--vp-home-hero-image-filter: blur(68px);
}
}

/**
* Component: Custom Block
* -------------------------------------------------------------------------- */

:root {
--vp-custom-block-tip-border: transparent;
--vp-custom-block-tip-text: var(--vp-c-text-1);
--vp-custom-block-tip-bg: var(--vp-c-brand-soft);
--vp-custom-block-tip-code-bg: var(--vp-c-brand-soft);
}

/**
* Component: Algolia
* -------------------------------------------------------------------------- */

.DocSearch {
--docsearch-primary-color: var(--vp-c-brand-1) !important;
}

28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
<img align="center" src='https://raw.githubusercontent.com/AniList/ApiV2-GraphQL-Docs/master/al-graphql.jpg'>
<img align="center" src='./.github/img/al-graphql.jpg'>

## AniList Api v2 GraphQL Docs
## AniList API Docs

The AniList [GraphQL](http://graphql.org/) Api provides quick and powerful access to over 500k anime and manga entries, including character, staff, and live airing data. The [AniList](https://anilist.co) & [AniChart](http://anichart.net) websites themselves run on the Api, so everything you can do on the sites, you can do via the Api.
The AniList [GraphQL](http://graphql.org/) API provides quick and powerful access to over 500k anime and manga entries, including character, staff, and live airing data. The [AniList](https://anilist.co) & [AniChart](http://anichart.net) websites themselves run on the API, so almost everything you can do on the sites, you can do via the API.

### <a href='https://anilist.gitbook.io/anilist-apiv2-docs/'>Api Documentation</a>
> Written documentation for getting started with the Api.
### <a href='https://docs.anilist.co/'>API Documentation</a>

Written documentation for getting started with the API.

### <a href='https://anilist.github.io/ApiV2-GraphQL-Docs/'>GraphQL Api Reference Docs</a>
> Documentation for all queries, mutations, types, and objects the Api provides.
### <a href='https://anilist.github.io/ApiV2-GraphQL-Docs/'>GraphQL API Reference Docs</a>

### <a href='https://anilist.co/graphiql'>GraphiQL Interactive Editor</a>
> Easily explore and test out GraphQL queries against the AniList Api. (AniList login required)
Documentation for all queries, mutations, types, and objects the API provides.

> [!Note]
> Deprecated, try [Apollo Studio](https://studio.apollographql.com/sandbox/explorer?endpoint=https%3A%2F%2Fgraphql.anilist.co) instead.
>
> You can find statically rendered reference docs [here](https://docs.anilist.co/reference/query), however these are updated manually and may not always be up to date.
<hr>
### <a href='https://anilist.co/graphiql'>GraphiQL Interactive Editor</a>

Please post bugs, issues, or help requests here as GitHub issues.
Easily explore and test out GraphQL queries against the AniList API.

Please do not use the AniList forums for developer questions or Api bug reports.
> [!Note]
> Deprecated, try [Apollo Studio](https://studio.apollographql.com/sandbox/explorer?endpoint=https%3A%2F%2Fgraphql.anilist.co) instead.
29 changes: 0 additions & 29 deletions book.json

This file was deleted.

Loading

0 comments on commit aa8e46d

Please sign in to comment.