From c3f0df34f70a5b705cd3d4c1349c4bd231b558f0 Mon Sep 17 00:00:00 2001 From: Miroma <136986257+its-miroma@users.noreply.github.com> Date: Tue, 11 Feb 2025 18:42:57 +0100 Subject: [PATCH] some formatting --- .github/workflows/markdownlint.yml | 4 +- .vitepress/i18n.ts | 4 +- .vitepress/sidebars/develop.ts | 72 +++++++++---------- .vitepress/sidebars/versioned/1.20.4.json | 4 +- .vitepress/sidebars/versioned/1.21.json | 2 +- .../theme/components/VersionReminder.vue | 2 +- .../theme/components/VersionSwitcher.vue | 19 +++-- .vitepress/theme/style.css | 32 +++++---- .vscode/settings.json | 14 +++- 9 files changed, 87 insertions(+), 66 deletions(-) diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index a9ec4e295..70d9f6996 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -34,8 +34,8 @@ jobs: config: .markdownlint-cli2.yaml globs: | **/*.md - !README.md - !**/node_modules !**/.git + !**/node_modules + !README.md !translated/** !versions/** diff --git a/.vitepress/i18n.ts b/.vitepress/i18n.ts index 3592bcae9..98b29c055 100644 --- a/.vitepress/i18n.ts +++ b/.vitepress/i18n.ts @@ -223,7 +223,9 @@ function generateTranslatedThemeConfig(localeCode: string): Fabric.ThemeConfig { footer: { copyright: websiteResolver("footer.copyright").replace( "%s", - `${websiteResolver("footer.license")}` + `${websiteResolver( + "footer.license" + )}` ), message: websiteResolver("footer.message"), }, diff --git a/.vitepress/sidebars/develop.ts b/.vitepress/sidebars/develop.ts index d9efb8e3c..6950f9d9a 100644 --- a/.vitepress/sidebars/develop.ts +++ b/.vitepress/sidebars/develop.ts @@ -82,7 +82,7 @@ export default [ }, { text: "develop.items.custom-enchantment-effects", - link: "/develop/items/custom-enchantment-effects" + link: "/develop/items/custom-enchantment-effects", }, { text: "develop.items.custom-data-components", @@ -113,9 +113,9 @@ export default [ { text: "develop.blocks.block-entity-renderer", link: "/develop/blocks/block-entity-renderer", - } - ] - } + }, + ], + }, ], }, { @@ -209,38 +209,38 @@ export default [ ], }, { - text: "develop.dataGeneration", - collapsed: true, - items: [ - { - text: "develop.dataGeneration.setup", - link: "/develop/data-generation/setup" - }, - { - text: "develop.dataGeneration.tags", - link: "/develop/data-generation/tags" - }, - { - text: "develop.dataGeneration.translations", - link: "/develop/data-generation/translations" - }, - { - text: "develop.dataGeneration.advancements", - link: "/develop/data-generation/advancements" - }, - { - text: "develop.dataGeneration.recipes", - link: "/develop/data-generation/recipes" - }, - { - text: "develop.dataGeneration.lootTables", - link: "/develop/data-generation/loot-tables" - }, - { - text: "develop.dataGeneration.blockModels", - link: "/develop/data-generation/block-models" - } - ] + text: "develop.dataGeneration", + collapsed: true, + items: [ + { + text: "develop.dataGeneration.setup", + link: "/develop/data-generation/setup", + }, + { + text: "develop.dataGeneration.tags", + link: "/develop/data-generation/tags", + }, + { + text: "develop.dataGeneration.translations", + link: "/develop/data-generation/translations", + }, + { + text: "develop.dataGeneration.advancements", + link: "/develop/data-generation/advancements", + }, + { + text: "develop.dataGeneration.recipes", + link: "/develop/data-generation/recipes", + }, + { + text: "develop.dataGeneration.lootTables", + link: "/develop/data-generation/loot-tables", + }, + { + text: "develop.dataGeneration.blockModels", + link: "/develop/data-generation/block-models", + }, + ], }, { text: "develop.misc", diff --git a/.vitepress/sidebars/versioned/1.20.4.json b/.vitepress/sidebars/versioned/1.20.4.json index 609a3e875..8dcc57065 100644 --- a/.vitepress/sidebars/versioned/1.20.4.json +++ b/.vitepress/sidebars/versioned/1.20.4.json @@ -73,13 +73,13 @@ }, { "text": "Yarn GitHub", - "processSidebarURLs": false, + "processSidebarURLs": false, "translatable": false, "link": "https://github.com/FabricMC/yarn" }, { "text": "Loom GitHub", - "processSidebarURLs": false, + "processSidebarURLs": false, "translatable": false, "link": "https://github.com/FabricMC/fabric-loom" } diff --git a/.vitepress/sidebars/versioned/1.21.json b/.vitepress/sidebars/versioned/1.21.json index 337f41627..9dbba1edf 100644 --- a/.vitepress/sidebars/versioned/1.21.json +++ b/.vitepress/sidebars/versioned/1.21.json @@ -324,4 +324,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/.vitepress/theme/components/VersionReminder.vue b/.vitepress/theme/components/VersionReminder.vue index d0fd2764f..5a8fa5e3e 100644 --- a/.vitepress/theme/components/VersionReminder.vue +++ b/.vitepress/theme/components/VersionReminder.vue @@ -163,4 +163,4 @@ p.version { gap: 8px; } } - \ No newline at end of file + diff --git a/.vitepress/theme/components/VersionSwitcher.vue b/.vitepress/theme/components/VersionSwitcher.vue index 425beac9a..64f7b0b14 100644 --- a/.vitepress/theme/components/VersionSwitcher.vue +++ b/.vitepress/theme/components/VersionSwitcher.vue @@ -68,10 +68,16 @@ function buildRoutePath( // e.g. /en/ -> /en/1.2.0/ or /en/1.2.0/ -> /en/1.3.0/ if (!isOnLatest) { if (version === props.versioningPlugin.latestVersion) { - return currentPath.replace(`/${locale}/${currentVersion.value}/`, `/${locale}/`); + return currentPath.replace( + `/${locale}/${currentVersion.value}/`, + `/${locale}/` + ); } else { // Replace any existing version segment with the new one - return currentPath.replace(`/${locale}/${currentVersion.value}/`, `/${locale}/${version}/`); + return currentPath.replace( + `/${locale}/${currentVersion.value}/`, + `/${locale}/${version}/` + ); } } else { // If currently on latest, just add the new version segment @@ -95,12 +101,15 @@ function buildRoutePath( // Navigate to the selected version function visitVersion(version: string) { const localeKeys = Object.keys(data.site.value.locales); - const isLocalized = localeKeys.some((key) => router.route.path.startsWith(`/${key}/`)); + const isLocalized = localeKeys.some((key) => + router.route.path.startsWith(`/${key}/`) + ); const locale = isLocalized ? localeKeys.find((key) => router.route.path.startsWith(`/${key}/`)) || null : null; - const isOnLatest = currentVersion.value === props.versioningPlugin.latestVersion; + const isOnLatest = + currentVersion.value === props.versioningPlugin.latestVersion; const route = buildRoutePath(router.route.path, locale, version, isOnLatest); router.go(route); @@ -257,4 +266,4 @@ function visitVersion(version: string) { .group + .item { padding-top: 4px; } - \ No newline at end of file + diff --git a/.vitepress/theme/style.css b/.vitepress/theme/style.css index 28a105032..ac84b7b32 100644 --- a/.vitepress/theme/style.css +++ b/.vitepress/theme/style.css @@ -8,7 +8,7 @@ font-family: "Flag Emoji Polyfill"; unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F; - src: url("./CountryFlagsPolyfill.woff2") format('woff2'); + src: url("./CountryFlagsPolyfill.woff2") format("woff2"); font-display: swap; } @@ -24,23 +24,25 @@ --vp-c-brand-3: var(--vp-c-blue-1); --vp-c-brand-soft: var(--vp-c-blue-soft); - /* Override Hero Text Gradient */ --vp-home-hero-name-color: transparent; - --vp-home-hero-name-background: -webkit-linear-gradient(120deg, - #3463fe 30%, - #4787ff); + --vp-home-hero-name-background: -webkit-linear-gradient( + 120deg, + #3463fe 30%, + #4787ff + ); /* Flag Emoji Polyfill (Chrome does not render county flags on windows) */ - --vp-font-family-base: 'Flag Emoji Polyfill', 'Inter', ui-sans-serif, system-ui, sans-serif, - 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; + --vp-font-family-base: "Flag Emoji Polyfill", "Inter", ui-sans-serif, + system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", "Noto Color Emoji"; } :root:where(:lang(zh)) { /* Flag Emoji Polyfill (Chrome does not render county flags on windows) */ - --vp-font-family-base: 'Flag Emoji Polyfill', 'Punctuation SC', 'Inter', ui-sans-serif, system-ui, - sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', - 'Noto Color Emoji'; + --vp-font-family-base: "Flag Emoji Polyfill", "Punctuation SC", "Inter", + ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", "Noto Color Emoji"; } /* Sidebar Scrollbar - Styles scrollbars within the side navigation pane for improved visibility. */ @@ -90,12 +92,12 @@ } /* Local Search Box Animations - Fade in backdrop and animate search box on appearance. */ -.VPLocalSearchBox>.backdrop { +.VPLocalSearchBox > .backdrop { opacity: 0; animation: show 200ms 100ms cubic-bezier(0.38, 0.97, 0.56, 0.76) forwards; } -.VPLocalSearchBox>.shell { +.VPLocalSearchBox > .shell { animation: show 400ms 100ms cubic-bezier(0.38, 0.97, 0.56, 0.76) forwards; opacity: 0; transform: rotateX(-90deg); @@ -137,8 +139,8 @@ kbd:not(.DocSearch-Button-Key) { } /* Center images within paragraphs. */ -.vp-doc>p>img, -.vp-doc>div>p>img { +.vp-doc > p > img, +.vp-doc > div > p > img { margin-left: auto; margin-right: auto; } @@ -154,4 +156,4 @@ h1.vp-doc { /* Custom Icons */ .vpi-versioning { --icon: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iNjRweCIgaGVpZ2h0PSI2NHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHN0cm9rZS13aWR0aD0iMi4yIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGNvbG9yPSIjMDAwMDAwIj48cGF0aCBkPSJNMTcgN0MxOC4xMDQ2IDcgMTkgNi4xMDQ1NyAxOSA1QzE5IDMuODk1NDMgMTguMTA0NiAzIDE3IDNDMTUuODk1NCAzIDE1IDMuODk1NDMgMTUgNUMxNSA2LjEwNDU3IDE1Ljg5NTQgNyAxNyA3WiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIuMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48L3BhdGg+PHBhdGggZD0iTTcgN0M4LjEwNDU3IDcgOSA2LjEwNDU3IDkgNUM5IDMuODk1NDMgOC4xMDQ1NyAzIDcgM0M1Ljg5NTQzIDMgNSAzLjg5NTQzIDUgNUM1IDYuMTA0NTcgNS44OTU0MyA3IDcgN1oiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLXdpZHRoPSIyLjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PC9wYXRoPjxwYXRoIGQ9Ik07IDIxQzguMTA0NTcgMjEgOSAyMC4xMDQ2IDkgMTlDOSAxNy44OTU0IDguMTA0NTcgMTcgNyAxN0M1Ljg5NTQzIDE3IDUgMTcuODk1NCA1IDE5QzUgMjAuMTA0NiA1Ljg5NTQzIDIxIDcgMjFaIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD48cGF0aCBkPSJNNyA3VjE3IiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD48cGF0aCBkPSJNMTcgN1Y4QzE3IDEwLjUgMTUgMTEgMTUgMTFMOSAxM0M5IDEzIDcgMTMuNSA3IDE2VjE3IiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9yZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD48L3N2Zz4="); -} \ No newline at end of file +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 7568e20f6..f26159564 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,9 +1,17 @@ { + "explorer.autoRevealExclude": { + "versions/**": true + }, + "explorer.excludeGitIgnore": true, + "files.exclude": { + "translated/**": true, + "versions/**": true + }, "markdownlint.lintWorkspaceGlobs": [ "**/*.md", - "!**/node_modules", - "!versions/**", + "!node_modules/**", + "!README.md", "!translated/**", - "!README.md" + "!versions/**" ] }