diff --git a/manual/COMMANDS.md b/manual/COMMANDS.md new file mode 100644 index 0000000..76d44fa --- /dev/null +++ b/manual/COMMANDS.md @@ -0,0 +1,484 @@ +# COMMANDS + +A WIP list of commands... + + +core commands: + + # PMDM + + # Stage 1 + !core-add ITEM: + Add ITEM to PMDM + !core-add-one ITEM: + Add one ITEM to PMDM + !core-remove-held: + Remove held items + !core-hold SLOT: + Perform HOLD/DROP action on SLOT + !core-unhold: + Perform UNHOLD + !core-equip SLOT: + Perform EQUIP action on SLOT + !core-unequip SLOT: + Perform UNEQUIP action on SLOT + + # Stage 2 + !core-eat-once SLOT: + Perform EAT action on SLOT once + !core-sell SLOT: + Perform SELL action on SLOT + !core-use-weapon: + Use the weapon + !core-use-shield: + Use the shield + !core-shoot-arrow: + Use the bow to shoow an arrow + !core-sync-gdt: + Sync PMDM to GDT + + # Stage 3 + !core-check-can-cook: + Check if the player can cook (inventory space) + !core-check-can-add ITEM: + Check if ITEM can be added to inventory + !core-check-has ITEM: + Check if ITEM currently exists in inventory + !core-check-can-remove ITEM: + Check if ITEM can be removed from inventory + !core-check-can-access-inventory: + Check if the player can access the inventory (mCount != 0) + + !core-sort TAB_INDEX: + Perform SORT while on TAB_INDEX + !core-set-gdt FLAG VALUE: + Set GDT FLAG to VALUE + + + + extra: + set_state() (many setter methods...) + get_state() (many getter methods...) + + +runtime: + inventory (core) + overworld: + equipped + dropped + saves + features: + strict-mode: + Disallow deprecated actions implemented by runtime instead of the core + core-check-can-cook: + checks if the player has enough inventory space to cook + default: true + core-check-can-add + core-check-can-remove + core-check-can-access-inventory + area-check: + checks if the current area has the items + default: false, unless (area) + area-check-shop: + checks if the current area has a shop + default: false, unless (area) + area-check-shop-buy: + checks if the current area has a shop that sells the items + default: false, unless (area) + area-check-cook + checks if the current area has a cooking pot + default: false, unless (area) + ovwd-check-dropped: + checks if the overworld has the items + default: true + ovwd-auto-despawn-drop-limit: + automatically despawn dropped items over 10 + default: true + + sellable-check: + check if item is sellable for SELL actions + edible-check: + check if item is edible for EAT actions + holdable-check: + check if item is holdable for HOLD actions + holdable-check-limit: + check if there's room to hold item + +annotations: + global: + // I guess these are technically features? + (FEATURE) + Enable Feature + (no-FEATURE) + Disable Feature + (menu-overload) + Start menu overload + (no-menu-overload) + Stop menu overload + (drop-after-dialog) + Make holding items drop when dialog scope deactivates, instead of when inventory scope deactivates + (Effect triggers only once) + (drop-bomb-arrow) + Make bomb arrows drop on ground after shooting them (i.e. rain) + (no-drop-bomb-arrow) + Stop bomb arrows from dropping on ground after shooting them + + // other + (obtained PROGRESSION_FLAG) + Set PROGRESSION_FLAG (calls !core-set-gdt interally) + (group) { + (note) NOTES; + COMMANDS + } + Group commands to be one action in view mode + (note) NOTES + Set notes for the next command/action + // comment + # comment + (area) AREA { + AREA_ANOTATIONS + } + Declare an area + + (autoist) { + AUTOIST_ANOTATIONS + } + Declare Auto IST + + area: + (has) ITEMS: + args: + ITEMS: ItemListInfinityForAdd + (sells) ITEMS: + (has-statue) + (has-pot) + (has-fire) + Allow roasting without your own fire + (freezing) + Items on the ground can freeze by themselves, allowing freeze without your own ice + (has-hot-spring) + Eggs can be boiled + (time-from) AREA X; + + + + + + + +rtcommands: + !requires-not-strict: + Error if strict-mode is enabled + !area-check ITEMS: + Check current area has ITEMS + !area-deduct ITEMS: + Remove ITEMS from current area + !area-check-shop-buy ITEMS: + Check current area has shop that sells ITEMS + !area-deduct-shop ITEMS: + Remove ITEMS from shops in current area + !area-check-shop: + Check can sell in current area + !area-check-cook: + Check current area has a cooking pot + !area-check-statue: + Check current area has a goddess statue + !area-check-hot-spring: + Check current area has a hot spring + !area-check-freezing: + Check current area is freezing + + !ovwd-check-dropped ITEMS: + Check if ITEMS are currently dropped in the overworld + !edible-check ITEM: + Check if ITEM is edible + !sellable-check ITEM: + Check if ITEM is sellable + !ovwd-remove ITEM: + Remove ITEM from the overworld + !ovwd-hold ITEM: + Schedule HOLD in overworld + !ovwd-unhold: + Schedule Unhold items in the overworld, or unhold immediately + !ovwd-equip- ITEM: + Schedule Switch to ITEM in the overworld + !ovwd-unequip-: + Schedule Unequip in the overworld + !ovwd-drop-: + Schedule Drop equipment in the overworld + !ovwd-reset: + Reset the overworld items + + !trade: + Trade 1 heart or stamina + + !auto-scope SCOPE: + Attempt to automatically adjust the scope + + !go AREA: + Go to an area + + +actions: + # add + get ITEMS: + args: + ITEMS: ItemListForAdd + cmds: + - !auto-scope game not-paused + - !area-check ITEMS + - !area-deduct ITEMS + - loop ITEM in ITEMS: + !core-add ITEM + buy ITEMS: + args: + ITEMS: ItemListForAdd + cmds: + - !auto-scope game dialog + - !area-check-shop-buy ITEMS + - !area-deduct-shop ITEMS + - loop ITEM in ITEMS: + !core-add ITEM + pick-up ITEMS: + args: + ITEMS: ItemListForRemove + cmds: + - !ovwd-check-dropped ITEMS + - !ovwd-remove ITEMS + - loop ITEM in ITEMS: + loop item amount + !core-add-one ITEM + cook ITEMS: (deprecated) + args: + ITEMS: ItemListForAdd + cmds: + - add ITEMS + cook: + cmds: + - (feature check-area-cook) !area-check-cook + - (feature core-check-can-cook) !core-check-can-cook + - !auto-scope game not-paused + - + - !core-remove-held + - !core-add-one COOKED_ITEM + cook-with ITEMS: + args: + ITEMS: ItemListForRemove + cmds: + - hold ITEMS + - cook + + # Remove + drop: + cmds: + - !auto-scope game not-paused + - !ovwd-unhold + - !ovwd-add HELD_ITEMS + - !core-remove-held + drop ITEMS: + put-aside ITEMS: + args: + ITEMS: ItemListForRemove + cmds: + - loop ITEM in ITEMS: + if ITEM is droppable: + !core-hold SLOT + !ovwd-drop- + else: + hold ITEM + drop + + eat ITEMS: + args: + ITEMS: ItemListForRemove + cmds: + - !auto-scope game inventory + - loop SLOT in ITEMS: + loop item amount + !core-eat-once SLOT + + sell ITEMS: + args: + ITEMS: ItemListForRemove + cmds: + - !auto-scope game dialog + - loop ITEM in ITEMS: + !sellable-check ITEM + - !area-check-shop + - loop SLOT in ITEMS: + !core-sell SLOT + + trade X hearts: + trade X stamina: + cmds: + - !auto-scope game dialog + - !area-check-statue + - loop X: + !trade X + + + + remove ITEMS: (deprecated) + with ITEMS: + args: + ITEMS: ItemListForRemove + - !requires-non-strict + - !auto-scope game inventory + - + + # holding + hold ITEMS: + args: + ITEMS: ItemListForRemove + cmds: + - !auto-scope game inventory + - loop SLOT in ITEMS: + !holdable-check SLOT + !holdable-check-limit SLOT + !core-hold SLOT + if not overload: !ovwd-hold ITEM + unhold: + put-away: + cmds: + - !auto-scope game + - !ovwd-unhold + - !core-unhold + dnp ITEMS: + cmds: + - drop ITEMS + - pick-up ITEMS + + # equipment + equip ITEM: + args: + ITEM: ItemForRemove + cmds: + - !auto-scope game inventory + - !core-equip SLOT + - if not overload: !ovwd-equip- ITEM + unequip ITEM: + args: + ITEM: ItemForRemove + cmds: + - !auto-scope game inventory + - !core-unequip SLOT + - if not overload: !ovwd-unequip- ITEM + + unequip-the TYPE: + args: + TYPE: EquipmentType + cmds: + - !auto-scope game inventory + - !core-unequip SLOT + - if not overload: !ovwd-unequip- + + shoot-arrow X: + cmds: + - !auto-scope game not-paused + - loop X: + !core-shoot-arrow + if normal/ancient or allow drop bomb arrow: + !ovwd-add ARROW_TYPE + + use-weapon X: + cmds: + - !auto-scope game not-paused + - loop X: + !core-use-weapon + use-shield X: + cmds: + - !auto-scope game not-paused + - loop X: + !core-use-shield + + # sorting + sort TAB: + cmds: + - !auto-scope game inventory + - !core-sort TAB_INDEX + + # prompt entanglement + entangle TAB: + cmds: + - !entangle TAB + + # savefiles + save: + cmds: + - !auto-scope game inventory + - !save + + save-as NAME: + cmds: + - !auto-scope game inventory + - !save NAME + + reload: + cmds: + - !auto-scope game inventory + - !reload SAVE # note: will change scope to game + - !ovwd-reset + reload SAVE: + cmds: + - !auto-scope game inventory + - !reload-auto SAVE + - !ovwd-reset + + new-game: + cmds: + - !new-game + + close-game: + - !close-game + + # overworld + roast ITEMS: + bake ITEMS: + args: + ITEMS: ItemListForRemove + cmds: + - !auto-scope game not-paused + - !ovwd-check-dropped ITEMS + - loop ITEM in ITEMS: + !ovwd-remove ITEM + !ovwd-add ROASTED_ITEM + boil ITEMS: + args: + ITEMS: ItemListForRemove + cmds: + - !auto-scope game not-paused + - !ovwd-check-dropped ITEMS + - loop ITEM in ITEMS: + !ovwd-remove ITEM + !ovwd-add ROASTED_ITEM + + freeze ITEMS: + args: + ITEMS: ItemListForRemove + cmds: + - !auto-scope game not-paused + - !ovwd-check-dropped ITEMS + - loop ITEM in ITEMS: + !ovwd-remove ITEM + !ovwd-add FROZEN_ITEM + + go-to AREA: + cmds: + - !ovwd-reset + - !go AREA + + # other + !break-slot X: + cmds: + - !requires-non-strict + - loop X: + + + +break slot will be like +``` +hold 1 apple 1 orange +(drop-after-dialog) +sell 1 apple 1 orange + +``` diff --git a/manual/ITEM_PARSE.md b/manual/ITEM_PARSE.md new file mode 100644 index 0000000..de7bab6 --- /dev/null +++ b/manual/ITEM_PARSE.md @@ -0,0 +1,25 @@ +Item specifier: + +``` +ItemListForAdd -> NumberedItem+ +ItemListForRemove -> AllableItem+ +ItemListForArea -> InfableItem+ +NumberedItem -> NUMBER Item +InfableItem -> NumOrInf Item +AllableItem -> NumOrAll Item +NumOrInf -> NUMBER | "infinite" +NumOrAll -> NUMBER | "all" +Item -> ItemName ItemMeta? +ItemMeta -> [ ItemMetaEntry (OpComma ItemMetaEntry)* ] +ItemMetaEntry -> ItemMetaKey (OpAssign ItemMetaValue)? +ItemMetaKey -> WORD +ItemMetaValue -> WORD | NUMBER | BOOL +ItemName -> WORD+ | < WORD > + +ItemSlot -> ( OpSlotSpec "slot" NUMBER ) + +OpSlotSpec -> "from" | "in" | "to" + +OpAssign -> = | : +OpComma -> , +``` diff --git a/manual/Taskfile.yml b/manual/Taskfile.yml index 872f415..118a934 100644 --- a/manual/Taskfile.yml +++ b/manual/Taskfile.yml @@ -6,7 +6,7 @@ tasks: cmds: - task: build - mdbook watch & - - live-server book -p 8081 + - live-server book -p 8081 {{.CLI_ARGS}} build: desc: (Re-)build the book diff --git a/manual/book.toml b/manual/book.toml index e2a58b3..5910344 100644 --- a/manual/book.toml +++ b/manual/book.toml @@ -1,5 +1,4 @@ [book] - authors = ["Pistonight"] language = "en" multilingual = false @@ -8,5 +7,18 @@ title = "The IST Simulator Manual" [output.html] site-url = "/manual/" +default-theme = "frappe" +preferred-dark-theme = "frappe" smart-punctuation = true git-repository-url = "https://github.com/Pistonite/botw-ist" +additional-css = [ + "./theme/mdbook-admonish.css", + "./theme/catppuccin.css", + "./theme/catppuccin-admonish.css" +] + +[preprocessor] + +[preprocessor.admonish] +command = "mdbook-admonish" +assets_version = "3.0.2" # do not edit: managed by `mdbook-admonish install` diff --git a/manual/src/SUMMARY.md b/manual/src/SUMMARY.md index 7390c82..16c8af3 100644 --- a/manual/src/SUMMARY.md +++ b/manual/src/SUMMARY.md @@ -1,3 +1,10 @@ # Summary - [Chapter 1](./chapter_1.md) +- [Scopes](./scope.md) + - [Game Scope]() + - [Inventory Scope]() + - [Dialog Scope]() +- [Actions](./action.md) + - [`get`](./action/get.md) +- [Commands]() diff --git a/manual/src/action.md b/manual/src/action.md new file mode 100644 index 0000000..b8c5de7 --- /dev/null +++ b/manual/src/action.md @@ -0,0 +1,3 @@ +# Actions + +Actions map to actions you can do in the game diff --git a/manual/src/action/get.md b/manual/src/action/get.md new file mode 100644 index 0000000..7e7341d --- /dev/null +++ b/manual/src/action/get.md @@ -0,0 +1,6 @@ +# Get + +## Syntax +``` + +``` diff --git a/manual/src/chapter_1.md b/manual/src/chapter_1.md index 05879d4..e4f067d 100644 --- a/manual/src/chapter_1.md +++ b/manual/src/chapter_1.md @@ -1,3 +1,50 @@ # Chapter 1 This is a placeholder... +Test 2 3 4 5 6 7 8 9 10 + +```rust +fn main() { + println!("Hello, World!"); +} +``` + +```admonish info +Test +``` + +```admonish note +Test +``` + +```admonish warning +Test +``` + +```admonish danger +Test +``` + +```admonish tip +Test +``` + +```admonish important +Test +``` + +```admonish caution +Test +``` + +```admonish error +Test +``` + +```admonish hint +Test +``` + +```admonish attention +Test +``` diff --git a/manual/src/scope.md b/manual/src/scope.md new file mode 100644 index 0000000..fef61aa --- /dev/null +++ b/manual/src/scope.md @@ -0,0 +1,97 @@ +# Scopes + +Scope is a concept that the simulator runtime uses to enforce +the validity of the setup, and automatically update +different parts of the simulation. For example: + +- You cannot use an item while talking to a NPC +- GDT Inventory is synced when closing inventory +- If the game crashes, you can't do anything until you restart it + +Currently, there are three scopes in the simulator: +- Game Scope: The game is running, and the player has control of Link +- Inventory Scope: The player is looking at the inventory (pressed `+`) +- Dialog Scope: The player doesn't have control of Link (for example, talking to an NPC) + +## Automatic Scope Management +For the most part, scopes are managed automatically by the simulator runtime +based on the command, so you don't have to worry about them. + +For example, +consider the following script + +``` +get 1 apple +eat 1 apple +get 1 wood +``` + +At first, the simulation state is not in any scope. +To get an item, you must have control of Link, so the `get` action requires `game, !paused` scope, so the simulator automatically +activate the `game` scope by starting a new game. + +The next `eat` action requires `game, inventory` scope because you need +to be in the inventory to eat an item. The simulator infers +that you want to pause the game to eat the item, so it automatically +activates the `inventory` scope. + +Finally, the last `get` action requires the game to be not paused, +so the simulator automatically deactivates the `inventory` scope to allow +the action to be performed. + +## Manual Scope Management +Certain actions like `pause` can be used to change the scope manually. +When the scope is activated manually, the simulator will not automatically +change the scope until the manual scope is deactivated. + +For example, consider the following script, which is the same as above except +that it manually pauses the game before `eat` +``` +get 1 apple +pause +eat 1 apple +get 1 wood # Error! +``` + +Now the simulator will not automatically deactivate the `inventory` scope +for `get 1 wood`. Instead, it will give an error saying you cannot get new +item while paused. + +## Scope Conflict +Another error that the scope system checks for is conflicting scopes. +For example, you cannot access inventory while talking to an NPC. +This is implemented by you cannot activate `inventory` scope +while the `dialog` scope is active. + +The following script is valid: +``` +sell 1 apple +eat 1 apple +``` +Here, `sell` activates the `dialog` scope, and `eat` deactivates it to +activate the `inventory` scope. + +However, if you manually activate the `inventory` scope before `sell`, +you will have an error because the `dialog` scope cannot be automatically +activated while `inventory` scope is in use. + +``` +talk-to shopkeeper +sell 1 apple +eat 1 apple # Error! +``` + +## Crashes +Most commands require the `game` scope, which can be automatically activated. +The only exception is when the game crashes. In this case, you must +manually activate the `game` scope with an action like `new-game` or `reload` + +## Testing +Scope can be tested using the `!assert-scope` command. The special `not-paused` +keyword can be used to test that `game` is the top-level scope + +``` +!assert-scope game +!assert-scope inventory +!assert-scope game not-paused +``` diff --git a/manual/theme/book.js b/manual/theme/book.js new file mode 100644 index 0000000..d9d9291 --- /dev/null +++ b/manual/theme/book.js @@ -0,0 +1,701 @@ +"use strict"; + +// Fix back button cache problem +window.onunload = function () { }; + +// Global variable, shared between modules +function playground_text(playground, hidden = true) { + let code_block = playground.querySelector("code"); + + if (window.ace && code_block.classList.contains("editable")) { + let editor = window.ace.edit(code_block); + return editor.getValue(); + } else if (hidden) { + return code_block.textContent; + } else { + return code_block.innerText; + } +} + +(function codeSnippets() { + function fetch_with_timeout(url, options, timeout = 6000) { + return Promise.race([ + fetch(url, options), + new Promise((_, reject) => setTimeout(() => reject(new Error('timeout')), timeout)) + ]); + } + + var playgrounds = Array.from(document.querySelectorAll(".playground")); + if (playgrounds.length > 0) { + fetch_with_timeout("https://play.rust-lang.org/meta/crates", { + headers: { + 'Content-Type': "application/json", + }, + method: 'POST', + mode: 'cors', + }) + .then(response => response.json()) + .then(response => { + // get list of crates available in the rust playground + let playground_crates = response.crates.map(item => item["id"]); + playgrounds.forEach(block => handle_crate_list_update(block, playground_crates)); + }); + } + + function handle_crate_list_update(playground_block, playground_crates) { + // update the play buttons after receiving the response + update_play_button(playground_block, playground_crates); + + // and install on change listener to dynamically update ACE editors + if (window.ace) { + let code_block = playground_block.querySelector("code"); + if (code_block.classList.contains("editable")) { + let editor = window.ace.edit(code_block); + editor.addEventListener("change", function (e) { + update_play_button(playground_block, playground_crates); + }); + // add Ctrl-Enter command to execute rust code + editor.commands.addCommand({ + name: "run", + bindKey: { + win: "Ctrl-Enter", + mac: "Ctrl-Enter" + }, + exec: _editor => run_rust_code(playground_block) + }); + } + } + } + + // updates the visibility of play button based on `no_run` class and + // used crates vs ones available on https://play.rust-lang.org + function update_play_button(pre_block, playground_crates) { + var play_button = pre_block.querySelector(".play-button"); + + // skip if code is `no_run` + if (pre_block.querySelector('code').classList.contains("no_run")) { + play_button.classList.add("hidden"); + return; + } + + // get list of `extern crate`'s from snippet + var txt = playground_text(pre_block); + var re = /extern\s+crate\s+([a-zA-Z_0-9]+)\s*;/g; + var snippet_crates = []; + var item; + while (item = re.exec(txt)) { + snippet_crates.push(item[1]); + } + + // check if all used crates are available on play.rust-lang.org + var all_available = snippet_crates.every(function (elem) { + return playground_crates.indexOf(elem) > -1; + }); + + if (all_available) { + play_button.classList.remove("hidden"); + } else { + play_button.classList.add("hidden"); + } + } + + function run_rust_code(code_block) { + var result_block = code_block.querySelector(".result"); + if (!result_block) { + result_block = document.createElement('code'); + result_block.className = 'result hljs language-bash'; + + code_block.append(result_block); + } + + let text = playground_text(code_block); + let classes = code_block.querySelector('code').classList; + let edition = "2015"; + if(classes.contains("edition2018")) { + edition = "2018"; + } else if(classes.contains("edition2021")) { + edition = "2021"; + } + var params = { + version: "stable", + optimize: "0", + code: text, + edition: edition + }; + + if (text.indexOf("#![feature") !== -1) { + params.version = "nightly"; + } + + result_block.innerText = "Running..."; + + fetch_with_timeout("https://play.rust-lang.org/evaluate.json", { + headers: { + 'Content-Type': "application/json", + }, + method: 'POST', + mode: 'cors', + body: JSON.stringify(params) + }) + .then(response => response.json()) + .then(response => { + if (response.result.trim() === '') { + result_block.innerText = "No output"; + result_block.classList.add("result-no-output"); + } else { + result_block.innerText = response.result; + result_block.classList.remove("result-no-output"); + } + }) + .catch(error => result_block.innerText = "Playground Communication: " + error.message); + } + + // Syntax highlighting Configuration + hljs.configure({ + tabReplace: ' ', // 4 spaces + languages: [], // Languages used for auto-detection + }); + + let code_nodes = Array + .from(document.querySelectorAll('code')) + // Don't highlight `inline code` blocks in headers. + .filter(function (node) {return !node.parentElement.classList.contains("header"); }); + + if (window.ace) { + // language-rust class needs to be removed for editable + // blocks or highlightjs will capture events + code_nodes + .filter(function (node) {return node.classList.contains("editable"); }) + .forEach(function (block) { block.classList.remove('language-rust'); }); + + code_nodes + .filter(function (node) {return !node.classList.contains("editable"); }) + .forEach(function (block) { hljs.highlightBlock(block); }); + } else { + code_nodes.forEach(function (block) { hljs.highlightBlock(block); }); + } + + // Adding the hljs class gives code blocks the color css + // even if highlighting doesn't apply + code_nodes.forEach(function (block) { block.classList.add('hljs'); }); + + Array.from(document.querySelectorAll("code.hljs")).forEach(function (block) { + + var lines = Array.from(block.querySelectorAll('.boring')); + // If no lines were hidden, return + if (!lines.length) { return; } + block.classList.add("hide-boring"); + + var buttons = document.createElement('div'); + buttons.className = 'buttons'; + buttons.innerHTML = ""; + + // add expand button + var pre_block = block.parentNode; + pre_block.insertBefore(buttons, pre_block.firstChild); + + pre_block.querySelector('.buttons').addEventListener('click', function (e) { + if (e.target.classList.contains('fa-eye')) { + e.target.classList.remove('fa-eye'); + e.target.classList.add('fa-eye-slash'); + e.target.title = 'Hide lines'; + e.target.setAttribute('aria-label', e.target.title); + + block.classList.remove('hide-boring'); + } else if (e.target.classList.contains('fa-eye-slash')) { + e.target.classList.remove('fa-eye-slash'); + e.target.classList.add('fa-eye'); + e.target.title = 'Show hidden lines'; + e.target.setAttribute('aria-label', e.target.title); + + block.classList.add('hide-boring'); + } + }); + }); + + if (window.playground_copyable) { + Array.from(document.querySelectorAll('pre code')).forEach(function (block) { + var pre_block = block.parentNode; + if (!pre_block.classList.contains('playground')) { + var buttons = pre_block.querySelector(".buttons"); + if (!buttons) { + buttons = document.createElement('div'); + buttons.className = 'buttons'; + pre_block.insertBefore(buttons, pre_block.firstChild); + } + + var clipButton = document.createElement('button'); + clipButton.className = 'fa fa-copy clip-button'; + clipButton.title = 'Copy to clipboard'; + clipButton.setAttribute('aria-label', clipButton.title); + clipButton.innerHTML = ''; + + buttons.insertBefore(clipButton, buttons.firstChild); + } + }); + } + + // Process playground code blocks + Array.from(document.querySelectorAll(".playground")).forEach(function (pre_block) { + // Add play button + var buttons = pre_block.querySelector(".buttons"); + if (!buttons) { + buttons = document.createElement('div'); + buttons.className = 'buttons'; + pre_block.insertBefore(buttons, pre_block.firstChild); + } + + var runCodeButton = document.createElement('button'); + runCodeButton.className = 'fa fa-play play-button'; + runCodeButton.hidden = true; + runCodeButton.title = 'Run this code'; + runCodeButton.setAttribute('aria-label', runCodeButton.title); + + buttons.insertBefore(runCodeButton, buttons.firstChild); + runCodeButton.addEventListener('click', function (e) { + run_rust_code(pre_block); + }); + + if (window.playground_copyable) { + var copyCodeClipboardButton = document.createElement('button'); + copyCodeClipboardButton.className = 'fa fa-copy clip-button'; + copyCodeClipboardButton.innerHTML = ''; + copyCodeClipboardButton.title = 'Copy to clipboard'; + copyCodeClipboardButton.setAttribute('aria-label', copyCodeClipboardButton.title); + + buttons.insertBefore(copyCodeClipboardButton, buttons.firstChild); + } + + let code_block = pre_block.querySelector("code"); + if (window.ace && code_block.classList.contains("editable")) { + var undoChangesButton = document.createElement('button'); + undoChangesButton.className = 'fa fa-history reset-button'; + undoChangesButton.title = 'Undo changes'; + undoChangesButton.setAttribute('aria-label', undoChangesButton.title); + + buttons.insertBefore(undoChangesButton, buttons.firstChild); + + undoChangesButton.addEventListener('click', function () { + let editor = window.ace.edit(code_block); + editor.setValue(editor.originalCode); + editor.clearSelection(); + }); + } + }); +})(); + +(function themes() { + var html = document.querySelector('html'); + var themeToggleButton = document.getElementById('theme-toggle'); + var themePopup = document.getElementById('theme-list'); + var themeColorMetaTag = document.querySelector('meta[name="theme-color"]'); + var themeIds = []; + themePopup.querySelectorAll('button.theme').forEach(function (el) { + themeIds.push(el.id); + }); + var stylesheets = { + ayuHighlight: document.querySelector("[href$='ayu-highlight.css']"), + tomorrowNight: document.querySelector("[href$='tomorrow-night.css']"), + highlight: document.querySelector("[href$='highlight.css']"), + }; + + function showThemes() { + themePopup.style.display = 'block'; + themeToggleButton.setAttribute('aria-expanded', true); + themePopup.querySelector("button#" + get_theme()).focus(); + } + + function updateThemeSelected() { + themePopup.querySelectorAll('.theme-selected').forEach(function (el) { + el.classList.remove('theme-selected'); + }); + themePopup.querySelector("button#" + get_theme()).classList.add('theme-selected'); + } + + function hideThemes() { + themePopup.style.display = 'none'; + themeToggleButton.setAttribute('aria-expanded', false); + themeToggleButton.focus(); + } + + function get_theme() { + var theme; + try { theme = localStorage.getItem('mdbook-theme'); } catch (e) { } + if (theme === null || theme === undefined || !themeIds.includes(theme)) { + return default_theme; + } else { + return theme; + } + } + + function set_theme(theme, store = true) { + let ace_theme; + + if (theme == 'coal' || theme == 'navy') { + stylesheets.ayuHighlight.disabled = true; + stylesheets.tomorrowNight.disabled = false; + stylesheets.highlight.disabled = true; + + ace_theme = "ace/theme/tomorrow_night"; + } else if (theme == 'ayu') { + stylesheets.ayuHighlight.disabled = false; + stylesheets.tomorrowNight.disabled = true; + stylesheets.highlight.disabled = true; + ace_theme = "ace/theme/tomorrow_night"; + } else { + stylesheets.ayuHighlight.disabled = true; + stylesheets.tomorrowNight.disabled = true; + stylesheets.highlight.disabled = false; + ace_theme = "ace/theme/dawn"; + } + + setTimeout(function () { + themeColorMetaTag.content = getComputedStyle(document.documentElement).backgroundColor; + }, 1); + + if (window.ace && window.editors) { + window.editors.forEach(function (editor) { + editor.setTheme(ace_theme); + }); + } + + var previousTheme = get_theme(); + + if (store) { + try { localStorage.setItem('mdbook-theme', theme); } catch (e) { } + } + + html.classList.remove(previousTheme); + html.classList.add(theme); + updateThemeSelected(); + } + + // Set theme + var theme = get_theme(); + + set_theme(theme, false); + + themeToggleButton.addEventListener('click', function () { + if (themePopup.style.display === 'block') { + hideThemes(); + } else { + showThemes(); + } + }); + + themePopup.addEventListener('click', function (e) { + var theme; + if (e.target.className === "theme") { + theme = e.target.id; + } else if (e.target.parentElement.className === "theme") { + theme = e.target.parentElement.id; + } else { + return; + } + set_theme(theme); + }); + + themePopup.addEventListener('focusout', function(e) { + // e.relatedTarget is null in Safari and Firefox on macOS (see workaround below) + if (!!e.relatedTarget && !themeToggleButton.contains(e.relatedTarget) && !themePopup.contains(e.relatedTarget)) { + hideThemes(); + } + }); + + // Should not be needed, but it works around an issue on macOS & iOS: https://github.com/rust-lang/mdBook/issues/628 + document.addEventListener('click', function(e) { + if (themePopup.style.display === 'block' && !themeToggleButton.contains(e.target) && !themePopup.contains(e.target)) { + hideThemes(); + } + }); + + document.addEventListener('keydown', function (e) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return; } + if (!themePopup.contains(e.target)) { return; } + + switch (e.key) { + case 'Escape': + e.preventDefault(); + hideThemes(); + break; + case 'ArrowUp': + e.preventDefault(); + var li = document.activeElement.parentElement; + if (li && li.previousElementSibling) { + li.previousElementSibling.querySelector('button').focus(); + } + break; + case 'ArrowDown': + e.preventDefault(); + var li = document.activeElement.parentElement; + if (li && li.nextElementSibling) { + li.nextElementSibling.querySelector('button').focus(); + } + break; + case 'Home': + e.preventDefault(); + themePopup.querySelector('li:first-child button').focus(); + break; + case 'End': + e.preventDefault(); + themePopup.querySelector('li:last-child button').focus(); + break; + } + }); +})(); + +(function sidebar() { + var body = document.querySelector("body"); + var sidebar = document.getElementById("sidebar"); + var sidebarLinks = document.querySelectorAll('#sidebar a'); + var sidebarToggleButton = document.getElementById("sidebar-toggle"); + var sidebarResizeHandle = document.getElementById("sidebar-resize-handle"); + var firstContact = null; + + function showSidebar() { + body.classList.remove('sidebar-hidden') + body.classList.add('sidebar-visible'); + Array.from(sidebarLinks).forEach(function (link) { + link.setAttribute('tabIndex', 0); + }); + sidebarToggleButton.setAttribute('aria-expanded', true); + sidebar.setAttribute('aria-hidden', false); + try { localStorage.setItem('mdbook-sidebar', 'visible'); } catch (e) { } + } + + + var sidebarAnchorToggles = document.querySelectorAll('#sidebar a.toggle'); + + function toggleSection(ev) { + ev.currentTarget.parentElement.classList.toggle('expanded'); + } + + Array.from(sidebarAnchorToggles).forEach(function (el) { + el.addEventListener('click', toggleSection); + }); + + function hideSidebar() { + body.classList.remove('sidebar-visible') + body.classList.add('sidebar-hidden'); + Array.from(sidebarLinks).forEach(function (link) { + link.setAttribute('tabIndex', -1); + }); + sidebarToggleButton.setAttribute('aria-expanded', false); + sidebar.setAttribute('aria-hidden', true); + try { localStorage.setItem('mdbook-sidebar', 'hidden'); } catch (e) { } + } + + // Toggle sidebar + sidebarToggleButton.addEventListener('click', function sidebarToggle() { + if (body.classList.contains("sidebar-hidden")) { + var current_width = parseInt( + document.documentElement.style.getPropertyValue('--sidebar-width'), 10); + if (current_width < 150) { + document.documentElement.style.setProperty('--sidebar-width', '150px'); + } + showSidebar(); + } else if (body.classList.contains("sidebar-visible")) { + hideSidebar(); + } else { + if (getComputedStyle(sidebar)['transform'] === 'none') { + hideSidebar(); + } else { + showSidebar(); + } + } + }); + + sidebarResizeHandle.addEventListener('mousedown', initResize, false); + + function initResize(e) { + window.addEventListener('mousemove', resize, false); + window.addEventListener('mouseup', stopResize, false); + body.classList.add('sidebar-resizing'); + } + function resize(e) { + var pos = (e.clientX - sidebar.offsetLeft); + if (pos < 20) { + hideSidebar(); + } else { + if (body.classList.contains("sidebar-hidden")) { + showSidebar(); + } + pos = Math.min(pos, window.innerWidth - 100); + document.documentElement.style.setProperty('--sidebar-width', pos + 'px'); + } + } + //on mouseup remove windows functions mousemove & mouseup + function stopResize(e) { + body.classList.remove('sidebar-resizing'); + window.removeEventListener('mousemove', resize, false); + window.removeEventListener('mouseup', stopResize, false); + } + + document.addEventListener('touchstart', function (e) { + firstContact = { + x: e.touches[0].clientX, + time: Date.now() + }; + }, { passive: true }); + + document.addEventListener('touchmove', function (e) { + if (!firstContact) + return; + + var curX = e.touches[0].clientX; + var xDiff = curX - firstContact.x, + tDiff = Date.now() - firstContact.time; + + if (tDiff < 250 && Math.abs(xDiff) >= 150) { + if (xDiff >= 0 && firstContact.x < Math.min(document.body.clientWidth * 0.25, 300)) + showSidebar(); + else if (xDiff < 0 && curX < 300) + hideSidebar(); + + firstContact = null; + } + }, { passive: true }); +})(); + +(function chapterNavigation() { + document.addEventListener('keydown', function (e) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return; } + if (window.search && window.search.hasFocus()) { return; } + var html = document.querySelector('html'); + + function next() { + var nextButton = document.querySelector('.nav-chapters.next'); + if (nextButton) { + window.location.href = nextButton.href; + } + } + function prev() { + var previousButton = document.querySelector('.nav-chapters.previous'); + if (previousButton) { + window.location.href = previousButton.href; + } + } + switch (e.key) { + case 'ArrowRight': + e.preventDefault(); + if (html.dir == 'rtl') { + prev(); + } else { + next(); + } + break; + case 'ArrowLeft': + e.preventDefault(); + if (html.dir == 'rtl') { + next(); + } else { + prev(); + } + break; + } + }); +})(); + +(function clipboard() { + var clipButtons = document.querySelectorAll('.clip-button'); + + function hideTooltip(elem) { + elem.firstChild.innerText = ""; + elem.className = 'fa fa-copy clip-button'; + } + + function showTooltip(elem, msg) { + elem.firstChild.innerText = msg; + elem.className = 'fa fa-copy tooltipped'; + } + + var clipboardSnippets = new ClipboardJS('.clip-button', { + text: function (trigger) { + hideTooltip(trigger); + let playground = trigger.closest("pre"); + return playground_text(playground, false); + } + }); + + Array.from(clipButtons).forEach(function (clipButton) { + clipButton.addEventListener('mouseout', function (e) { + hideTooltip(e.currentTarget); + }); + }); + + clipboardSnippets.on('success', function (e) { + e.clearSelection(); + showTooltip(e.trigger, "Copied!"); + }); + + clipboardSnippets.on('error', function (e) { + showTooltip(e.trigger, "Clipboard error!"); + }); +})(); + +(function scrollToTop () { + var menuTitle = document.querySelector('.menu-title'); + + menuTitle.addEventListener('click', function () { + document.scrollingElement.scrollTo({ top: 0, behavior: 'smooth' }); + }); +})(); + +(function controllMenu() { + var menu = document.getElementById('menu-bar'); + + (function controllPosition() { + var scrollTop = document.scrollingElement.scrollTop; + var prevScrollTop = scrollTop; + var minMenuY = -menu.clientHeight - 50; + // When the script loads, the page can be at any scroll (e.g. if you reforesh it). + menu.style.top = scrollTop + 'px'; + // Same as parseInt(menu.style.top.slice(0, -2), but faster + var topCache = menu.style.top.slice(0, -2); + menu.classList.remove('sticky'); + var stickyCache = false; // Same as menu.classList.contains('sticky'), but faster + document.addEventListener('scroll', function () { + scrollTop = Math.max(document.scrollingElement.scrollTop, 0); + // `null` means that it doesn't need to be updated + var nextSticky = null; + var nextTop = null; + var scrollDown = scrollTop > prevScrollTop; + var menuPosAbsoluteY = topCache - scrollTop; + if (scrollDown) { + nextSticky = false; + if (menuPosAbsoluteY > 0) { + nextTop = prevScrollTop; + } + } else { + if (menuPosAbsoluteY > 0) { + nextSticky = true; + } else if (menuPosAbsoluteY < minMenuY) { + nextTop = prevScrollTop + minMenuY; + } + } + if (nextSticky === true && stickyCache === false) { + menu.classList.add('sticky'); + stickyCache = true; + } else if (nextSticky === false && stickyCache === true) { + menu.classList.remove('sticky'); + stickyCache = false; + } + if (nextTop !== null) { + menu.style.top = nextTop + 'px'; + topCache = nextTop; + } + prevScrollTop = scrollTop; + }, { passive: true }); + })(); + (function controllBorder() { + function updateBorder() { + if (menu.offsetTop === 0) { + menu.classList.remove('bordered'); + } else { + menu.classList.add('bordered'); + } + } + updateBorder(); + document.addEventListener('scroll', updateBorder, { passive: true }); + })(); +})(); diff --git a/manual/theme/catppuccin-admonish.css b/manual/theme/catppuccin-admonish.css new file mode 100644 index 0000000..d223ee9 --- /dev/null +++ b/manual/theme/catppuccin-admonish.css @@ -0,0 +1,363 @@ +.latte :is(.admonition):is(.admonish-hint, .admonish-important, .admonish-tip) { + border-color: #df8e1d; +} +.latte :is(.admonish-hint, .admonish-important, .admonish-tip) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(223, 142, 29, 0.2); +} +.latte :is(.admonish-hint, .admonish-important, .admonish-tip) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #df8e1d; +} +.latte :is(.admonition):is(.admonish-abstract, .admonish-summary, .admonish-tldr) { + border-color: #dd7878; +} +.latte :is(.admonish-abstract, .admonish-summary, .admonish-tldr) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(221, 120, 120, 0.2); +} +.latte :is(.admonish-abstract, .admonish-summary, .admonish-tldr) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #dd7878; +} +.latte :is(.admonition):is(.admonish-example) { + border-color: #8839ef; +} +.latte :is(.admonish-example) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(136, 57, 239, 0.2); +} +.latte :is(.admonish-example) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #8839ef; +} +.latte :is(.admonition):is(.admonish-info, .admonish-todo) { + border-color: #04a5e5; +} +.latte :is(.admonish-info, .admonish-todo) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(4, 165, 229, 0.2); +} +.latte :is(.admonish-info, .admonish-todo) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #04a5e5; +} +.latte :is(.admonition):is(.admonish-check, .admonish-done, .admonish-success) { + border-color: #40a02b; +} +.latte :is(.admonish-check, .admonish-done, .admonish-success) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(64, 160, 43, 0.2); +} +.latte :is(.admonish-check, .admonish-done, .admonish-success) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #40a02b; +} +.latte :is(.admonition):is(.admonish-note) { + border-color: #1e66f5; +} +.latte :is(.admonish-note) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(30, 102, 245, 0.2); +} +.latte :is(.admonish-note) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #1e66f5; +} +.latte :is(.admonition):is(.admonish-attention, .admonish-caution, .admonish-warning) { + border-color: #fe640b; +} +.latte :is(.admonish-attention, .admonish-caution, .admonish-warning) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(254, 100, 11, 0.2); +} +.latte :is(.admonish-attention, .admonish-caution, .admonish-warning) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #fe640b; +} +.latte :is(.admonition):is(.admonish-faq, .admonish-help, .admonish-question) { + border-color: #179299; +} +.latte :is(.admonish-faq, .admonish-help, .admonish-question) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(23, 146, 153, 0.2); +} +.latte :is(.admonish-faq, .admonish-help, .admonish-question) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #179299; +} +.latte :is(.admonition):is(.admonish-bug, .admonish-danger, .admonish-error, .admonish-fail, .admonish-failure, .admonish-missing) { + border-color: #d20f39; +} +.latte :is(.admonish-bug, .admonish-danger, .admonish-error, .admonish-fail, .admonish-failure, .admonish-missing) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(210, 15, 57, 0.2); +} +.latte :is(.admonish-bug, .admonish-danger, .admonish-error, .admonish-fail, .admonish-failure, .admonish-missing) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #d20f39; +} +.latte :is(.admonition):is(.admonish-cite, .admonish-quote) { + border-color: #ea76cb; +} +.latte :is(.admonish-cite, .admonish-quote) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(234, 118, 203, 0.2); +} +.latte :is(.admonish-cite, .admonish-quote) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #ea76cb; +} + +.frappe :is(.admonition):is(.admonish-hint, .admonish-important, .admonish-tip) { + border-color: #e5c890; +} +.frappe :is(.admonish-hint, .admonish-important, .admonish-tip) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(229, 200, 144, 0.2); +} +.frappe :is(.admonish-hint, .admonish-important, .admonish-tip) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #e5c890; +} +.frappe :is(.admonition):is(.admonish-abstract, .admonish-summary, .admonish-tldr) { + border-color: #eebebe; +} +.frappe :is(.admonish-abstract, .admonish-summary, .admonish-tldr) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(238, 190, 190, 0.2); +} +.frappe :is(.admonish-abstract, .admonish-summary, .admonish-tldr) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #eebebe; +} +.frappe :is(.admonition):is(.admonish-example) { + border-color: #ca9ee6; +} +.frappe :is(.admonish-example) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(202, 158, 230, 0.2); +} +.frappe :is(.admonish-example) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #ca9ee6; +} +.frappe :is(.admonition):is(.admonish-info, .admonish-todo) { + border-color: #99d1db; +} +.frappe :is(.admonish-info, .admonish-todo) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(153, 209, 219, 0.2); +} +.frappe :is(.admonish-info, .admonish-todo) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #99d1db; +} +.frappe :is(.admonition):is(.admonish-check, .admonish-done, .admonish-success) { + border-color: #a6d189; +} +.frappe :is(.admonish-check, .admonish-done, .admonish-success) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(166, 209, 137, 0.2); +} +.frappe :is(.admonish-check, .admonish-done, .admonish-success) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #a6d189; +} +.frappe :is(.admonition):is(.admonish-note) { + border-color: #8caaee; +} +.frappe :is(.admonish-note) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(140, 170, 238, 0.2); +} +.frappe :is(.admonish-note) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #8caaee; +} +.frappe :is(.admonition):is(.admonish-attention, .admonish-caution, .admonish-warning) { + border-color: #ef9f76; +} +.frappe :is(.admonish-attention, .admonish-caution, .admonish-warning) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(239, 159, 118, 0.2); +} +.frappe :is(.admonish-attention, .admonish-caution, .admonish-warning) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #ef9f76; +} +.frappe :is(.admonition):is(.admonish-faq, .admonish-help, .admonish-question) { + border-color: #81c8be; +} +.frappe :is(.admonish-faq, .admonish-help, .admonish-question) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(129, 200, 190, 0.2); +} +.frappe :is(.admonish-faq, .admonish-help, .admonish-question) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #81c8be; +} +.frappe :is(.admonition):is(.admonish-bug, .admonish-danger, .admonish-error, .admonish-fail, .admonish-failure, .admonish-missing) { + border-color: #e78284; +} +.frappe :is(.admonish-bug, .admonish-danger, .admonish-error, .admonish-fail, .admonish-failure, .admonish-missing) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(231, 130, 132, 0.2); +} +.frappe :is(.admonish-bug, .admonish-danger, .admonish-error, .admonish-fail, .admonish-failure, .admonish-missing) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #e78284; +} +.frappe :is(.admonition):is(.admonish-cite, .admonish-quote) { + border-color: #f4b8e4; +} +.frappe :is(.admonish-cite, .admonish-quote) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(244, 184, 228, 0.2); +} +.frappe :is(.admonish-cite, .admonish-quote) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #f4b8e4; +} + +.macchiato :is(.admonition):is(.admonish-hint, .admonish-important, .admonish-tip) { + border-color: #eed49f; +} +.macchiato :is(.admonish-hint, .admonish-important, .admonish-tip) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(238, 212, 159, 0.2); +} +.macchiato :is(.admonish-hint, .admonish-important, .admonish-tip) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #eed49f; +} +.macchiato :is(.admonition):is(.admonish-abstract, .admonish-summary, .admonish-tldr) { + border-color: #f0c6c6; +} +.macchiato :is(.admonish-abstract, .admonish-summary, .admonish-tldr) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(240, 198, 198, 0.2); +} +.macchiato :is(.admonish-abstract, .admonish-summary, .admonish-tldr) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #f0c6c6; +} +.macchiato :is(.admonition):is(.admonish-example) { + border-color: #c6a0f6; +} +.macchiato :is(.admonish-example) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(198, 160, 246, 0.2); +} +.macchiato :is(.admonish-example) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #c6a0f6; +} +.macchiato :is(.admonition):is(.admonish-info, .admonish-todo) { + border-color: #91d7e3; +} +.macchiato :is(.admonish-info, .admonish-todo) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(145, 215, 227, 0.2); +} +.macchiato :is(.admonish-info, .admonish-todo) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #91d7e3; +} +.macchiato :is(.admonition):is(.admonish-check, .admonish-done, .admonish-success) { + border-color: #a6da95; +} +.macchiato :is(.admonish-check, .admonish-done, .admonish-success) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(166, 218, 149, 0.2); +} +.macchiato :is(.admonish-check, .admonish-done, .admonish-success) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #a6da95; +} +.macchiato :is(.admonition):is(.admonish-note) { + border-color: #8aadf4; +} +.macchiato :is(.admonish-note) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(138, 173, 244, 0.2); +} +.macchiato :is(.admonish-note) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #8aadf4; +} +.macchiato :is(.admonition):is(.admonish-attention, .admonish-caution, .admonish-warning) { + border-color: #f5a97f; +} +.macchiato :is(.admonish-attention, .admonish-caution, .admonish-warning) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(245, 169, 127, 0.2); +} +.macchiato :is(.admonish-attention, .admonish-caution, .admonish-warning) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #f5a97f; +} +.macchiato :is(.admonition):is(.admonish-faq, .admonish-help, .admonish-question) { + border-color: #8bd5ca; +} +.macchiato :is(.admonish-faq, .admonish-help, .admonish-question) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(139, 213, 202, 0.2); +} +.macchiato :is(.admonish-faq, .admonish-help, .admonish-question) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #8bd5ca; +} +.macchiato :is(.admonition):is(.admonish-bug, .admonish-danger, .admonish-error, .admonish-fail, .admonish-failure, .admonish-missing) { + border-color: #ed8796; +} +.macchiato :is(.admonish-bug, .admonish-danger, .admonish-error, .admonish-fail, .admonish-failure, .admonish-missing) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(237, 135, 150, 0.2); +} +.macchiato :is(.admonish-bug, .admonish-danger, .admonish-error, .admonish-fail, .admonish-failure, .admonish-missing) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #ed8796; +} +.macchiato :is(.admonition):is(.admonish-cite, .admonish-quote) { + border-color: #f5bde6; +} +.macchiato :is(.admonish-cite, .admonish-quote) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(245, 189, 230, 0.2); +} +.macchiato :is(.admonish-cite, .admonish-quote) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #f5bde6; +} + +.mocha :is(.admonition):is(.admonish-hint, .admonish-important, .admonish-tip) { + border-color: #f9e2af; +} +.mocha :is(.admonish-hint, .admonish-important, .admonish-tip) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(249, 226, 175, 0.2); +} +.mocha :is(.admonish-hint, .admonish-important, .admonish-tip) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #f9e2af; +} +.mocha :is(.admonition):is(.admonish-abstract, .admonish-summary, .admonish-tldr) { + border-color: #f2cdcd; +} +.mocha :is(.admonish-abstract, .admonish-summary, .admonish-tldr) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(242, 205, 205, 0.2); +} +.mocha :is(.admonish-abstract, .admonish-summary, .admonish-tldr) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #f2cdcd; +} +.mocha :is(.admonition):is(.admonish-example) { + border-color: #cba6f7; +} +.mocha :is(.admonish-example) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(203, 166, 247, 0.2); +} +.mocha :is(.admonish-example) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #cba6f7; +} +.mocha :is(.admonition):is(.admonish-info, .admonish-todo) { + border-color: #89dceb; +} +.mocha :is(.admonish-info, .admonish-todo) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(137, 220, 235, 0.2); +} +.mocha :is(.admonish-info, .admonish-todo) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #89dceb; +} +.mocha :is(.admonition):is(.admonish-check, .admonish-done, .admonish-success) { + border-color: #a6e3a1; +} +.mocha :is(.admonish-check, .admonish-done, .admonish-success) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(166, 227, 161, 0.2); +} +.mocha :is(.admonish-check, .admonish-done, .admonish-success) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #a6e3a1; +} +.mocha :is(.admonition):is(.admonish-note) { + border-color: #89b4fa; +} +.mocha :is(.admonish-note) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(137, 180, 250, 0.2); +} +.mocha :is(.admonish-note) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #89b4fa; +} +.mocha :is(.admonition):is(.admonish-attention, .admonish-caution, .admonish-warning) { + border-color: #fab387; +} +.mocha :is(.admonish-attention, .admonish-caution, .admonish-warning) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(250, 179, 135, 0.2); +} +.mocha :is(.admonish-attention, .admonish-caution, .admonish-warning) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #fab387; +} +.mocha :is(.admonition):is(.admonish-faq, .admonish-help, .admonish-question) { + border-color: #94e2d5; +} +.mocha :is(.admonish-faq, .admonish-help, .admonish-question) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(148, 226, 213, 0.2); +} +.mocha :is(.admonish-faq, .admonish-help, .admonish-question) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #94e2d5; +} +.mocha :is(.admonition):is(.admonish-bug, .admonish-danger, .admonish-error, .admonish-fail, .admonish-failure, .admonish-missing) { + border-color: #f38ba8; +} +.mocha :is(.admonish-bug, .admonish-danger, .admonish-error, .admonish-fail, .admonish-failure, .admonish-missing) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(243, 139, 168, 0.2); +} +.mocha :is(.admonish-bug, .admonish-danger, .admonish-error, .admonish-fail, .admonish-failure, .admonish-missing) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #f38ba8; +} +.mocha :is(.admonition):is(.admonish-cite, .admonish-quote) { + border-color: #f5c2e7; +} +.mocha :is(.admonish-cite, .admonish-quote) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(245, 194, 231, 0.2); +} +.mocha :is(.admonish-cite, .admonish-quote) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #f5c2e7; +} diff --git a/manual/theme/catppuccin.css b/manual/theme/catppuccin.css new file mode 100644 index 0000000..3c0a6f1 --- /dev/null +++ b/manual/theme/catppuccin.css @@ -0,0 +1,812 @@ +/* https://highlightjs.readthedocs.io/en/latest/css-classes-reference.html */ +.latte.hljs { + color: #4c4f69; + background: #eff1f5; +} +.latte .hljs-keyword { + color: #8839ef; +} +.latte .hljs-built_in { + color: #d20f39; +} +.latte .hljs-type { + color: #df8e1d; +} +.latte .hljs-literal { + color: #fe640b; +} +.latte .hljs-number { + color: #fe640b; +} +.latte .hljs-operator { + color: #04a5e5; +} +.latte .hljs-punctuation { + color: #5c5f77; +} +.latte .hljs-property { + color: #179299; +} +.latte .hljs-regexp { + color: #ea76cb; +} +.latte .hljs-string { + color: #40a02b; +} +.latte .hljs-char.escape_ { + color: #40a02b; +} +.latte .hljs-subst { + color: #6c6f85; +} +.latte .hljs-symbol { + color: #dd7878; +} +.latte .hljs-variable { + color: #8839ef; +} +.latte .hljs-variable.language_ { + color: #8839ef; +} +.latte .hljs-variable.constant_ { + color: #fe640b; +} +.latte .hljs-title { + color: #1e66f5; +} +.latte .hljs-title.class_ { + color: #df8e1d; +} +.latte .hljs-title.function_ { + color: #1e66f5; +} +.latte .hljs-params { + color: #4c4f69; +} +.latte .hljs-comment { + color: #7c7f93; +} +.latte .hljs-doctag { + color: #d20f39; +} +.latte .hljs-meta { + color: #fe640b; +} +.latte .hljs-section { + color: #1e66f5; +} +.latte .hljs-tag { + color: #179299; +} +.latte .hljs-name { + color: #8839ef; +} +.latte .hljs-attr { + color: #1e66f5; +} +.latte .hljs-attribute { + color: #40a02b; +} +.latte .hljs-bullet { + color: #179299; +} +.latte .hljs-code { + color: #40a02b; +} +.latte .hljs-emphasis { + color: #d20f39; + font-style: italic; +} +.latte .hljs-strong { + color: #d20f39; + font-weight: bold; +} +.latte .hljs-formula { + color: #179299; +} +.latte .hljs-link { + color: #209fb5; + font-style: italic; +} +.latte .hljs-quote { + color: #40a02b; + font-style: italic; +} +.latte .hljs-selector-tag { + color: #df8e1d; +} +.latte .hljs-selector-id { + color: #1e66f5; +} +.latte .hljs-selector-class { + color: #179299; +} +.latte .hljs-selector-attr { + color: #8839ef; +} +.latte .hljs-selector-pseudo { + color: #179299; +} +.latte .hljs-template-tag { + color: #dd7878; +} +.latte .hljs-template-variable { + color: #dd7878; +} +.latte .hljs-addition { + color: #40a02b; + background: rgba(64, 160, 43, 0.15); +} +.latte .hljs-deletion { + color: #d20f39; + background: rgba(210, 15, 57, 0.15); +} +.latte code { + color: #4c4f69; + background: #e6e9ef; +} +.latte blockquote blockquote { + border-top: 0.1em solid #acb0be; + border-bottom: 0.1em solid #acb0be; +} +.latte hr { + border-color: #acb0be; + border-style: solid; +} +.latte del { + color: #7c7f93; +} +.latte .ace_gutter { + color: #8c8fa1; + background: #e6e9ef; +} +.latte .ace_gutter-active-line.ace_gutter-cell { + color: #ea76cb; + background: #e6e9ef; +} +.latte .tooltiptext { + background: #e6e9ef; + color: #4c4f69; +} + +.frappe.hljs { + color: #c6d0f5; + background: #303446; +} +.frappe .hljs-keyword { + color: #ca9ee6; +} +.frappe .hljs-built_in { + color: #e78284; +} +.frappe .hljs-type { + color: #e5c890; +} +.frappe .hljs-literal { + color: #ef9f76; +} +.frappe .hljs-number { + color: #ef9f76; +} +.frappe .hljs-operator { + color: #99d1db; +} +.frappe .hljs-punctuation { + color: #b5bfe2; +} +.frappe .hljs-property { + color: #81c8be; +} +.frappe .hljs-regexp { + color: #f4b8e4; +} +.frappe .hljs-string { + color: #a6d189; +} +.frappe .hljs-char.escape_ { + color: #a6d189; +} +.frappe .hljs-subst { + color: #a5adce; +} +.frappe .hljs-symbol { + color: #eebebe; +} +.frappe .hljs-variable { + color: #ca9ee6; +} +.frappe .hljs-variable.language_ { + color: #ca9ee6; +} +.frappe .hljs-variable.constant_ { + color: #ef9f76; +} +.frappe .hljs-title { + color: #8caaee; +} +.frappe .hljs-title.class_ { + color: #e5c890; +} +.frappe .hljs-title.function_ { + color: #8caaee; +} +.frappe .hljs-params { + color: #c6d0f5; +} +.frappe .hljs-comment { + color: #949cbb; +} +.frappe .hljs-doctag { + color: #e78284; +} +.frappe .hljs-meta { + color: #ef9f76; +} +.frappe .hljs-section { + color: #8caaee; +} +.frappe .hljs-tag { + color: #81c8be; +} +.frappe .hljs-name { + color: #ca9ee6; +} +.frappe .hljs-attr { + color: #8caaee; +} +.frappe .hljs-attribute { + color: #a6d189; +} +.frappe .hljs-bullet { + color: #81c8be; +} +.frappe .hljs-code { + color: #a6d189; +} +.frappe .hljs-emphasis { + color: #e78284; + font-style: italic; +} +.frappe .hljs-strong { + color: #e78284; + font-weight: bold; +} +.frappe .hljs-formula { + color: #81c8be; +} +.frappe .hljs-link { + color: #85c1dc; + font-style: italic; +} +.frappe .hljs-quote { + color: #a6d189; + font-style: italic; +} +.frappe .hljs-selector-tag { + color: #e5c890; +} +.frappe .hljs-selector-id { + color: #8caaee; +} +.frappe .hljs-selector-class { + color: #81c8be; +} +.frappe .hljs-selector-attr { + color: #ca9ee6; +} +.frappe .hljs-selector-pseudo { + color: #81c8be; +} +.frappe .hljs-template-tag { + color: #eebebe; +} +.frappe .hljs-template-variable { + color: #eebebe; +} +.frappe .hljs-addition { + color: #a6d189; + background: rgba(166, 209, 137, 0.15); +} +.frappe .hljs-deletion { + color: #e78284; + background: rgba(231, 130, 132, 0.15); +} +.frappe code { + color: #c6d0f5; + background: #292c3c; +} +.frappe blockquote blockquote { + border-top: 0.1em solid #626880; + border-bottom: 0.1em solid #626880; +} +.frappe hr { + border-color: #626880; + border-style: solid; +} +.frappe del { + color: #949cbb; +} +.frappe .ace_gutter { + color: #838ba7; + background: #292c3c; +} +.frappe .ace_gutter-active-line.ace_gutter-cell { + color: #f4b8e4; + background: #292c3c; +} +.frappe .tooltiptext { + background: #292c3c; + color: #c6d0f5; +} + +.macchiato.hljs { + color: #cad3f5; + background: #24273a; +} +.macchiato .hljs-keyword { + color: #c6a0f6; +} +.macchiato .hljs-built_in { + color: #ed8796; +} +.macchiato .hljs-type { + color: #eed49f; +} +.macchiato .hljs-literal { + color: #f5a97f; +} +.macchiato .hljs-number { + color: #f5a97f; +} +.macchiato .hljs-operator { + color: #91d7e3; +} +.macchiato .hljs-punctuation { + color: #b8c0e0; +} +.macchiato .hljs-property { + color: #8bd5ca; +} +.macchiato .hljs-regexp { + color: #f5bde6; +} +.macchiato .hljs-string { + color: #a6da95; +} +.macchiato .hljs-char.escape_ { + color: #a6da95; +} +.macchiato .hljs-subst { + color: #a5adcb; +} +.macchiato .hljs-symbol { + color: #f0c6c6; +} +.macchiato .hljs-variable { + color: #c6a0f6; +} +.macchiato .hljs-variable.language_ { + color: #c6a0f6; +} +.macchiato .hljs-variable.constant_ { + color: #f5a97f; +} +.macchiato .hljs-title { + color: #8aadf4; +} +.macchiato .hljs-title.class_ { + color: #eed49f; +} +.macchiato .hljs-title.function_ { + color: #8aadf4; +} +.macchiato .hljs-params { + color: #cad3f5; +} +.macchiato .hljs-comment { + color: #939ab7; +} +.macchiato .hljs-doctag { + color: #ed8796; +} +.macchiato .hljs-meta { + color: #f5a97f; +} +.macchiato .hljs-section { + color: #8aadf4; +} +.macchiato .hljs-tag { + color: #8bd5ca; +} +.macchiato .hljs-name { + color: #c6a0f6; +} +.macchiato .hljs-attr { + color: #8aadf4; +} +.macchiato .hljs-attribute { + color: #a6da95; +} +.macchiato .hljs-bullet { + color: #8bd5ca; +} +.macchiato .hljs-code { + color: #a6da95; +} +.macchiato .hljs-emphasis { + color: #ed8796; + font-style: italic; +} +.macchiato .hljs-strong { + color: #ed8796; + font-weight: bold; +} +.macchiato .hljs-formula { + color: #8bd5ca; +} +.macchiato .hljs-link { + color: #7dc4e4; + font-style: italic; +} +.macchiato .hljs-quote { + color: #a6da95; + font-style: italic; +} +.macchiato .hljs-selector-tag { + color: #eed49f; +} +.macchiato .hljs-selector-id { + color: #8aadf4; +} +.macchiato .hljs-selector-class { + color: #8bd5ca; +} +.macchiato .hljs-selector-attr { + color: #c6a0f6; +} +.macchiato .hljs-selector-pseudo { + color: #8bd5ca; +} +.macchiato .hljs-template-tag { + color: #f0c6c6; +} +.macchiato .hljs-template-variable { + color: #f0c6c6; +} +.macchiato .hljs-addition { + color: #a6da95; + background: rgba(166, 218, 149, 0.15); +} +.macchiato .hljs-deletion { + color: #ed8796; + background: rgba(237, 135, 150, 0.15); +} +.macchiato code { + color: #cad3f5; + background: #1e2030; +} +.macchiato blockquote blockquote { + border-top: 0.1em solid #5b6078; + border-bottom: 0.1em solid #5b6078; +} +.macchiato hr { + border-color: #5b6078; + border-style: solid; +} +.macchiato del { + color: #939ab7; +} +.macchiato .ace_gutter { + color: #8087a2; + background: #1e2030; +} +.macchiato .ace_gutter-active-line.ace_gutter-cell { + color: #f5bde6; + background: #1e2030; +} +.macchiato .tooltiptext { + background: #1e2030; + color: #cad3f5; +} + +.mocha.hljs { + color: #cdd6f4; + background: #1e1e2e; +} +.mocha .hljs-keyword { + color: #cba6f7; +} +.mocha .hljs-built_in { + color: #f38ba8; +} +.mocha .hljs-type { + color: #f9e2af; +} +.mocha .hljs-literal { + color: #fab387; +} +.mocha .hljs-number { + color: #fab387; +} +.mocha .hljs-operator { + color: #89dceb; +} +.mocha .hljs-punctuation { + color: #bac2de; +} +.mocha .hljs-property { + color: #94e2d5; +} +.mocha .hljs-regexp { + color: #f5c2e7; +} +.mocha .hljs-string { + color: #a6e3a1; +} +.mocha .hljs-char.escape_ { + color: #a6e3a1; +} +.mocha .hljs-subst { + color: #a6adc8; +} +.mocha .hljs-symbol { + color: #f2cdcd; +} +.mocha .hljs-variable { + color: #cba6f7; +} +.mocha .hljs-variable.language_ { + color: #cba6f7; +} +.mocha .hljs-variable.constant_ { + color: #fab387; +} +.mocha .hljs-title { + color: #89b4fa; +} +.mocha .hljs-title.class_ { + color: #f9e2af; +} +.mocha .hljs-title.function_ { + color: #89b4fa; +} +.mocha .hljs-params { + color: #cdd6f4; +} +.mocha .hljs-comment { + color: #9399b2; +} +.mocha .hljs-doctag { + color: #f38ba8; +} +.mocha .hljs-meta { + color: #fab387; +} +.mocha .hljs-section { + color: #89b4fa; +} +.mocha .hljs-tag { + color: #94e2d5; +} +.mocha .hljs-name { + color: #cba6f7; +} +.mocha .hljs-attr { + color: #89b4fa; +} +.mocha .hljs-attribute { + color: #a6e3a1; +} +.mocha .hljs-bullet { + color: #94e2d5; +} +.mocha .hljs-code { + color: #a6e3a1; +} +.mocha .hljs-emphasis { + color: #f38ba8; + font-style: italic; +} +.mocha .hljs-strong { + color: #f38ba8; + font-weight: bold; +} +.mocha .hljs-formula { + color: #94e2d5; +} +.mocha .hljs-link { + color: #74c7ec; + font-style: italic; +} +.mocha .hljs-quote { + color: #a6e3a1; + font-style: italic; +} +.mocha .hljs-selector-tag { + color: #f9e2af; +} +.mocha .hljs-selector-id { + color: #89b4fa; +} +.mocha .hljs-selector-class { + color: #94e2d5; +} +.mocha .hljs-selector-attr { + color: #cba6f7; +} +.mocha .hljs-selector-pseudo { + color: #94e2d5; +} +.mocha .hljs-template-tag { + color: #f2cdcd; +} +.mocha .hljs-template-variable { + color: #f2cdcd; +} +.mocha .hljs-addition { + color: #a6e3a1; + background: rgba(166, 227, 161, 0.15); +} +.mocha .hljs-deletion { + color: #f38ba8; + background: rgba(243, 139, 168, 0.15); +} +.mocha code { + color: #cdd6f4; + background: #181825; +} +.mocha blockquote blockquote { + border-top: 0.1em solid #585b70; + border-bottom: 0.1em solid #585b70; +} +.mocha hr { + border-color: #585b70; + border-style: solid; +} +.mocha del { + color: #9399b2; +} +.mocha .ace_gutter { + color: #7f849c; + background: #181825; +} +.mocha .ace_gutter-active-line.ace_gutter-cell { + color: #f5c2e7; + background: #181825; +} +.mocha .tooltiptext { + background: #181825; + color: #cdd6f4; +} + +.latte { + --bg: #eff1f5; + --fg: #4c4f69; + --sidebar-bg: #e6e9ef; + --sidebar-fg: #4c4f69; + --sidebar-non-existant: #9ca0b0; + --sidebar-active: #1e66f5; + --sidebar-spacer: #9ca0b0; + --scrollbar: #9ca0b0; + --icons: #9ca0b0; + --icons-hover: #8c8fa1; + --links: #1e66f5; + --inline-code-color: #fe640b; + --theme-popup-bg: #e6e9ef; + --theme-popup-border: #9ca0b0; + --theme-hover: #ccd0da; + --quote-bg: #e6e9ef; + --quote-border: #dce0e8; + --table-border-color: #ccd0da; + --table-header-bg: #e6e9ef; + --table-alternate-bg: #e6e9ef; + --searchbar-border-color: #ccd0da; + --searchbar-bg: #e6e9ef; + --searchbar-fg: #4c4f69; + --searchbar-shadow-color: #dce0e8; + --searchresults-header-fg: #4c4f69; + --searchresults-border-color: #ccd0da; + --searchresults-li-bg: #eff1f5; + --search-mark-bg: #fe640b; + --warning-border: #fe640b; + --color-scheme: light; +} + +.frappe { + --bg: #303446; + --fg: #c6d0f5; + --sidebar-bg: #292c3c; + --sidebar-fg: #c6d0f5; + --sidebar-non-existant: #737994; + --sidebar-active: #8caaee; + --sidebar-spacer: #737994; + --scrollbar: #737994; + --icons: #737994; + --icons-hover: #838ba7; + --links: #8caaee; + --inline-code-color: #ef9f76; + --theme-popup-bg: #292c3c; + --theme-popup-border: #737994; + --theme-hover: #414559; + --quote-bg: #292c3c; + --quote-border: #232634; + --table-border-color: #414559; + --table-header-bg: #292c3c; + --table-alternate-bg: #292c3c; + --searchbar-border-color: #414559; + --searchbar-bg: #292c3c; + --searchbar-fg: #c6d0f5; + --searchbar-shadow-color: #232634; + --searchresults-header-fg: #c6d0f5; + --searchresults-border-color: #414559; + --searchresults-li-bg: #303446; + --search-mark-bg: #ef9f76; + --warning-border: #ef9f76; + --color-scheme: dark; +} + +.macchiato { + --bg: #24273a; + --fg: #cad3f5; + --sidebar-bg: #1e2030; + --sidebar-fg: #cad3f5; + --sidebar-non-existant: #6e738d; + --sidebar-active: #8aadf4; + --sidebar-spacer: #6e738d; + --scrollbar: #6e738d; + --icons: #6e738d; + --icons-hover: #8087a2; + --links: #8aadf4; + --inline-code-color: #f5a97f; + --theme-popup-bg: #1e2030; + --theme-popup-border: #6e738d; + --theme-hover: #363a4f; + --quote-bg: #1e2030; + --quote-border: #181926; + --table-border-color: #363a4f; + --table-header-bg: #1e2030; + --table-alternate-bg: #1e2030; + --searchbar-border-color: #363a4f; + --searchbar-bg: #1e2030; + --searchbar-fg: #cad3f5; + --searchbar-shadow-color: #181926; + --searchresults-header-fg: #cad3f5; + --searchresults-border-color: #363a4f; + --searchresults-li-bg: #24273a; + --search-mark-bg: #f5a97f; + --warning-border: #f5a97f; + --color-scheme: dark; +} + +.mocha { + --bg: #1e1e2e; + --fg: #cdd6f4; + --sidebar-bg: #181825; + --sidebar-fg: #cdd6f4; + --sidebar-non-existant: #6c7086; + --sidebar-active: #89b4fa; + --sidebar-spacer: #6c7086; + --scrollbar: #6c7086; + --icons: #6c7086; + --icons-hover: #7f849c; + --links: #89b4fa; + --inline-code-color: #fab387; + --theme-popup-bg: #181825; + --theme-popup-border: #6c7086; + --theme-hover: #313244; + --quote-bg: #181825; + --quote-border: #11111b; + --table-border-color: #313244; + --table-header-bg: #181825; + --table-alternate-bg: #181825; + --searchbar-border-color: #313244; + --searchbar-bg: #181825; + --searchbar-fg: #cdd6f4; + --searchbar-shadow-color: #11111b; + --searchresults-header-fg: #cdd6f4; + --searchresults-border-color: #313244; + --searchresults-li-bg: #1e1e2e; + --search-mark-bg: #fab387; + --warning-border: #fab387; + --color-scheme: dark; +} diff --git a/manual/theme/index.hbs b/manual/theme/index.hbs new file mode 100644 index 0000000..69457a0 --- /dev/null +++ b/manual/theme/index.hbs @@ -0,0 +1,345 @@ + + + + + + {{ title }} + {{#if is_print }} + + {{/if}} + {{#if base_url}} + + {{/if}} + + + + {{> head}} + + + + + + {{#if favicon_svg}} + + {{/if}} + {{#if favicon_png}} + + {{/if}} + + + + {{#if print_enable}} + + {{/if}} + + + + {{#if copy_fonts}} + + {{/if}} + + + + + + + + {{#each additional_css}} + + {{/each}} + + {{#if mathjax_support}} + + + {{/if}} + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ {{> header}} + + + + {{#if search_enabled}} + + {{/if}} + + + + +
+
+ {{{ content }}} +
+ + +
+
+ + + +
+ + {{#if live_reload_endpoint}} + + + {{/if}} + + {{#if google_analytics}} + + + {{/if}} + + {{#if playground_line_numbers}} + + {{/if}} + + {{#if playground_copyable}} + + {{/if}} + + {{#if playground_js}} + + + + + + {{/if}} + + {{#if search_js}} + + + + {{/if}} + + + + + + + {{#each additional_js}} + + {{/each}} + + {{#if is_print}} + {{#if mathjax_support}} + + {{else}} + + {{/if}} + {{/if}} + +
+ + diff --git a/manual/theme/mdbook-admonish.css b/manual/theme/mdbook-admonish.css new file mode 100644 index 0000000..45aeff0 --- /dev/null +++ b/manual/theme/mdbook-admonish.css @@ -0,0 +1,348 @@ +@charset "UTF-8"; +:is(.admonition) { + display: flow-root; + margin: 1.5625em 0; + padding: 0 1.2rem; + color: var(--fg); + page-break-inside: avoid; + background-color: var(--bg); + border: 0 solid black; + border-inline-start-width: 0.4rem; + border-radius: 0.2rem; + box-shadow: 0 0.2rem 1rem rgba(0, 0, 0, 0.05), 0 0 0.1rem rgba(0, 0, 0, 0.1); +} +@media print { + :is(.admonition) { + box-shadow: none; + } +} +:is(.admonition) > * { + box-sizing: border-box; +} +:is(.admonition) :is(.admonition) { + margin-top: 1em; + margin-bottom: 1em; +} +:is(.admonition) > .tabbed-set:only-child { + margin-top: 0; +} +html :is(.admonition) > :last-child { + margin-bottom: 1.2rem; +} + +a.admonition-anchor-link { + display: none; + position: absolute; + left: -1.2rem; + padding-right: 1rem; +} +a.admonition-anchor-link:link, a.admonition-anchor-link:visited { + color: var(--fg); +} +a.admonition-anchor-link:link:hover, a.admonition-anchor-link:visited:hover { + text-decoration: none; +} +a.admonition-anchor-link::before { + content: "§"; +} + +:is(.admonition-title, summary.admonition-title) { + position: relative; + min-height: 4rem; + margin-block: 0; + margin-inline: -1.6rem -1.2rem; + padding-block: 0.8rem; + padding-inline: 4.4rem 1.2rem; + font-weight: 700; + background-color: rgba(68, 138, 255, 0.1); + print-color-adjust: exact; + -webkit-print-color-adjust: exact; + display: flex; +} +:is(.admonition-title, summary.admonition-title) p { + margin: 0; +} +html :is(.admonition-title, summary.admonition-title):last-child { + margin-bottom: 0; +} +:is(.admonition-title, summary.admonition-title)::before { + position: absolute; + top: 0.625em; + inset-inline-start: 1.6rem; + width: 2rem; + height: 2rem; + background-color: #448aff; + print-color-adjust: exact; + -webkit-print-color-adjust: exact; + mask-image: url('data:image/svg+xml;charset=utf-8,'); + -webkit-mask-image: url('data:image/svg+xml;charset=utf-8,'); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-size: contain; + content: ""; +} +:is(.admonition-title, summary.admonition-title):hover a.admonition-anchor-link { + display: initial; +} + +details.admonition > summary.admonition-title::after { + position: absolute; + top: 0.625em; + inset-inline-end: 1.6rem; + height: 2rem; + width: 2rem; + background-color: currentcolor; + mask-image: var(--md-details-icon); + -webkit-mask-image: var(--md-details-icon); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-size: contain; + content: ""; + transform: rotate(0deg); + transition: transform 0.25s; +} +details[open].admonition > summary.admonition-title::after { + transform: rotate(90deg); +} + +:root { + --md-details-icon: url("data:image/svg+xml;charset=utf-8,"); +} + +:root { + --md-admonition-icon--admonish-note: url("data:image/svg+xml;charset=utf-8,"); + --md-admonition-icon--admonish-abstract: url("data:image/svg+xml;charset=utf-8,"); + --md-admonition-icon--admonish-info: url("data:image/svg+xml;charset=utf-8,"); + --md-admonition-icon--admonish-tip: url("data:image/svg+xml;charset=utf-8,"); + --md-admonition-icon--admonish-success: url("data:image/svg+xml;charset=utf-8,"); + --md-admonition-icon--admonish-question: url("data:image/svg+xml;charset=utf-8,"); + --md-admonition-icon--admonish-warning: url("data:image/svg+xml;charset=utf-8,"); + --md-admonition-icon--admonish-failure: url("data:image/svg+xml;charset=utf-8,"); + --md-admonition-icon--admonish-danger: url("data:image/svg+xml;charset=utf-8,"); + --md-admonition-icon--admonish-bug: url("data:image/svg+xml;charset=utf-8,"); + --md-admonition-icon--admonish-example: url("data:image/svg+xml;charset=utf-8,"); + --md-admonition-icon--admonish-quote: url("data:image/svg+xml;charset=utf-8,"); +} + +:is(.admonition):is(.admonish-note) { + border-color: #448aff; +} + +:is(.admonish-note) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(68, 138, 255, 0.1); +} +:is(.admonish-note) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #448aff; + mask-image: var(--md-admonition-icon--admonish-note); + -webkit-mask-image: var(--md-admonition-icon--admonish-note); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-repeat: no-repeat; +} + +:is(.admonition):is(.admonish-abstract, .admonish-summary, .admonish-tldr) { + border-color: #00b0ff; +} + +:is(.admonish-abstract, .admonish-summary, .admonish-tldr) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(0, 176, 255, 0.1); +} +:is(.admonish-abstract, .admonish-summary, .admonish-tldr) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #00b0ff; + mask-image: var(--md-admonition-icon--admonish-abstract); + -webkit-mask-image: var(--md-admonition-icon--admonish-abstract); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-repeat: no-repeat; +} + +:is(.admonition):is(.admonish-info, .admonish-todo) { + border-color: #00b8d4; +} + +:is(.admonish-info, .admonish-todo) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(0, 184, 212, 0.1); +} +:is(.admonish-info, .admonish-todo) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #00b8d4; + mask-image: var(--md-admonition-icon--admonish-info); + -webkit-mask-image: var(--md-admonition-icon--admonish-info); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-repeat: no-repeat; +} + +:is(.admonition):is(.admonish-tip, .admonish-hint, .admonish-important) { + border-color: #00bfa5; +} + +:is(.admonish-tip, .admonish-hint, .admonish-important) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(0, 191, 165, 0.1); +} +:is(.admonish-tip, .admonish-hint, .admonish-important) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #00bfa5; + mask-image: var(--md-admonition-icon--admonish-tip); + -webkit-mask-image: var(--md-admonition-icon--admonish-tip); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-repeat: no-repeat; +} + +:is(.admonition):is(.admonish-success, .admonish-check, .admonish-done) { + border-color: #00c853; +} + +:is(.admonish-success, .admonish-check, .admonish-done) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(0, 200, 83, 0.1); +} +:is(.admonish-success, .admonish-check, .admonish-done) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #00c853; + mask-image: var(--md-admonition-icon--admonish-success); + -webkit-mask-image: var(--md-admonition-icon--admonish-success); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-repeat: no-repeat; +} + +:is(.admonition):is(.admonish-question, .admonish-help, .admonish-faq) { + border-color: #64dd17; +} + +:is(.admonish-question, .admonish-help, .admonish-faq) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(100, 221, 23, 0.1); +} +:is(.admonish-question, .admonish-help, .admonish-faq) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #64dd17; + mask-image: var(--md-admonition-icon--admonish-question); + -webkit-mask-image: var(--md-admonition-icon--admonish-question); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-repeat: no-repeat; +} + +:is(.admonition):is(.admonish-warning, .admonish-caution, .admonish-attention) { + border-color: #ff9100; +} + +:is(.admonish-warning, .admonish-caution, .admonish-attention) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(255, 145, 0, 0.1); +} +:is(.admonish-warning, .admonish-caution, .admonish-attention) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #ff9100; + mask-image: var(--md-admonition-icon--admonish-warning); + -webkit-mask-image: var(--md-admonition-icon--admonish-warning); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-repeat: no-repeat; +} + +:is(.admonition):is(.admonish-failure, .admonish-fail, .admonish-missing) { + border-color: #ff5252; +} + +:is(.admonish-failure, .admonish-fail, .admonish-missing) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(255, 82, 82, 0.1); +} +:is(.admonish-failure, .admonish-fail, .admonish-missing) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #ff5252; + mask-image: var(--md-admonition-icon--admonish-failure); + -webkit-mask-image: var(--md-admonition-icon--admonish-failure); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-repeat: no-repeat; +} + +:is(.admonition):is(.admonish-danger, .admonish-error) { + border-color: #ff1744; +} + +:is(.admonish-danger, .admonish-error) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(255, 23, 68, 0.1); +} +:is(.admonish-danger, .admonish-error) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #ff1744; + mask-image: var(--md-admonition-icon--admonish-danger); + -webkit-mask-image: var(--md-admonition-icon--admonish-danger); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-repeat: no-repeat; +} + +:is(.admonition):is(.admonish-bug) { + border-color: #f50057; +} + +:is(.admonish-bug) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(245, 0, 87, 0.1); +} +:is(.admonish-bug) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #f50057; + mask-image: var(--md-admonition-icon--admonish-bug); + -webkit-mask-image: var(--md-admonition-icon--admonish-bug); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-repeat: no-repeat; +} + +:is(.admonition):is(.admonish-example) { + border-color: #7c4dff; +} + +:is(.admonish-example) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(124, 77, 255, 0.1); +} +:is(.admonish-example) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #7c4dff; + mask-image: var(--md-admonition-icon--admonish-example); + -webkit-mask-image: var(--md-admonition-icon--admonish-example); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-repeat: no-repeat; +} + +:is(.admonition):is(.admonish-quote, .admonish-cite) { + border-color: #9e9e9e; +} + +:is(.admonish-quote, .admonish-cite) > :is(.admonition-title, summary.admonition-title) { + background-color: rgba(158, 158, 158, 0.1); +} +:is(.admonish-quote, .admonish-cite) > :is(.admonition-title, summary.admonition-title)::before { + background-color: #9e9e9e; + mask-image: var(--md-admonition-icon--admonish-quote); + -webkit-mask-image: var(--md-admonition-icon--admonish-quote); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-repeat: no-repeat; +} + +.navy :is(.admonition) { + background-color: var(--sidebar-bg); +} + +.ayu :is(.admonition), +.coal :is(.admonition) { + background-color: var(--theme-hover); +} + +.rust :is(.admonition) { + background-color: var(--sidebar-bg); + color: var(--sidebar-fg); +} +.rust .admonition-anchor-link:link, .rust .admonition-anchor-link:visited { + color: var(--sidebar-fg); +}