From a75e26bc1176f7658350820ff20d62bae4d48be9 Mon Sep 17 00:00:00 2001 From: Soitora Date: Wed, 6 Sep 2023 21:52:47 +0200 Subject: [PATCH] Expand Shortcodes Should they be colored green? Hmm Fixes #1 --- website/src/.vitepress/config/shortcodes.ts | 86 +++++++++++++------ website/src/.vitepress/theme/styles/base.styl | 8 +- .../src/docs/faq/application/browse/index.md | 6 +- .../faq/application/browse/local-sources.md | 4 +- website/src/docs/faq/application/downloads.md | 2 +- website/src/docs/faq/application/index.md | 2 +- website/src/docs/faq/application/library.md | 10 +-- website/src/docs/faq/application/shizuku.md | 2 +- website/src/docs/faq/extensions.md | 2 +- website/src/docs/faq/miscellaneous.md | 8 +- website/src/docs/guides/backups.md | 4 +- website/src/docs/guides/categories.md | 2 +- website/src/docs/guides/local-series/index.md | 2 +- website/src/docs/guides/source-migration.md | 9 -- website/src/docs/guides/tracking.md | 6 +- .../guides/troubleshooting/common-issues.md | 6 +- .../docs/guides/troubleshooting/diagnosis.md | 6 +- .../src/docs/guides/troubleshooting/index.md | 6 +- website/src/sandbox/index.md | 59 ++++++++++++- 19 files changed, 156 insertions(+), 74 deletions(-) diff --git a/website/src/.vitepress/config/shortcodes.ts b/website/src/.vitepress/config/shortcodes.ts index be9fdef7..1b932bf1 100644 --- a/website/src/.vitepress/config/shortcodes.ts +++ b/website/src/.vitepress/config/shortcodes.ts @@ -1,28 +1,59 @@ +const iconMappings = { + alertDecagramOutline: ``, + backupRestore: ``, + bookmarkBoxOutline: ``, + bookOpenOutline: ``, + cloudOffOutline: ``, + codeTags: ``, + cog: ``, + compassOutline: ``, + dotsHorizontal: ``, + downloadOutline: ``, + glasses: ``, + helpCircleOutline: ``, + history: ``, + informationOutline: ``, + labelOutline: ``, + paletteOutline: ``, + queryStats: ``, + security: ``, + sync: ``, +} + const navigationMappings = { - more: { - name: "More", - title: "More menu", - icon: `dots-horizontal`, - }, - settings: { - name: "Settings", - title: "Settings menu", - icon: `cog`, - dependsOn: "more", - }, - reader: { - name: "Reader", - title: "Reader menu", - icon: `book-open-outline`, - dependsOn: "settings", - }, - advanced: { - name: "Advanced", - title: "Advanced menu", - icon: `code-tags`, - dependsOn: "settings", - }, -}; + // Main menus + "main_library": { name: "Library", icon: iconMappings["bookmarkBoxOutline"] }, + "main_updates": { name: "Updates", icon: iconMappings["alertDecagramOutline"] }, + "main_history": { name: "History", icon: iconMappings["history"] }, + "main_browse": { name: "Browse", icon: iconMappings["compassOutline"] }, + "main_more": { name: "More", icon: iconMappings["dotsHorizontal"] }, + + // Browse menu + "sources": { name: "Sources", dependsOn: "main_browse" }, + "extensions": { name: "Extensions", dependsOn: "main_browse" }, + "migrate": { name: "Migrate", dependsOn: "main_browse" }, + + // More menu + "downloaded-only": { name: "Downloaded only", icon: iconMappings["cloudOffOutline"], dependsOn: "main_more" }, + "incognito-mode": { name: "Incognito mode", icon: iconMappings["glasses"], dependsOn: "main_more" }, + "download-queue": { name: "Download queue", icon: iconMappings["downloadOutline"], dependsOn: "main_more" }, + "categories": { name: "Categories", icon: iconMappings["labelOutline"], dependsOn: "main_more" }, + "statistics": { name: "Statistics", icon: iconMappings["queryStats"], dependsOn: "main_more" }, + "backup-and-restore": { name: "Backup and restore", icon: iconMappings["backupRestore"], dependsOn: "main_more" }, + "settings": { name: "Settings", icon: iconMappings["cog"], dependsOn: "main_more" }, + "about": { name: "About", icon: iconMappings["informationOutline"], dependsOn: "main_more" }, + "help": { name: "Help", icon: iconMappings["helpCircleOutline"], dependsOn: "main_more" }, + + // Settings submenu + "appearance": { name: "Appearance", icon: iconMappings["paletteOutline"], dependsOn: "settings" }, + "library": { name: "Library", icon: iconMappings["bookmarkBoxOutline"], dependsOn: "settings" }, + "downloads": { name: "Downloads", icon: iconMappings["downloadOutline"], dependsOn: "settings" }, + "tracking": { name: "Tracking", icon: iconMappings["sync"], dependsOn: "settings" }, + "browse": { name: "Browse", icon: iconMappings["compassOutline"], dependsOn: "settings" }, + "security-and-privacy": { name: "Security and privacy", icon: iconMappings["security"], dependsOn: "settings" }, + "reader": { name: "Reader", icon: iconMappings["bookOpenOutline"], dependsOn: "settings" }, + "advanced": { name: "Advanced", icon: iconMappings["codeTags"], dependsOn: "settings" }, +} function generateNavigationHtml(navKey) { const navData = navigationMappings[navKey]; @@ -31,12 +62,13 @@ function generateNavigationHtml(navKey) { return "Unsupported Navigation!"; } - const { name, title, icon, dependsOn } = navData; + const { name, icon, dependsOn } = navData; - let html = `${icon}${name}`; + const iconHtml = icon ? icon : ''; + let html = `${iconHtml}${name}`; if (dependsOn) { - html = generateNavigationHtml(dependsOn) + ` → ` + html; + html = `${generateNavigationHtml(dependsOn)} -> ${html}`; } return html; diff --git a/website/src/.vitepress/theme/styles/base.styl b/website/src/.vitepress/theme/styles/base.styl index 246b866b..847a374d 100644 --- a/website/src/.vitepress/theme/styles/base.styl +++ b/website/src/.vitepress/theme/styles/base.styl @@ -194,17 +194,19 @@ main :where(h1, h2, h3, h4, h5, h6) + figure { * -------------------------------------------------------------------------- */ .navigation { - color: var(--vp-c-text-2) + color: var(--vp-c-green-2) font-weight: 600 &:hover { - color: var(--vp-c-text-1) - cursor: help + color: var(--vp-c-green-1) + cursor: default } svg, span.name { vertical-align: middle // Align both SVG and vertically + position: relative + bottom: 1px } svg { diff --git a/website/src/docs/faq/application/browse/index.md b/website/src/docs/faq/application/browse/index.md index a2e865d5..cf673d1f 100644 --- a/website/src/docs/faq/application/browse/index.md +++ b/website/src/docs/faq/application/browse/index.md @@ -9,10 +9,10 @@ Frequently Asked Questions about Browse. ## Why Can't I See Installed Sources? ### If the Extension Language Differs from Your Phone's Primary Language -Enable the source's language at **Browse -> Sources -> Filter**, then turn on the language of the desired source. +Enable the source's language at