diff --git a/docs-site/content/docs/resources/_index.md b/docs-site/content/docs/resources/_index.md new file mode 100644 index 000000000..e33a73d2d --- /dev/null +++ b/docs-site/content/docs/resources/_index.md @@ -0,0 +1,10 @@ ++++ +title = "Resources" +description = "" +date = 2025-05-01T19:00:00+00:00 +updated = 2021-05-01T19:00:00+00:00 +template = "docs/section.html" +sort_by = "weight" +weight = 30 +draft = false ++++ diff --git a/docs-site/content/docs/resources/faq.md b/docs-site/content/docs/resources/faq.md new file mode 100644 index 000000000..912950639 --- /dev/null +++ b/docs-site/content/docs/resources/faq.md @@ -0,0 +1,59 @@ ++++ +title = "FAQ" +description = "Answers to frequently asked questions." +date = 2021-05-01T19:30:00+00:00 +updated = 2021-05-01T19:30:00+00:00 +draft = false +weight = 30 +sort_by = "weight" +template = "docs/page.html" + +[extra] +toc = true +top = false +flair =[] ++++ + +
+How can I automatically reload code? + +Try [cargo watch](https://crates.io/crates/cargo-watch): + +``` +$ cargo-watch -x check -s 'cargo loco start' +``` + +
+
+
+Do I have to have `cargo` to run tasks or other things? +You don't have to run things through `cargo` but in development it's highly recommended. If you build `--release`, your binary contains everything including your code and `cargo` or Rust is not needed. +
+ +
+ +
+Is this production ready? + +Loco is still in its beginning, but its roots are not. It's almost a rewrite of `Hyperstackjs.io`, and Hyperstack is based on an internal Rails-like framework which is production ready. + +Most of Loco is glue code around Axum, SeaORM, and other stable frameworks, so you can consider that. + +At this stage, at version 0.1.x, we would recommend to _adopt and report issues_ if they arise. + +
+ +
+
+Adding Custom Middleware in Loco +Loco is compatible with Axum middlewares. Simply implement `FromRequestParts` in your custom struct and integrate it within your controller. +
+ +
+ +
+Injecting Custom State or Layers in Loco? +Yes, you can achieve this by implementing `Hooks::after_routes`. This hook receive Axum routers that Loco has already built, allowing you to seamlessly add any available Axum functions that suit your needs. +
+ +
diff --git a/docs-site/content/docs/resources/live-examples.md b/docs-site/content/docs/resources/live-examples.md new file mode 100644 index 000000000..9f4395c9b --- /dev/null +++ b/docs-site/content/docs/resources/live-examples.md @@ -0,0 +1,23 @@ ++++ +title = "Websites" +description = "" +date = 2024-01-21T19:00:00+00:00 +updated = 2024-01-21T19:00:00+00:00 +draft = false +weight = 6 +sort_by = "weight" +template = "docs/page.html" + +[extra] +lead = "" +toc = true +top = false +flair =[] ++++ + + +Explore a compilation of websites along with exemplary Loco implementations on this page. Feel free to contribute by adding additional websites to the list through the submission of a pull request. Your contributions are greatly appreciated! + + +* [Chat rooms](https://github.com/loco-rs/chat-rooms) - With opening a web socket +* [Todo list](https://github.com/loco-rs/todo-list) - working with rest API diff --git a/docs-site/content/docs/the-app/authentication.md b/docs-site/content/docs/the-app/authentication.md new file mode 100644 index 000000000..9deb684e3 --- /dev/null +++ b/docs-site/content/docs/the-app/authentication.md @@ -0,0 +1,260 @@ ++++ +title = "Authentication" +description = "" +date = 2021-05-01T18:20:00+00:00 +updated = 2021-05-01T18:20:00+00:00 +draft = false +weight = 31 +sort_by = "weight" +template = "docs/page.html" + +[extra] +lead = "" +toc = true +top = false +flair =[] ++++ + +## User Password Authentication + +`Loco` simplifies the user authentication process, allowing you to set up a new website quickly. This feature not only saves time but also provides the flexibility to focus on crafting the core logic of your application. + +### Authentication Configuration + +The `auth` feature comes as a default with the library. If desired, you can turn it off and handle authentication manually. + +### Getting Started with a SaaS App + +Create your app using the [loco-cli](/docs/getting-started/tour) and select the `SaaS app (with DB and user auth)` option. + +To explore the out-of-the-box auth controllers, run the following command: + +```sh +$ cargo loco routes + . + . + . +[POST] /api/auth/forgot +[POST] /api/auth/login +[POST] /api/auth/register +[POST] /api/auth/reset +[POST] /api/auth/verify +[GET] /api/user/current + . + . + . +``` + +### Registering a New User + +The `/api/auth/register` endpoint creates a new user in the database with an `email_verification_token` for account verification. A welcome email is sent to the user with a verification link. + +##### Example Curl Request: + +```sh +curl --location '127.0.0.1:3000/api/auth/register' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Loco user", + "email": "user@loco.rs", + "password": "12341234" + }' +``` + +For security reasons, if the user is already registered, no new user is created, and a 200 status is returned without exposing user email details. + +### Login + +After registering a new user, use the following request to log in: + +##### Example Curl Request: + +```sh +curl --location '127.0.0.1:3000/api/auth/login' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@loco.rs", + "password": "12341234" + }' +``` + +The response includes a JWT token for authentication, user ID, name, and verification status. + +```sh +{ + "token": "...", + "pid": "2b20f998-b11e-4aeb-96d7-beca7671abda", + "name": "Loco user", + "is_verified": false +} +``` + +- **Token**: A JWT token enabling requests to authentication endpoints. Refer to the [configuration documentation](@/docs/getting-started/config.md) to customize the default token expiration and ensure that the secret differs between environments. +- **pid** - A unique identifier generated when creating a new user. +- **Name** - The user's name associated with the account. +- **Is Verified** - A flag indicating whether the user has verified their account. + +### Account Verification + +Upon user registration, an email with a verification link is sent. Visiting this link updates the `email_verified_at` field in the database, changing the `is_verified` flag in the login response to true. + +#### Example Curl request: + +```sh +curl --location '127.0.0.1:3000/api/auth/verify' \ + --header 'Content-Type: application/json' \ + --data '{ + "token": "TOKEN" + }' +``` + +### Reset Password Flow + +#### Forgot Password + +The `forgot` endpoint requires only the user's email in the payload. An email is sent with a reset password link, and a `reset_token` is set in the database. + +##### Example Curl request: + +```sh +curl --location '127.0.0.1:3000/api/auth/forgot' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "email": "user@loco.rs" + }' +``` + +#### Reset Password + +To reset the password, send the token generated in the `forgot` endpoint along with the new password. + +##### Example Curl request: + +```sh +curl --location '127.0.0.1:3000/api/auth/reset' \ + --header 'Content-Type: application/json' \ + --data '{ + "token": "TOKEN", + "password": "new-password" + }' +``` + +### Get current user + +This endpoint is protected by auth middleware. + +```sh +curl --location --request GET '127.0.0.1:3000/user/current' \ + --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer TOKEN' +``` + +### Creating an Authenticated Endpoint + +To establish an authenticated endpoint, import `controller::middleware` from the `loco_rs` library and incorporate the auth middleware into the function endpoint parameters. + +Consider the following example in Rust: + +```rust +use axum::{extract::State, Json}; +use loco_rs::{ + app::AppContext, + controller::middleware, + Result, +}; + +async fn current( + auth: middleware::auth::Auth, + State(ctx): State, +) -> Result { + let user = users::Model::find_by_pid(&ctx.db, &auth.claims.pid).await?; + /// Some response +} + +``` + +## API Authentication + +### Creating new app + +For this time, let create your rest app using the [loco-cli](/docs/getting-started/tour) and select the `Rest app` option. +To create new app, run the following command and follow the instructions: + +```sh +$ loco new +``` + +To explore the out-of-the-box auth controllers, run the following command: + +```sh +$ cargo loco routes + . + . + . +[POST] /api/auth/forgot +[POST] /api/auth/login +[POST] /api/auth/register +[POST] /api/auth/reset +[POST] /api/auth/verify +[GET] /api/user/current + . + . + . +``` + +### Registering new user + +The `/api/auth/register` endpoint creates a new user in the database with an `api_key` for request authentication. `api_key` will be used for authentication in the future requests. + +#### Example Curl Request: + +```sh +curl --location '127.0.0.1:3000/api/auth/register' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "name": "Loco user", + "email": "user@loco.rs", + "password": "12341234" + }' +``` + +After registering a new user, make sure you see the `api_key` in the database for the new user. + +### Creating an Authenticated Endpoint with API Authentication + +To set up an API-authenticated endpoint, import `controller::middleware` from the loco_rs library and include the auth middleware in the function endpoint parameters using `middleware::auth::ApiToken`. + +Consider the following example in Rust: + +```rust +use loco_rs::prelude::*; +use loco_rs::controller::middleware; +use crate::{models::_entities::users, views::user::CurrentResponse}; + +async fn current_by_api_key( + auth: middleware::auth::ApiToken, + State(_ctx): State, +) -> Result { + format::json(CurrentResponse::new(&auth.user)) +} + +pub fn routes() -> Routes { + Routes::new() + .prefix("user") + .add("/current-api", get(current_by_api_key)) +} +``` + +### Requesting an API Authenticated Endpoint + +To request an authenticated endpoint, you need to pass the `API_KEY` in the `Authorization` header. + +#### Example Curl Request: + +```sh +curl --location '127.0.0.1:3000/api/user/current-api' \ + --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer API_KEY' +``` + +If the `API_KEY` is valid, you will get the response with the user details. diff --git a/docs-site/content/docs/the-app/channels.md b/docs-site/content/docs/the-app/channels.md new file mode 100644 index 000000000..fa3a62b50 --- /dev/null +++ b/docs-site/content/docs/the-app/channels.md @@ -0,0 +1,87 @@ ++++ +title = "Channels" +description = "" +date = 2024-01-21T18:20:00+00:00 +updated = 2024-01-21T18:20:00+00:00 +draft = false +weight = 32 +sort_by = "weight" +template = "docs/page.html" + +[extra] +lead = "" +toc = true +top = false +flair =[] ++++ + + +`Loco` support opening channels sockets by enable the `channels` feature flag. Socket implementation is based on `socketioxide` [crate](https://crates.io/crates/socketioxide). + + +## How To Configure Channels +Once the `channels` feature is enabled, you need to implement the `register_channels` hook in the `Hooks` of the `app.rs` file. The `register_channels` function should return an `AppChannels` instance, describing all the channels to be registered into Loco. + + + +### Creating Channel Code + +Begin by creating a folder called `channels`. In this folder, create an `application.rs` file, ensuring it is included in the `mod.rs` file. Inside `application.rs`, define the following function: + +```rust +use loco_rs::socketioxide::{ + extract::{AckSender, Bin, Data, SocketRef}, + SocketIo, +}; + +use serde_json::Value; +fn on_connect(socket: SocketRef, Data(data): Data) { + info!("Socket.IO connected: {:?} {:?}", socket.ns(), socket.id); + socket.emit("auth", data).ok(); + + socket.on( + "message", + |socket: SocketRef, Data::(data), Bin(bin)| { + info!("Received event: {:?} {:?}", data, bin); + socket.bin(bin).emit("message-back", data).ok(); + }, + ); + + socket.on( + "message-with-ack", + |Data::(data), ack: AckSender, Bin(bin)| { + info!("Received event: {:?} {:?}", data, bin); + ack.bin(bin).send(data).ok(); + }, + ); + +``` + +Next, register the `on_connect` function in Loco routes. Navigate to `app.rs` and add `register_channels` to the `Hooks` app. After registering the channel, go to the routes hook and add the `AppChannels` instance to `AppRouter`. + +```rust +use crate::channels; +pub struct App; +#[async_trait] +impl Hooks for App { + . + . + . + fn routes(ctx: &AppContext) -> AppRoutes { + AppRoutes::empty() + .prefix("/api") + .add_app_channels(Self::register_channels(ctx)) + } + + fn register_channels(_ctx: &AppContext) -> AppChannels { + let channels = AppChannels::default(); + channels.register.ns("/", channels::application::on_connect); + channels + + } + . + . + . +} +``` +For a simple example of a chat room implementation, refer to this [link](https://github.com/loco-rs/chat-rooms). diff --git a/docs-site/content/docs/the-app/controller.md b/docs-site/content/docs/the-app/controller.md index 0d5cbd7ab..a81e4b3d6 100644 --- a/docs-site/content/docs/the-app/controller.md +++ b/docs-site/content/docs/the-app/controller.md @@ -349,6 +349,7 @@ impl PaginationResponse { } } } +``` # Testing diff --git a/docs-site/static/syntax-theme-dark.css b/docs-site/static/syntax-theme-dark.css new file mode 100644 index 000000000..b694d94e9 --- /dev/null +++ b/docs-site/static/syntax-theme-dark.css @@ -0,0 +1,151 @@ +/* + * theme "OneHalfLight" generated by syntect + */ + +.z-code { + color: #dcdfe4; + background-color: #282c34; +} + +.z-comment { + color: #5c6370; +} +.z-variable.z-parameter.z-function { + color: #dcdfe4; +} +.z-keyword { + color: #c678dd; +} +.z-variable { + color: #e06c75; +} +.z-entity.z-name.z-function, .z-meta.z-require, .z-support.z-function.z-any-method { + color: #61afef; +} +.z-support.z-class, .z-entity.z-name.z-class, .z-entity.z-name.z-type.z-class { + color: #e5c07b; +} +.z-meta.z-class { + color: #e5c07b; +} +.z-keyword.z-other.z-special-method { + color: #61afef; +} +.z-storage { + color: #c678dd; +} +.z-support.z-function { + color: #61afef; +} +.z-string { + color: #98c379; +} +.z-constant.z-numeric { + color: #e5c07b; +} +.z-none { + color: #e5c07b; +} +.z-none { + color: #e5c07b; +} +.z-constant { + color: #e5c07b; +} +.z-entity.z-name.z-tag { + color: #e06c75; +} +.z-entity.z-other.z-attribute-name { + color: #e5c07b; +} +.z-entity.z-other.z-attribute-name.z-id, .z-punctuation.z-definition.z-entity { + color: #e5c07b; +} +.z-meta.z-selector { + color: #c678dd; +} +.z-markup.z-heading .z-punctuation.z-definition.z-heading, .z-entity.z-name.z-section { + color: #61afef; +} +.z-markup.z-bold, .z-punctuation.z-definition.z-bold { + color: #c678dd; +} +.z-markup.z-italic, .z-punctuation.z-definition.z-italic { + color: #c678dd; +} +.z-markup.z-raw.z-inline { + color: #98c379; +} +.z-meta.z-link { + color: #98c379; +} +.z-markup.z-quote { + color: #98c379; +} +.z-source.z-java .z-meta.z-class.z-java .z-meta.z-method.z-java { + color: #dcdfe4; +} +.z-source.z-java .z-meta.z-class.z-java .z-meta.z-class.z-body.z-java { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-function.z-js .z-variable.z-parameter.z-function.z-js { + color: #e06c75; +} +.z-source.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e06c75; +} +.z-source.z-js .z-variable.z-other.z-object.z-js { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e06c75; +} +.z-source.z-js .z-meta.z-block.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e06c75; +} +.z-source.z-js .z-meta.z-block.z-js .z-variable.z-other.z-object.z-js { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-block.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-other.z-readwrite.z-js { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-function.z-js { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-property.z-object.z-js .z-entity.z-name.z-function.z-js { + color: #61afef; +} +.z-source.z-js .z-support.z-constant.z-prototype.z-js { + color: #dcdfe4; +} +.z-markup.z-inserted { + color: #98c379; +} +.z-markup.z-deleted { + color: #e06c75; +} +.z-markup.z-changed { + color: #e5c07b; +} +.z-string.z-regexp { + color: #98c379; +} +.z-constant.z-character.z-escape { + color: #56b6c2; +} +.z-invalid.z-illegal { + color: #dcdfe4; + background-color: #e06c75; +} +.z-invalid.z-broken { + color: #dcdfe4; + background-color: #e5c07b; +} +.z-invalid.z-deprecated { + color: #dcdfe4; + background-color: #e5c07b; +} +.z-invalid.z-unimplemented { + color: #dcdfe4; + background-color: #c678dd; +} diff --git a/docs-site/static/syntax-theme-light.css b/docs-site/static/syntax-theme-light.css new file mode 100644 index 000000000..b6b51639f --- /dev/null +++ b/docs-site/static/syntax-theme-light.css @@ -0,0 +1,151 @@ +/* + * theme "OneHalfLight" generated by syntect + */ + +.z-code { + color: #383a42; + background-color: #fafafa; +} + +.z-comment { + color: #a0a1a7; +} +.z-variable.z-parameter.z-function { + color: #383a42; +} +.z-keyword { + color: #a626a4; +} +.z-variable { + color: #e45649; +} +.z-entity.z-name.z-function, .z-meta.z-require, .z-support.z-function.z-any-method { + color: #0184bc; +} +.z-support.z-class, .z-entity.z-name.z-class, .z-entity.z-name.z-type.z-class { + color: #c18401; +} +.z-meta.z-class { + color: #c18401; +} +.z-keyword.z-other.z-special-method { + color: #0184bc; +} +.z-storage { + color: #a626a4; +} +.z-support.z-function { + color: #0184bc; +} +.z-string { + color: #50a14f; +} +.z-constant.z-numeric { + color: #c18401; +} +.z-none { + color: #c18401; +} +.z-none { + color: #c18401; +} +.z-constant { + color: #c18401; +} +.z-entity.z-name.z-tag { + color: #e45649; +} +.z-entity.z-other.z-attribute-name { + color: #c18401; +} +.z-entity.z-other.z-attribute-name.z-id, .z-punctuation.z-definition.z-entity { + color: #c18401; +} +.z-meta.z-selector { + color: #a626a4; +} +.z-markup.z-heading .z-punctuation.z-definition.z-heading, .z-entity.z-name.z-section { + color: #0184bc; +} +.z-markup.z-bold, .z-punctuation.z-definition.z-bold { + color: #a626a4; +} +.z-markup.z-italic, .z-punctuation.z-definition.z-italic { + color: #a626a4; +} +.z-markup.z-raw.z-inline { + color: #50a14f; +} +.z-meta.z-link { + color: #50a14f; +} +.z-markup.z-quote { + color: #50a14f; +} +.z-source.z-java .z-meta.z-class.z-java .z-meta.z-method.z-java { + color: #383a42; +} +.z-source.z-java .z-meta.z-class.z-java .z-meta.z-class.z-body.z-java { + color: #383a42; +} +.z-source.z-js .z-meta.z-function.z-js .z-variable.z-parameter.z-function.z-js { + color: #e45649; +} +.z-source.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e45649; +} +.z-source.z-js .z-variable.z-other.z-object.z-js { + color: #383a42; +} +.z-source.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e45649; +} +.z-source.z-js .z-meta.z-block.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e45649; +} +.z-source.z-js .z-meta.z-block.z-js .z-variable.z-other.z-object.z-js { + color: #383a42; +} +.z-source.z-js .z-meta.z-block.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-other.z-readwrite.z-js { + color: #383a42; +} +.z-source.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-function.z-js { + color: #383a42; +} +.z-source.z-js .z-meta.z-property.z-object.z-js .z-entity.z-name.z-function.z-js { + color: #0184bc; +} +.z-source.z-js .z-support.z-constant.z-prototype.z-js { + color: #383a42; +} +.z-markup.z-inserted { + color: #98c379; +} +.z-markup.z-deleted { + color: #e06c75; +} +.z-markup.z-changed { + color: #e5c07b; +} +.z-string.z-regexp { + color: #50a14f; +} +.z-constant.z-character.z-escape { + color: #0997b3; +} +.z-invalid.z-illegal { + color: #fafafa; + background-color: #e06c75; +} +.z-invalid.z-broken { + color: #fafafa; + background-color: #e5c07b; +} +.z-invalid.z-deprecated { + color: #fafafa; + background-color: #e5c07b; +} +.z-invalid.z-unimplemented { + color: #fafafa; + background-color: #c678dd; +} diff --git a/docs-site/themes/adidoks/sass/theme/syntax-theme-dark.scss b/docs-site/themes/adidoks/sass/theme/syntax-theme-dark.scss new file mode 100644 index 000000000..89a84a916 --- /dev/null +++ b/docs-site/themes/adidoks/sass/theme/syntax-theme-dark.scss @@ -0,0 +1,154 @@ +/* + * theme "OneHalfLight" generated by syntect + */ + +body.dark { +.z-code { + color: #dcdfe4; + background-color: #282c34; +} + +.z-comment { + color: #5c6370; +} +.z-variable.z-parameter.z-function { + color: #dcdfe4; +} +.z-keyword { + color: #c678dd; +} +.z-variable { + color: #e06c75; +} +.z-entity.z-name.z-function, .z-meta.z-require, .z-support.z-function.z-any-method { + color: #61afef; +} +.z-support.z-class, .z-entity.z-name.z-class, .z-entity.z-name.z-type.z-class { + color: #e5c07b; +} +.z-meta.z-class { + color: #e5c07b; +} +.z-keyword.z-other.z-special-method { + color: #61afef; +} +.z-storage { + color: #c678dd; +} +.z-support.z-function { + color: #61afef; +} +.z-string { + color: #98c379; +} +.z-constant.z-numeric { + color: #e5c07b; +} +.z-none { + color: #e5c07b; +} +.z-none { + color: #e5c07b; +} +.z-constant { + color: #e5c07b; +} +.z-entity.z-name.z-tag { + color: #e06c75; +} +.z-entity.z-other.z-attribute-name { + color: #e5c07b; +} +.z-entity.z-other.z-attribute-name.z-id, .z-punctuation.z-definition.z-entity { + color: #e5c07b; +} +.z-meta.z-selector { + color: #c678dd; +} +.z-markup.z-heading .z-punctuation.z-definition.z-heading, .z-entity.z-name.z-section { + color: #61afef; +} +.z-markup.z-bold, .z-punctuation.z-definition.z-bold { + color: #c678dd; +} +.z-markup.z-italic, .z-punctuation.z-definition.z-italic { + color: #c678dd; +} +.z-markup.z-raw.z-inline { + color: #98c379; +} +.z-meta.z-link { + color: #98c379; +} +.z-markup.z-quote { + color: #98c379; +} +.z-source.z-java .z-meta.z-class.z-java .z-meta.z-method.z-java { + color: #dcdfe4; +} +.z-source.z-java .z-meta.z-class.z-java .z-meta.z-class.z-body.z-java { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-function.z-js .z-variable.z-parameter.z-function.z-js { + color: #e06c75; +} +.z-source.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e06c75; +} +.z-source.z-js .z-variable.z-other.z-object.z-js { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e06c75; +} +.z-source.z-js .z-meta.z-block.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e06c75; +} +.z-source.z-js .z-meta.z-block.z-js .z-variable.z-other.z-object.z-js { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-block.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-other.z-readwrite.z-js { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-function.z-js { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-property.z-object.z-js .z-entity.z-name.z-function.z-js { + color: #61afef; +} +.z-source.z-js .z-support.z-constant.z-prototype.z-js { + color: #dcdfe4; +} +.z-markup.z-inserted { + color: #98c379; +} +.z-markup.z-deleted { + color: #e06c75; +} +.z-markup.z-changed { + color: #e5c07b; +} +.z-string.z-regexp { + color: #98c379; +} +.z-constant.z-character.z-escape { + color: #56b6c2; +} +.z-invalid.z-illegal { + color: #dcdfe4; + background-color: #e06c75; +} +.z-invalid.z-broken { + color: #dcdfe4; + background-color: #e5c07b; +} +.z-invalid.z-deprecated { + color: #dcdfe4; + background-color: #e5c07b; +} +.z-invalid.z-unimplemented { + color: #dcdfe4; + background-color: #c678dd; +} + +} diff --git a/docs-site/themes/adidoks/sass/theme/syntax-theme-light.scss b/docs-site/themes/adidoks/sass/theme/syntax-theme-light.scss new file mode 100644 index 000000000..73d59dee1 --- /dev/null +++ b/docs-site/themes/adidoks/sass/theme/syntax-theme-light.scss @@ -0,0 +1,151 @@ +/* + * theme "OneHalfLight" generated by syntect + */ +.z-code { + color: #383a42; + background-color: #f5f5f8; + border: 1px solid #f0f0f4; +} + +.z-comment { + color: #a0a1a7; +} +.z-variable.z-parameter.z-function { + color: #383a42; +} +.z-keyword { + color: #a626a4; +} +.z-variable { + color: #e45649; +} +.z-entity.z-name.z-function, .z-meta.z-require, .z-support.z-function.z-any-method { + color: #0184bc; +} +.z-support.z-class, .z-entity.z-name.z-class, .z-entity.z-name.z-type.z-class { + color: #c18401; +} +.z-meta.z-class { + color: #c18401; +} +.z-keyword.z-other.z-special-method { + color: #0184bc; +} +.z-storage { + color: #a626a4; +} +.z-support.z-function { + color: #0184bc; +} +.z-string { + color: #50a14f; +} +.z-constant.z-numeric { + color: #c18401; +} +.z-none { + color: #c18401; +} +.z-none { + color: #c18401; +} +.z-constant { + color: #c18401; +} +.z-entity.z-name.z-tag { + color: #e45649; +} +.z-entity.z-other.z-attribute-name { + color: #c18401; +} +.z-entity.z-other.z-attribute-name.z-id, .z-punctuation.z-definition.z-entity { + color: #c18401; +} +.z-meta.z-selector { + color: #a626a4; +} +.z-markup.z-heading .z-punctuation.z-definition.z-heading, .z-entity.z-name.z-section { + color: #0184bc; +} +.z-markup.z-bold, .z-punctuation.z-definition.z-bold { + color: #a626a4; +} +.z-markup.z-italic, .z-punctuation.z-definition.z-italic { + color: #a626a4; +} +.z-markup.z-raw.z-inline { + color: #50a14f; +} +.z-meta.z-link { + color: #50a14f; +} +.z-markup.z-quote { + color: #50a14f; +} +.z-source.z-java .z-meta.z-class.z-java .z-meta.z-method.z-java { + color: #383a42; +} +.z-source.z-java .z-meta.z-class.z-java .z-meta.z-class.z-body.z-java { + color: #383a42; +} +.z-source.z-js .z-meta.z-function.z-js .z-variable.z-parameter.z-function.z-js { + color: #e45649; +} +.z-source.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e45649; +} +.z-source.z-js .z-variable.z-other.z-object.z-js { + color: #383a42; +} +.z-source.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e45649; +} +.z-source.z-js .z-meta.z-block.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e45649; +} +.z-source.z-js .z-meta.z-block.z-js .z-variable.z-other.z-object.z-js { + color: #383a42; +} +.z-source.z-js .z-meta.z-block.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-other.z-readwrite.z-js { + color: #383a42; +} +.z-source.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-function.z-js { + color: #383a42; +} +.z-source.z-js .z-meta.z-property.z-object.z-js .z-entity.z-name.z-function.z-js { + color: #0184bc; +} +.z-source.z-js .z-support.z-constant.z-prototype.z-js { + color: #383a42; +} +.z-markup.z-inserted { + color: #98c379; +} +.z-markup.z-deleted { + color: #e06c75; +} +.z-markup.z-changed { + color: #e5c07b; +} +.z-string.z-regexp { + color: #50a14f; +} +.z-constant.z-character.z-escape { + color: #0997b3; +} +.z-invalid.z-illegal { + color: #fafafa; + background-color: #e06c75; +} +.z-invalid.z-broken { + color: #fafafa; + background-color: #e5c07b; +} +.z-invalid.z-deprecated { + color: #fafafa; + background-color: #e5c07b; +} +.z-invalid.z-unimplemented { + color: #fafafa; + background-color: #c678dd; +} diff --git a/docs-site/themes/adidoks/static/syntax-theme-dark.css b/docs-site/themes/adidoks/static/syntax-theme-dark.css new file mode 100644 index 000000000..b694d94e9 --- /dev/null +++ b/docs-site/themes/adidoks/static/syntax-theme-dark.css @@ -0,0 +1,151 @@ +/* + * theme "OneHalfLight" generated by syntect + */ + +.z-code { + color: #dcdfe4; + background-color: #282c34; +} + +.z-comment { + color: #5c6370; +} +.z-variable.z-parameter.z-function { + color: #dcdfe4; +} +.z-keyword { + color: #c678dd; +} +.z-variable { + color: #e06c75; +} +.z-entity.z-name.z-function, .z-meta.z-require, .z-support.z-function.z-any-method { + color: #61afef; +} +.z-support.z-class, .z-entity.z-name.z-class, .z-entity.z-name.z-type.z-class { + color: #e5c07b; +} +.z-meta.z-class { + color: #e5c07b; +} +.z-keyword.z-other.z-special-method { + color: #61afef; +} +.z-storage { + color: #c678dd; +} +.z-support.z-function { + color: #61afef; +} +.z-string { + color: #98c379; +} +.z-constant.z-numeric { + color: #e5c07b; +} +.z-none { + color: #e5c07b; +} +.z-none { + color: #e5c07b; +} +.z-constant { + color: #e5c07b; +} +.z-entity.z-name.z-tag { + color: #e06c75; +} +.z-entity.z-other.z-attribute-name { + color: #e5c07b; +} +.z-entity.z-other.z-attribute-name.z-id, .z-punctuation.z-definition.z-entity { + color: #e5c07b; +} +.z-meta.z-selector { + color: #c678dd; +} +.z-markup.z-heading .z-punctuation.z-definition.z-heading, .z-entity.z-name.z-section { + color: #61afef; +} +.z-markup.z-bold, .z-punctuation.z-definition.z-bold { + color: #c678dd; +} +.z-markup.z-italic, .z-punctuation.z-definition.z-italic { + color: #c678dd; +} +.z-markup.z-raw.z-inline { + color: #98c379; +} +.z-meta.z-link { + color: #98c379; +} +.z-markup.z-quote { + color: #98c379; +} +.z-source.z-java .z-meta.z-class.z-java .z-meta.z-method.z-java { + color: #dcdfe4; +} +.z-source.z-java .z-meta.z-class.z-java .z-meta.z-class.z-body.z-java { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-function.z-js .z-variable.z-parameter.z-function.z-js { + color: #e06c75; +} +.z-source.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e06c75; +} +.z-source.z-js .z-variable.z-other.z-object.z-js { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e06c75; +} +.z-source.z-js .z-meta.z-block.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e06c75; +} +.z-source.z-js .z-meta.z-block.z-js .z-variable.z-other.z-object.z-js { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-block.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-other.z-readwrite.z-js { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-function.z-js { + color: #dcdfe4; +} +.z-source.z-js .z-meta.z-property.z-object.z-js .z-entity.z-name.z-function.z-js { + color: #61afef; +} +.z-source.z-js .z-support.z-constant.z-prototype.z-js { + color: #dcdfe4; +} +.z-markup.z-inserted { + color: #98c379; +} +.z-markup.z-deleted { + color: #e06c75; +} +.z-markup.z-changed { + color: #e5c07b; +} +.z-string.z-regexp { + color: #98c379; +} +.z-constant.z-character.z-escape { + color: #56b6c2; +} +.z-invalid.z-illegal { + color: #dcdfe4; + background-color: #e06c75; +} +.z-invalid.z-broken { + color: #dcdfe4; + background-color: #e5c07b; +} +.z-invalid.z-deprecated { + color: #dcdfe4; + background-color: #e5c07b; +} +.z-invalid.z-unimplemented { + color: #dcdfe4; + background-color: #c678dd; +} diff --git a/docs-site/themes/adidoks/static/syntax-theme-light.css b/docs-site/themes/adidoks/static/syntax-theme-light.css new file mode 100644 index 000000000..b6b51639f --- /dev/null +++ b/docs-site/themes/adidoks/static/syntax-theme-light.css @@ -0,0 +1,151 @@ +/* + * theme "OneHalfLight" generated by syntect + */ + +.z-code { + color: #383a42; + background-color: #fafafa; +} + +.z-comment { + color: #a0a1a7; +} +.z-variable.z-parameter.z-function { + color: #383a42; +} +.z-keyword { + color: #a626a4; +} +.z-variable { + color: #e45649; +} +.z-entity.z-name.z-function, .z-meta.z-require, .z-support.z-function.z-any-method { + color: #0184bc; +} +.z-support.z-class, .z-entity.z-name.z-class, .z-entity.z-name.z-type.z-class { + color: #c18401; +} +.z-meta.z-class { + color: #c18401; +} +.z-keyword.z-other.z-special-method { + color: #0184bc; +} +.z-storage { + color: #a626a4; +} +.z-support.z-function { + color: #0184bc; +} +.z-string { + color: #50a14f; +} +.z-constant.z-numeric { + color: #c18401; +} +.z-none { + color: #c18401; +} +.z-none { + color: #c18401; +} +.z-constant { + color: #c18401; +} +.z-entity.z-name.z-tag { + color: #e45649; +} +.z-entity.z-other.z-attribute-name { + color: #c18401; +} +.z-entity.z-other.z-attribute-name.z-id, .z-punctuation.z-definition.z-entity { + color: #c18401; +} +.z-meta.z-selector { + color: #a626a4; +} +.z-markup.z-heading .z-punctuation.z-definition.z-heading, .z-entity.z-name.z-section { + color: #0184bc; +} +.z-markup.z-bold, .z-punctuation.z-definition.z-bold { + color: #a626a4; +} +.z-markup.z-italic, .z-punctuation.z-definition.z-italic { + color: #a626a4; +} +.z-markup.z-raw.z-inline { + color: #50a14f; +} +.z-meta.z-link { + color: #50a14f; +} +.z-markup.z-quote { + color: #50a14f; +} +.z-source.z-java .z-meta.z-class.z-java .z-meta.z-method.z-java { + color: #383a42; +} +.z-source.z-java .z-meta.z-class.z-java .z-meta.z-class.z-body.z-java { + color: #383a42; +} +.z-source.z-js .z-meta.z-function.z-js .z-variable.z-parameter.z-function.z-js { + color: #e45649; +} +.z-source.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e45649; +} +.z-source.z-js .z-variable.z-other.z-object.z-js { + color: #383a42; +} +.z-source.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e45649; +} +.z-source.z-js .z-meta.z-block.z-js .z-variable.z-other.z-readwrite.z-js { + color: #e45649; +} +.z-source.z-js .z-meta.z-block.z-js .z-variable.z-other.z-object.z-js { + color: #383a42; +} +.z-source.z-js .z-meta.z-block.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-other.z-readwrite.z-js { + color: #383a42; +} +.z-source.z-js .z-meta.z-function-call.z-method.z-js .z-variable.z-function.z-js { + color: #383a42; +} +.z-source.z-js .z-meta.z-property.z-object.z-js .z-entity.z-name.z-function.z-js { + color: #0184bc; +} +.z-source.z-js .z-support.z-constant.z-prototype.z-js { + color: #383a42; +} +.z-markup.z-inserted { + color: #98c379; +} +.z-markup.z-deleted { + color: #e06c75; +} +.z-markup.z-changed { + color: #e5c07b; +} +.z-string.z-regexp { + color: #50a14f; +} +.z-constant.z-character.z-escape { + color: #0997b3; +} +.z-invalid.z-illegal { + color: #fafafa; + background-color: #e06c75; +} +.z-invalid.z-broken { + color: #fafafa; + background-color: #e5c07b; +} +.z-invalid.z-deprecated { + color: #fafafa; + background-color: #e5c07b; +} +.z-invalid.z-unimplemented { + color: #fafafa; + background-color: #c678dd; +}