Skip to content

Commit

Permalink
fix references
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenDittmann committed Sep 28, 2023
1 parent ed13cf5 commit 744466a
Show file tree
Hide file tree
Showing 16 changed files with 91 additions and 15 deletions.
18 changes: 10 additions & 8 deletions src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
const isDocs = window.location.pathname.startsWith('/docs');
if (isDocs) {
const theme = localStorage.getItem('theme');
document.body.classList.remove('theme-dark', 'theme-light');
if (theme === 'system') {
const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches
? 'dark'
: 'light';
document.body.classList.add(`theme-${systemTheme}`);
} else {
document.body.classList.add(`theme-${theme}`);
if (theme) {
document.body.classList.remove('theme-dark', 'theme-light');
if (theme === 'system') {
const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches
? 'dark'
: 'light';
document.body.classList.add(`theme-${systemTheme}`);
} else {
document.body.classList.add(`theme-${theme}`);
}
}
}
</script>
Expand Down
3 changes: 3 additions & 0 deletions src/lib/utils/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ function transform_tokens(tokens: ReturnType<typeof md.parse>): ReturnType<typeo
token.children = transform_tokens(token.children);
}
switch (token.type) {
case 'paragraph_open':
token.attrPush(['class', 'aw-paragraph']);
break;
case 'link_open':
if (token.attrGet('href')?.startsWith('http')) {
token.attrPush(['target', '_blank']);
Expand Down
18 changes: 17 additions & 1 deletion src/lib/utils/specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,22 @@ export async function getApi(version: string, platform: string): Promise<OpenAPI
return api;
}

const descriptions = import.meta.glob(
'/src/routes/docs/references/[version]/[platform]/[service]/descriptions/*.md',
{
as: 'raw'
}
);

export async function getDescription(service: string): Promise<string> {
const target = `/src/routes/docs/references/[version]/[platform]/[service]/descriptions/${service}.md`;

if (!(target in descriptions)) {
throw new Error('Missing service description');
}
return descriptions[target]();
}

export async function getService(
version: string,
platform: string,
Expand All @@ -186,7 +202,7 @@ export async function getService(
const data: Awaited<ReturnType<typeof getService>> = {
service: {
name: tag?.name as Service,
description: tag?.description ?? ''
description: await getDescription(service)
},
methods: []
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,23 @@
<div class="aw-article-content">
<section class="aw-article-content-grid-6-4">
<div class="aw-article-content-grid-6-4-column-1 u-flex-vertical u-gap-32">
<p class="aw-paragraph-md">
{data.service?.description}
</p>
{@html parse(data.service?.description)}
</div>
{#if data.methods.length === 0}
<div class="aw-article-content-grid-6-4-column-2 u-flex-vertical u-gap-32">
<div class="aw-inline-info">
<span class="icon-info" aria-hidden="true" />
<h5 class="aw-sub-body-500 aw-u-color-text-primary">
No endpoint found for this version and platform
</h5>
Please switch to a newer version or different platform.
</div>
</div>
{/if}
</section>
{#each data.methods as method (method.id)}
<section class="aw-article-content-grid-6-4">
<div class="-article-content-grid-6-4-column-1 u-flex-vertical u-gap-32">
<div class="aw-article-content-grid-6-4-column-1 u-flex-vertical u-gap-32">
<header class="aw-article-content-header">
<Heading id={method.id} level={2}>{method.title}</Heading>
</header>
Expand Down Expand Up @@ -254,7 +263,9 @@
<span class="icon-menu-alt-4" aria-hidden="true" />
</button>
<div class="aw-references-menu-content">
<div class="aw-references-menu-header u-flex u-main-space-between u-cross-center u-gap-16 u-margin-block-start-24">
<div
class="aw-references-menu-header u-flex u-main-space-between u-cross-center u-gap-16 u-margin-block-start-24"
>
<h5 class="aw-references-menu-title aw-eyebrow">On This Page</h5>
<button class="aw-icon-button" id="refClose" on:click={toggleReferences}>
<span class="icon-x" aria-hidden="true" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The Account service allows you to authenticate and manage a user account. You can use the account service to update user information, retrieve the user sessions across different devices, and fetch the user security logs with his or her recent activity.

Register new user accounts with the [Create Account](#create), [Create Magic URL session](#createMagicURLSession), or [Create Phone session](#createPhoneSession) endpoint. You can authenticate the user account by using multiple sign-in methods available. Once the user is authenticated, a new session object will be created to allow the user to access his or her private data and settings.

This service also exposes an endpoint to save and read the [user preferences](#updatePrefs) as a key-value object. This feature is handy if you want to allow extra customization in your app. Common usage for this feature may include saving the user's preferred locale, timezone, or custom app theme.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.

The Avatars service allows you to fetch country flags, browser icons, payment methods logos, remote websites favicons, generate QR codes, and manipulate remote image URLs.

All endpoints in this service allow you to resize, crop, and change the output image quality for maximum performance and visibility in your app.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The Databases service allows you to create structured collections of documents, query and filter lists of documents, and manage an advanced set of read and write access permissions.

All data returned by the Databases service are represented as structured JSON documents.

The Databases service can contain multiple databases, each database can contain multiple collections. A collection is a group of similarly structured documents. The accepted structure of documents is defined by [collection attributes](/docs/products/databases/collections#attributes). The collection attributes help you ensure all your user-submitted data is validated and stored according to the collection structure.

Using Appwrite permissions architecture, you can assign read or write access to each collection or document in your project for either a specific user, team, user role, or even grant it with public access (`any`). You can learn more about [how Appwrite handles permissions and access control](/docs/products/databases/permissions).
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The Functions service allows you to create custom behaviour that can be triggered by any supported Appwrite system events or by a predefined schedule.

Appwrite Cloud Functions lets you automatically run backend code in response to events triggered by Appwrite or by setting it to be executed in a predefined schedule. Your code is stored in a secure way on your Appwrite instance and is executed in an isolated environment.

You can learn more by following our [Cloud Functions tutorial](/docs/products/functions).
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The Health service is designed to allow you to both validate and monitor that your Appwrite server instance and all of its internal components are up and responsive.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The Locale service allows you to customize your app based on your users' location. Using this service, you can get your users' location, IP address, list of countries and continents names, phone codes, currencies, and more. Country codes returned follow the [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) standard.

The user service supports multiple locales. This feature allows you to fetch countries and continents information in your app language. To switch locales, all you need to do is pass the 'X-Appwrite-Locale' header or set the 'setLocale' method using any of our available SDKs. [View here the list of available locales](https://github.com/appwrite/appwrite/blob/master/app/config/locale/codes.php).
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The Proxy service allows you to configure behavior for your attached domains. You can use proxy service to create rules that define what is returned on specific domains and subdomains.

Proxy Rules can be configured to serve Appwrite API, which allows you to comply with first-party cookies, making your website more secure. It can also be configured to serve Appwrite Function, which lets you accept incoming webhooks, build custom API endpoints, and serve static files.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The Storage service allows you to manage your project files. Using the Storage service, you can upload, view, download, and query all your project files.

Files are managed using buckets. Storage buckets are similar to Collections we have in our [Databases](/docs/products/databases) service. The difference is, buckets also provide more power to decide what kinds of files, what sizes you want to allow in that bucket, whether or not to encrypt the files, scan with antivirus and more.

Using Appwrite permissions architecture, you can assign read or write access to each bucket or file in your project for either a specific user, team, user role, or even grant it with public access (`any`). You can learn more about [how Appwrite handles permissions and access control](/docs/advanced/platform/permissions).

The preview endpoint allows you to generate preview images for your files. Using the preview endpoint, you can also manipulate the resulting image so that it will fit perfectly inside your app in terms of dimensions, file size, and style. The preview endpoint also allows you to change the resulting image file format for better compression or image quality for better delivery over the network.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

The Teams service allows you to group users of your project and to enable them to share [read and write](/docs/advanced/platform/permissions) access to your project resources, such as database documents or storage files.

Each user who creates a team becomes the team owner and can delegate the ownership role by inviting a new team member. Only team owners can invite new users to their team.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The Users service allows you to manage your project users. Use this service to search, block, and view your users' info, current sessions, and latest activity logs. You can also use the Users service to edit your users' preferences and personal info.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The VCS (Version Control System) service in Appwrite provides a way to interact with VCS providers like Git, GitHub etc. and manage your code repositories. You can use it to install the VCS app or to create, list, and delete repositories. You can also use the VCS service to clone, push, and pull code from your repositories.

The VCS service helps you to either link an existing code repository to your Appwrite Function or to create a new repository from scratch using one of the available templates. If you link a repository to an Appwrite Function, it automatically creates a new deployment when you push changes.
2 changes: 1 addition & 1 deletion src/scss/7-components/_inline-info.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

display:flex; flex-direction:column; gap:pxToRem(8);
padding:pxToRem(16);
[class*="icon"]:first-child { color:hsl(var(--aw-color-primary)); font-size:pxToRem(24)!important; }
[class*="icon"]:first-child { color:hsl(var(--aw-color-primary)); font-size:pxToRem(24)!important; line-height: pxToRem(24)!important; }

#{$theme-dark} & {
--p-inline-info-bg-color: var(--aw-color-white) / 0.04;
Expand Down

0 comments on commit 744466a

Please sign in to comment.