diff --git a/src/app.html b/src/app.html index 59ec69c4f0..36b4ad69ca 100644 --- a/src/app.html +++ b/src/app.html @@ -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}`); + } } } diff --git a/src/lib/utils/markdown.ts b/src/lib/utils/markdown.ts index 79c313c6a5..93f4d939bc 100644 --- a/src/lib/utils/markdown.ts +++ b/src/lib/utils/markdown.ts @@ -19,6 +19,9 @@ function transform_tokens(tokens: ReturnType): ReturnType { + 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, @@ -186,7 +202,7 @@ export async function getService( const data: Awaited> = { service: { name: tag?.name as Service, - description: tag?.description ?? '' + description: await getDescription(service) }, methods: [] }; diff --git a/src/routes/docs/references/[version]/[platform]/[service]/+page.svelte b/src/routes/docs/references/[version]/[platform]/[service]/+page.svelte index 4c2089cde5..be6aa8c314 100644 --- a/src/routes/docs/references/[version]/[platform]/[service]/+page.svelte +++ b/src/routes/docs/references/[version]/[platform]/[service]/+page.svelte @@ -133,14 +133,23 @@ - - {data.service?.description} - + {@html parse(data.service?.description)} + {#if data.methods.length === 0} + + + + + No endpoint found for this version and platform + + Please switch to a newer version or different platform. + + + {/if} {#each data.methods as method (method.id)} - + {method.title} @@ -254,7 +263,9 @@ - + On This Page diff --git a/src/routes/docs/references/[version]/[platform]/[service]/descriptions/account.md b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/account.md new file mode 100644 index 0000000000..6818115fd1 --- /dev/null +++ b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/account.md @@ -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. diff --git a/src/routes/docs/references/[version]/[platform]/[service]/descriptions/avatars.md b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/avatars.md new file mode 100644 index 0000000000..3d382b8355 --- /dev/null +++ b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/avatars.md @@ -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. diff --git a/src/routes/docs/references/[version]/[platform]/[service]/descriptions/databases.md b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/databases.md new file mode 100644 index 0000000000..c875d8a4be --- /dev/null +++ b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/databases.md @@ -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). \ No newline at end of file diff --git a/src/routes/docs/references/[version]/[platform]/[service]/descriptions/functions.md b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/functions.md new file mode 100644 index 0000000000..5003550f03 --- /dev/null +++ b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/functions.md @@ -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). \ No newline at end of file diff --git a/src/routes/docs/references/[version]/[platform]/[service]/descriptions/health.md b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/health.md new file mode 100644 index 0000000000..1edaf156d8 --- /dev/null +++ b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/health.md @@ -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. \ No newline at end of file diff --git a/src/routes/docs/references/[version]/[platform]/[service]/descriptions/locale.md b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/locale.md new file mode 100644 index 0000000000..d9a1c38d2d --- /dev/null +++ b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/locale.md @@ -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). diff --git a/src/routes/docs/references/[version]/[platform]/[service]/descriptions/proxy.md b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/proxy.md new file mode 100644 index 0000000000..ebf189595a --- /dev/null +++ b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/proxy.md @@ -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. \ No newline at end of file diff --git a/src/routes/docs/references/[version]/[platform]/[service]/descriptions/storage.md b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/storage.md new file mode 100644 index 0000000000..893127d31a --- /dev/null +++ b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/storage.md @@ -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. diff --git a/src/routes/docs/references/[version]/[platform]/[service]/descriptions/teams.md b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/teams.md new file mode 100644 index 0000000000..9c5341746d --- /dev/null +++ b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/teams.md @@ -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. \ No newline at end of file diff --git a/src/routes/docs/references/[version]/[platform]/[service]/descriptions/users.md b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/users.md new file mode 100644 index 0000000000..17b848de58 --- /dev/null +++ b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/users.md @@ -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. diff --git a/src/routes/docs/references/[version]/[platform]/[service]/descriptions/vcs.md b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/vcs.md new file mode 100644 index 0000000000..db8cbfdd99 --- /dev/null +++ b/src/routes/docs/references/[version]/[platform]/[service]/descriptions/vcs.md @@ -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. diff --git a/src/scss/7-components/_inline-info.scss b/src/scss/7-components/_inline-info.scss index 7acc0409a9..9eb7d4c178 100644 --- a/src/scss/7-components/_inline-info.scss +++ b/src/scss/7-components/_inline-info.scss @@ -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;
- {data.service?.description} -