diff --git a/README/README_ZH_CN.md b/README/README_ZH_CN.md new file mode 100644 index 00000000..95864db2 --- /dev/null +++ b/README/README_ZH_CN.md @@ -0,0 +1,32 @@ +# Sinytra Minecraft 模组维基 + +欢迎来到 Minecraft 模组维基,这是一个供所有人托管和分享他们的模组文档的公共平台。 + +Minecraft 模组维基旨在满足 Minecraft 模组制作者和玩家的需求。它提供了直观的导航,清晰的用户界面,模组浏览器以及供作者轻松编写文档的功能。 + +这些功能包括版本控制,本地化,自定义组件(配方,资源等), gradle 集成,项目管理等等。 + +- 🌐 **本地化**:将您的文档翻译成世界语言 +- 🚹 **可访问性**:直观且响应式的用户界面 +- 🤝 **开放**:让您的用户无需任何编程知识即可参与贡献 +- 💸 **免费**:在我们的网站上托管文档完全免费! + +## 作者 + +本仓库的 `example` 目录中包含一个示例文档设置。 + +## 开发 + +1. 将 `.env.local.example` 重命名为 `.env.local` +2. 创建一个新的 [GitHub 应用程序](https://github.com/settings/apps/new)。填写以下信息: + - `APP_AUTH_GITHUB_ID` - 应用程序 ID + - `APP_AUTH_GITHUB_PRIVATE_KEY` - 生成的 [私钥](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps) + - `AUTH_GITHUB_ID` - 客户端 ID + - `AUTH_GITHUB_SECRET` - 客户端密钥 +3. 运行 `npm run dev` 启动应用程序 + +您可以在 `LOCAL_DOCS_ROOTS` 环境变量中列出所需的本地文档源,如示例所示。 + +## 致谢 + +_(请参阅英文 README 的 Credits 部分)_ diff --git a/docs/about/zh_cn.mdx b/docs/about/zh_cn.mdx index 64b288e2..57aadf0b 100644 --- a/docs/about/zh_cn.mdx +++ b/docs/about/zh_cn.mdx @@ -1,32 +1,26 @@ -# About +# 关于 -Welcome to the Modded Minecraft Wiki, a common place for everyone to host and share documentation of their mods. +欢迎来到 Minecraft 模组维基,这是一个供所有人托管和分享他们的模组文档的公共平台。 -The Modded Minecraft Wiki is built to suit the very needs of Minecraft modders and players alike. It provides -intuitive navigation, a clean user interface, mod browser and features for authors to make writing documentation -a piece of cake. +Minecraft 模组维基旨在满足 Minecraft 模组制作者和玩家的需求。它提供了直观的导航,清晰的用户界面,模组浏览器以及供作者轻松编写文档的功能。 -These include versioning, localization, custom components (recipes, assets, etc.), gradle integration, -project management and more. +这些功能包括版本控制,本地化,自定义组件(配方,资源等), gradle 集成,项目管理等等。 -- 🌐 **Localization**: Translate your docs into world languages -- 🚹 **Accessible**: Intuitive and responsive user interface -- 🤝 **Open**: Let your users contribute without any programming knowledge necessary -- 💸 **Free**: Hosting docs on our website is completely free of charge! +- 🌐 **本地化**:将您的文档翻译成世界语言 +- 🚹 **可访问性**:直观且响应式的用户界面 +- 🤝 **开放**:让您的用户无需任何编程知识即可参与贡献 +- 💸 **免费**:在我们的网站上托管文档完全免费! -## Who we are +## 我们是谁 -The Wiki is built and mainained by [Sinytra](https://github.com/Sinytra), a team of passionate developers creating -Free and Open Source common Minecraft modding software. +这个 Wiki 是由 [Sinytra](https://github.com/Sinytra) 构建和维护的, Sinytra 是一个充满激情的开发者团队,致力于创建免费和开源的Minecraft模组通用软件。 -If you like our work, feel free to check out our [other projects](https://github.com/Sinytra) found on our GitHub page ❤️. +如果您喜欢我们的工作,请随时查看我们在 GitHub 页面上的[其他项目](https://github.com/Sinytra) ❤️。 -## Contributing +## 贡献 -### Mod documentation +### 模组文档 -To edit a mod documentation page, use the `Edit page on GitHub` button found at the bottom of the right side panel. +要编辑一个模组文档页面,请使用右侧边栏底部找到的`在 GitHub 上编辑页面`按钮。 -As mod documentation is sourced from GitHub repositories, you can either use the GitHub web editor, or clone the -repository and make changes locally. Then, once you're done making changes, you can submit a Pull Request to the -upstream repository and wait for it to be reviewed / merged by a maintainer. +由于模组文档来源于 GitHub 仓库,您可以使用 GitHub 网络编辑器,或者克隆仓库并在本地进行更改。然后,一旦您完成更改,您可以向上游仓库提交一个 Pull Request ,并等待维护者进行审查/合并。 diff --git a/docs/community/zh_cn.mdx b/docs/community/zh_cn.mdx index 684c4e75..26674dcd 100644 --- a/docs/community/zh_cn.mdx +++ b/docs/community/zh_cn.mdx @@ -1,54 +1,47 @@ -# Community Mod Documentation +# 社区模组文档 -**🌐 The central repository for community documentation can be found [here](https://github.com/Sinytra/CommunityWikiDocs).** +**🌐 社区文档的中心仓库可以在[这里](https://github.com/Sinytra/CommunityWikiDocs)找到。** -The README of the repo is displayed below: +以下是该仓库的 README 内容: --- -[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/Sinytra/CommunityWikiDocs?quickstart=1) +[![在 GitHub Codespaces 中打开](https://github.com/codespaces/badge.svg)](https://codespaces.new/Sinytra/CommunityWikiDocs?quickstart=1) -A collection of community documentation for the [Modded Minecraft Wiki](https://moddedmc.org/). +为[Minecraft模组维基](https://moddedmc.org/)收集的社区文档。 -📖 This repository serves as a source of unofficial documentation for minecraft mods contributed by the community -and maintained by the Modded Minecraft Wiki developer team / Sinytra. +📖 这个仓库作为由社区贡献并由Minecraft模组维基开发者团队/Sinytra维护的非官方模组文档的来源。 -📂 Each subdirectory (with the exception of `gradle`) contains a Wiki project with documentation files and metadata. -Registration of projects to the Wiki is handled automatically. +📂 每个子目录(`gradle`除外)都包含一个Wiki项目,其中包含文档文件和元数据。项目的Wiki注册是自动处理的。 -## 🤝 Contributing +## 🤝 贡献 -We welcome all contributions - no coding knowledge is required! +我们欢迎所有贡献 - 无需编码知识! -1. Start by opening the repository in your favourite editor or IDE.\ - You can also use [GitHub Codespaces](https://codespaces.new/Sinytra/CommunityWikiDocs?quickstart=1) in the browser - for a quick setup (supports live previews, too!). +1. 首先在您喜欢的编辑器或 IDE 中打开仓库。\ +您还可以在浏览器中使用[GitHub Codespaces](https://codespaces.new/Sinytra/CommunityWikiDocs?quickstart=1)进行快速设置(也支持实时预览!)。 -2. Launch a local preview by running `./gradlew previewDocs` in the terminal and wait until the environment has finished - setting up. +2. 在终端中运行 `./gradlew previewDocs` 启动本地预览,并等待环境设置完成。 -3. Once the preview instance is ready, the editor will prompt you to open it in a new tab. Click `Open in Browser`.\ - Alternatively, you can find a link in the `PORTS` tab next to the terminal. +3. 一旦预览实例准备好,编辑器将提示您在新标签页中打开它。点击`在浏览器中打开`。\ +或者,您可以在终端旁边的`PORTS`标签中找到一个链接。 -4. You're ready to start editing docs! 🎉 +4. 您现在可以开始编辑文档了! 🎉 -To learn more about the documentation file format used, see [this page](https://moddedmc.org/en/about/format). +要了解有关使用的文档文件格式的更多信息,请参阅[这个页面](https://moddedmc.org/en/about/format)。 -### Existing projects +### 现有项目 -Making changes to existing projects is fairly simple. Find the project you'd like to update and make desired changes -to documentation files. Once you're done, commit your working tree and [create a Pull Request](https://github.com/Sinytra/CommunityWikiDocs/compare) -with your changes. +对现有项目进行更改相当简单。找到您想要更新的项目,并按照需要对文档文件进行更改。完成后,提交您的工作树并使用您的更改[创建一个Pull Request](https://github.com/Sinytra/CommunityWikiDocs/compare)。 -### New projects +### 新项目 -Adding new projects can be done in two easy steps: +添加新项目可以通过两个简单步骤完成: -1. Create a subdirectory for the mod you're going to document. The name of this directory should match the value of the - `id` field in the project [metadata file](https://moddedmc.org/en/about/devs#wiki-metadata). +1. 为您将要记录的模组创建一个子目录。这个目录的名称应该与项目[元数据文件](https://moddedmc.org/en/about/devs#wiki-metadata)中的`id`字段的值相匹配。 -2. Add the name of the subdirectory to the `documentation_roots` property inside `gradle.properties`. +2. 将子目录的名称添加到`gradle.properties`文件中的`documentation_roots`属性。 -## ✍️ Become an editor +## ✍️ 成为编辑 -(Registration coming soon, stay tuned!) +(注册开放即将到来,敬请期待!) diff --git a/docs/devs/zh_cn.mdx b/docs/devs/zh_cn.mdx index 51b7c73a..f1815bb0 100644 --- a/docs/devs/zh_cn.mdx +++ b/docs/devs/zh_cn.mdx @@ -3,40 +3,37 @@ import ModrinthIcon from "../../components/ui/icons/ModrinthIcon.tsx"; import CurseForgeIcon from "../../components/ui/icons/CurseForgeIcon.tsx"; import GradleIcon from "../../components/ui/icons/GradleIcon.tsx"; -# Developers +# 开发者 -Get started hosting your mod's documentation on our wiki! +开始在我们的维基上托管您的模组文档! -This guide provides information on local development and the documentation format. -For a guide on publishing docs onto our website, please see the [Publishing](./publishing) page instead. +本指南提供了本地开发和文档格式的信息。有关在我们的网站上发布文档的指南,请参阅[发布](./publishing)页面。 -## Prerequisites +## 前期准备 -In order to start hosting documentation on our wiki, your mod only needs to meet a few minimal requirements: +为了开始在 我们的维基 上托管文档,您的模组只需要满足一些基本要求: -- Be hosted on a GitHub repository - (both private and public repositories work!) -- Be approved on either - [Modrinth](https://modrinth.com/) or +- 存放在一个 GitHub 仓库中 +(私有和公共仓库都可以!) +- 在以下任一平台上获得批准 + [Modrinth](https://modrinth.com/) 或 [CurseForge](https://www.curseforge.com/) -- Have the GitHub repository linked as the mod's source code url on the respective hosting website\ - (this is currently required to verify project ownership) +- 在相应的托管网站上,将GitHub仓库链接为模组的源代码URL +(目前这是验证项目所有权的必要步骤) -Additionally, the person registering the project to the wiki should have **Maintain** or **Admin** access to its -GitHub repository. +另外,注册项目到维基的人员应该对其GitHub仓库拥有 **维护** 或 **管理员** 访问权限。 -## Folder structure +## 文件夹结构 -Start by creating a new directory inside your project. This can be located at any path of your choice.\ -For example, you can use `docs/(your modid here)` or simply `docs`, both are equally valid. +首先,在您的项目内部创建一个新目录。这个目录可以位于您选择的任何路径上。 +例如,您可以使用 `docs/(您的模组ID)` 或者简单的 `docs`,这两个都是同样有效的。 - We also support scenarios where multiple mods' documentation is hosted in a single repository, as long as they're in - separate folders. - This is useful if you'd like to host documentation for multiple of your mods in a single place. + 我们还支持在单个仓库中托管多个模组的文档的情况,只要它们位于不同的文件夹中。 + 如果您想在同一个地方为您的多个模组托管文档,这将会很有用。 -A minimal example folder layout may look like this: +一个最简单的示例文件夹布局如下所示: ``` docs @@ -49,9 +46,9 @@ docs ```
- Show complete example + 展示完整示例 - Here is a complete example including assets and translations. + 这里是包含资源和翻译的完整示例。 ``` docs @@ -73,71 +70,55 @@ docs ```
-Let's talk about what each of these files does: +让我们来了解这些文件各自的作用: +- `sinytra-wiki.json`:主要的元数据文件,是文档包的“心脏”,携带有关项目的信息。 +关于其内容格式,请参见下面的完整解释。 +- `_meta.json`:可以放置在根文件夹以及每个子文件夹中。为文件和文件夹提供显示名称, +这些名称将显示在维基的文档导航侧边栏中,并指定它们显示的顺序。如果未提供,将自动生成后备显示名称。 +- `*.mdx` 文件:包含文档内容。要了解更多关于MDX格式的信息,请访问他们的 +[网站](https://mdxjs.com/)。由于MDX编译为JavaScript,维基对除了标准Markdown之外可以使用的组件和标签施加了某些限制。 +关于完整的描述,请继续阅读下面内容。 -- `sinytra-wiki.json`: The main metadata file, the "heart" of the documentation package, carries information about the - project. For its content format, see the complete explanation below. -- `_meta.json`: Can be placed in the root folder as well as each subfolder. Provides display names for files and - folders, which are shown in the documentation navigation sidebar on the wiki, and also specifies the order in which - they are displayed. If not provided, fallback display names are generated automatically. -- `*.mdx` files: Contain documentation contents. To learn more about the MDX format, please see their - [website](https://mdxjs.com/). As MDX compiles to JavaScript, the Wiki imposes certain restrictions on what components - and tags can be used in addition to standard Markdown. For a complete description, please read below. -### Assets +### 资源 - Save yourself time manually exporting all assets using our companion [**Gradle plugin**](#-gradle-plugin-companion), - which integrates with popular mod loader toolchains and can **automatically generate rendered assets** for you! + 使用我们的配套 [**Gradle插件**](#-gradle-plugin-companion) 来节省您手动导出所有资源的时间, + 该插件与流行的模组加载器工具链集成,并且可以为您 **自动生成渲染后的资源**! -Assets are used to display images of items, blocks and other mod content across the website. These can be used as part -of crafting recipes, sidebar information or custom components. +资源用于在网站上展示物品、方块和其他模组内容的图片。这些资源可以用于制作配方、侧边栏信息或自定义组件的一部分。 -Assets are identified using [resource locations](https://minecraft.wiki/w/Resource_location) using the same syntax as -in the game itself. It's recommened to match asset names with the in-game IDs of the objects they belong to. +资源使用 [资源位置](https://minecraft.wiki/w/Resource_location) 来识别,其语法与游戏中的相同。建议将资源名称与它们所属对象的的游戏内ID匹配。 -Rendered mod assets including **both items and blocks** should be placed under `.assets/item/(modid)` inside the -documentation directory, where `modid` is the namespace of each texture you wish to provide. +渲染后的模组资源,包括 **物品和方块**,应放置在文档目录下的 `.assets/item/(modid)` 中,其中 `modid` 是您希望提供的每个纹理的命名空间。 -Each asset **must be in `.png` format**. The name of the file is up to your choice. +每个资源 **必须是 `.png` 格式**。文件的名称由您自行决定。 -For example, `examplemod:generator` would point to `(root)/.assets/item/examplemod/generator.png`. +例如,`examplemod:generator` 将指向 `(根目录)/.assets/item/examplemod/generator.png`。 -### Translation +### 翻译 -Documentation can be localized into various languages supported by the wiki. A complete list can be found in the -language selection dropdown located on the right-most part of the navigation header. +文档可以通过维基支持的各种语言进行本地化。完整的语言列表可以在导航栏最右侧的语言选择下拉菜单中找到。 -Localized files must be placed under `.translated/(lang)` inside the documentation directory, where -`(lang)` is the desired language code in `(lang)_(region)` format. Currently, all regions match the language, so -it's sufficient to take the target language code and complete the region to be the same as the language -(e.g. German translations (`de`) would be placed under `.translated/de_de`). +本地化文件必须放置在文档目录下的 `.translated/(lang)` 中,其中 `(lang)` 是所需的语言代码,格式为 `(lang)_(region)`。目前,所有地区都与语言匹配,因此只需取目标语言代码,并将地区设置为与语言相同(例如,德语翻译(`de`)应放置在 `.translated/de_de` 下)。 -The localized folder structure follows the same layout as root. Both documentation content files (`.mdx`) and folder -metadata (`_meta.json`) may be translated. Translated content takes precedence over the default locale when being -loaded. However, untranslated files will still be shown even when the locale is non-default, therefore it is -recommended to translate all files whenever possible. +本地化文件夹结构遵循与根目录相同的布局。文档内容文件(`.mdx`)和文件夹元数据(`_meta.json`)都可以被翻译。加载时,翻译后的内容会优先于默认语言环境。然而,即使语言环境不是默认的,未翻译的文件仍然会被显示,因此建议尽可能翻译所有文件。 -### Custom homepage -The wiki provides a dedicated landing page for documentation called the "Mod homepage". By default, this shows the -linked platform project's description. +### 自定义主页 -If you'd like to provide your own contents instead, you can do so by creating a `_homepage.mdx` file in your -documentation's root folder (at the same level as `sinytra-wiki.json`). The file's contents follow the same -[formatting](./format) as regular documentation pages, except for frontmatter metadata (e.g. title), which is ignored. -The homepage's title will always match the mod's name, whereas the sidebar will display various information about the -platform project, such as the project's authors, categories and available mc versions. +维基为文档提供了一个专门的详情页,称为“模组主页”。默认情况下,这里会显示链接的平台项目的描述。 -## Documentation format +如果您想提供自己的内容,可以在文档的根文件夹中创建一个 `_homepage.mdx` 文件(与 `sinytra-wiki.json` 同级)。文件的内容遵循与常规文档页面相同的[格式](./format),但不包括前言元数据(例如标题),这些将被忽略。主页的标题将始终与模组的名称匹配,而侧边栏将显示有关平台项目的各种信息,如项目的作者、类别和可用的mc版本。 -### Wiki Metadata -The wiki metadata file specifies project identification information, necessary for the wiki to load the project. +## 文档格式 -It must be placed in a file called `sinytra-wiki.json` inside the documentation **root directory**. +### 维基元数据 +维基元数据文件指定了项目识别信息,这对于维基加载项目是必要的。 +它必须放置在文档**根目录**中的一个名为 `sinytra-wiki.json` 的文件中。 ```json title="sinytra-wiki.json" { "id": "mffs", @@ -145,58 +126,44 @@ It must be placed in a file called `sinytra-wiki.json` inside the documentation "slug": "mffs" } ``` +维基元数据文件包含以下属性,所有这些都是**必需**的: +- `id`: 用于在维基中标识项目的唯一项目id。我们建议使用您的模组id或托管平台slug。 +- `platform`: 您的模组的分发平台。可以是 `modrinth` 或 `curseforge`。 +- `slug`: 主机平台的项目slug。 +项目slug可以从您的模组项目页面URL中轻松提取,如下例所示,其中 `{slug}` 是实际值的占位符。 +- 对于Modrinth项目:`https://modrinth.com/mod/{slug}` +- 对于CurseForge项目:`https://www.curseforge.com/minecraft/mc-mods/{slug}` -The wiki metadata file contains the following properties, all of which are **required**: +此文件的JSON Schema规范可以在此处找到[这里](/sinytra-wiki.schema.json)。 -- `id`: Unique project id used to identify the project across the wiki. We recommend using your mod id - or hosting platform slug. -- `platform`: Your mod's distribution platform. Can be either of `modrinth` or `curseforge`. -- `slug`: The host platform's project slug. +### 文件夹元数据 -The project slug can be easily extracted from your mod's project page URL as shown in the examples below, where `{slug}` -is a placeholder for the actual value. +为文档页面导航侧边栏提供附加信息: +- 文件夹和文件的**显示名称**。如果未提供,维基将使用自动生成的显示名称。 +- 侧边栏条目的**排序**。默认情况下,首先显示文件夹,然后是常规文件,所有内容按字母顺序排序。 -- For Modrinth projects: `https://modrinth.com/mod/{slug}` -- For CurseForge projects: `https://www.curseforge.com/minecraft/mc-mods/{slug}` +为了避免潜在的意外显示错误,我们建议在您的文档中**始终**提供完整的文件夹元数据。 -The JSON Schema specification for this file can be found [here](/sinytra-wiki.schema.json). - -### Folder metadata - -Provides additional information for the documentation page navigation sidebar: - -- The **display names** of folders and files. If not provided, the wiki will use automatically generated display names. -- The **ordering** of sidebar entries. By default, folders are shown first, followed by regular files, all sorted - alphabetically. - -To avoid potential unwanted display errors, we recommend **always** providing complete folder metadata in your -documentation. - -```json title="\_meta.json" +```json title="_meta.json" { "blocks": "Blocks", - "items": "Completely custom name", - "introduction.mdx": "Introduction" + "items": "完全自定义名称", + "introduction.mdx": "介绍" } ``` -The folder metadata json consists of string key-value pairs, where the keys represent the name of a file or a folder, -and the values are their display name. When specifying a file name, the full name including the extension is required. - -Folder metadata is contained in a file called `_meta.json` and can be placed **inside any folder** within the -documentation directory, **including the root** directory itself (e.g. at the same level as `sinytra-wiki.json`). +文件夹元数据json由字符串键值对组成,其中键代表文件或文件夹的名称,值是它们的显示名称。指定文件名时,需要包括扩展名的完整名称。 +文件夹元数据包含在一个名为 `_meta.json` 的文件中,可以放置在文档目录内的**任何文件夹**中,**包括根**目录本身(例如,与 `sinytra-wiki.json` 同级)。 -The JSON Schema specification for this file can be found [here](/_meta.schema.json). +此文件的 JSON Schema 规范可以在此处找到[这里](/_meta.schema.json)。 -#### Icons +#### 图标 -You can add icons for each metadata entry to display in the navigation sidebar by converting the meta value to an object -and supplying the icon's name as shown below. +您可以通过将元数据值转换为对象并在导航侧边栏中提供图标的名称来为每个元数据条目添加图标。 -The supplied icon name should be a [Lucide icon](https://lucide.dev/icons/) component name (without the `Icon` suffix). -More information on icon names can be found on the [Format](./format#icons) page. +提供的图标名应为[Lucide icon](https://lucide.dev/icons/)中的某个部件名称,且不能包含`Icon`后缀。 -```json title="\_meta.json" +```json title="_meta.json" { "blocks": { "name": "Blocks", @@ -205,15 +172,11 @@ More information on icon names can be found on the [Format](./format#icons) page } ``` -### Versioning +### 版本控制 -You can show multiple versions of your mod's documentation on the wiki by adding a `versions` property to your -docs metadata file, which contains a map of minecraft version names (these will be displayed in the version selector -as well as in the URL paths) to git branch names. +您可以通过在您的文档元数据文件中添加一个 `versions` 属性来在维基上显示您模组文档的多个版本,该属性包含 Minecraft 版本名称(这些将在版本选择器以及URL路径中显示)到git分支名称的映射。 -The documentation folder structure remains the same across all branches with contents being isolated per branch, -including assets and localization. **Documentation metadata files (`sinytra-wiki.json`) from other branches are ignored**, -as all necessary information is already contained in the default branch's file. +文档文件夹结构在所有分支中保持相同,内容按分支隔离,包括资源和本地化文件。**来自其他分支的文档元数据文件(`sinytra-wiki.json`)将被忽略**,因为所有必要的信息已经包含在默认分支的文件中。 ```json title="sinytra-wiki.json" { @@ -225,19 +188,17 @@ as all necessary information is already contained in the default branch's file. } ``` -## Gradle plugin companion - -We provide an excellent wiki companion [Gradle plugin](https://github.com/Sinytra/WikiToolkit) to help you with -authoring documentation. +## Gradle插件伴侣 -Its features include: +我们提供了一个优秀的维基伴侣[Gradle插件](https://github.com/Sinytra/WikiToolkit)来帮助您编写文档。 -- Local real-time, accurate preview of your documentation in the exact same look as it will have once uploaded to the wiki -- Automatically generating asset renders of inventory models for all mod items -- Revalidating documentation after publishing +其功能包括: +- 本地实时、精确预览您的文档,其外观与上传到维基后完全相同 +- 自动生成所有模组物品的库存模型资产渲染 +- 发布后重新验证文档 -A complete usage guide can be found on its [GitHub repository](https://github.com/Sinytra/WikiToolkit). +完整的使用指南可以在其[GitHub仓库](https://github.com/Sinytra/WikiToolkit)中找到。 -## Next steps +## 下一步 -➡️ Learn more about the specifics of the MDX [Documentation format](./format). +➡️ 了解有关 MDX [文档格式](./format)的详细信息。 diff --git a/docs/format/zh_cn.mdx b/docs/format/zh_cn.mdx index 6600efb0..77ca6538 100644 --- a/docs/format/zh_cn.mdx +++ b/docs/format/zh_cn.mdx @@ -1,74 +1,61 @@ import CraftingRecipe from "../../components/docs/shared/CraftingRecipe.tsx"; -# Documentation format +# 文档格式 -The wiki uses [MDX](https://mdxjs.com/) files as its documentation format. In additon, [GitHub Flavored Markdown](https://github.github.com/gfm/) -(GFM) is also available using [`remark-gfm`](https://github.com/remarkjs/remark-gfm). +Wiki 使用 [MDX](https://mdxjs.com/) 文件作为其文档格式。此外,还支持使用 [`remark-gfm`](https://github.com/remarkjs/remark-gfm) 提供的 [GitHub Flavored Markdown](https://github.github.com/gfm/) (GFM)。 -If you're not yet familiar with MDX, don't worry - it is an extension of the simple [Markdown](https://www.markdownguide.org/) -format with added JSX capabilities, meaning you can include fancy custom components in your documentation, -such as crafting recipes. +如果您还不熟悉 MDX,不要担心——它是简单的 [Markdown](https://www.markdownguide.org/) 格式的扩展,增加了 JSX 的功能,这意味着您可以在文档中包含自定义组件,例如合成配方。 -These features are purely optional, and you can always stick to using standard Markdown in your documentation. However, -the file extension must remain `.mdx`. +这些功能是可选的,您可以始终选择使用标准 Markdown 编写文档。但是文件扩展名必须保持为 `.mdx`。 -#### Limitations +#### 限制 -Because MDX can potentially allow unwanted code injection on the server, we sanitize all sources before they're rendered, -which can result in certain features of MDX being unavailable. That said, if there's a safe feature you'd like to use in -your documentation that isn't available on the wiki, please open an issue on our -[GitHub repository](https://github.com/Sinytra/Wiki/issues). +由于 MDX 可能允许在服务器上进行代码注入,我们会在渲染之前对所有源代码进行清理,这可能会导致某些 MDX 功能不可用。不过,如果您希望在文档中使用某个安全的功能而它在维基上不可用,请在我们的 [GitHub 仓库](https://github.com/Sinytra/Wiki/issues) 上提交问题。 -## Metadata +## 元数据 -Markdown page metadata, also known as simply "Frontmatter" is used by the wiki to provide additional information about -a page or in-game content. It's located at the very beginning of each file in YAML format. +Markdown 页面元数据,也称为“Frontmatter”,用于提供有关页面或游戏内内容的额外信息。它位于每个文件的开头,采用 YAML 格式。 -Information obtained from frontmatter is then displayed in the right sidebar of each page under "Information". -Usually, this includes an icon of the block/item along with its name, id, source mod and other handy information. +从 Frontmatter 获取的信息会显示在每页右侧边栏的“信息”部分。通常包括方块/物品的图标及其名称、ID、来源模组和其他有用的信息。 -If your page is not related to a specific object, you can hide all metadata and ignore their values by setting -`hide_meta: true`. The `title` attribute will still be used, and we recommend providing it at all times. +如果您的页面与特定对象无关,可以通过设置 `hide_meta: true` 来隐藏所有元数据并忽略它们的值。`title` 属性仍然会被使用,我们建议始终提供该属性。 ```markdown --- title: Hello World --- -Content comes here +其它内容 ``` -Here's an overview of supported attributes: - -- `title` - Display name of the page, shown in the content heading and the browser tab title. - Replaces the `h1` heading in docs. - - Type: `string` - - Example: `Fancy Block` -- `hide_meta` - Hides sidebar meta information. As a results, all other attributes will be ignored. - - Type: `boolean` -- `id` - In-game resource location ID of the content shown. If a matching asset with the same location is found in the - documentation root's asset folder, it will be used as the `icon`. - - Type: Resource Location - - Example: `examplemod:generator` -- `icon` - Resource location of an asset that will be shown as the documented item's icon. Its size should be at least - 128x128 pixels. - - Type: Resource Location - - Example: `examplemod:fancy_generator` -- `hide_icon` - Hides the project icon, showing a generic placeholder instead. - - Type: `boolean` -- `type` - Can be `block`, `item` or `other` - - Type: `string` -- `custom` - A map of custom attributes you wish to display in the sidebar. - - Type: `string` -> `string` map - - Example: +以下是支持的属性概述: + +- `title` - 页面的显示名称,显示在内容标题和浏览器标签标题中。替换文档中的 `h1` 标题。 + - 类型:`string` + - 示例:`Fancy Block` +- `hide_meta` - 隐藏侧边栏元数据。结果是其他所有属性将被忽略。 + - 类型:`boolean` +- `id` - 显示内容的游戏内资源位置 ID。如果在文档根目录的资产文件夹中找到与同一位置匹配的资产,它将用作 `icon`。 + - 类型:资源位置 + - 示例:`examplemod:generator` +- `icon` - 将作为文档化物品图标的资产资源位置。大小应至少为 128x128 像素。 + - 类型:资源位置 + - 示例:`examplemod:fancy_generator` +- `hide_icon` - 隐藏项目图标,显示通用占位符。 + - 类型:`boolean` +- `type` - 可以是 `block`、`item` 或 `other` + - 类型:`string` +- `custom` - 您希望在侧边栏中显示的自定义属性映射。 + - 类型:`string` -> `string` 映射 + - 示例: ```yaml custom: Category: Machines ```
- Show complete metadata example - + 显示完整的元数据示例 + ```markdown --- title: Generator @@ -78,35 +65,35 @@ Here's an overview of supported attributes: custom: Subcategory: Machines --- - - Content comes here + + 其它内容 ```
-## Custom components +## 自定义组件 -The wiki adds a selection of useful components that you can use in your documentation. +维基提供了一些有用的组件,您可以在文档中使用。 -Import statements are not required for built-in wiki components. +内置维基组件不需要导入语句。 - Didn't find what you were looking for? Head over to our [GitHub repository](https://github.com/Sinytra/Wiki/issues) - and open a new issue or pull request proposing your desired component! + 没有找到您需要的内容?请前往我们的 [GitHub 仓库](https://github.com/Sinytra/Wiki/issues) + 并提出新的问题或拉取请求,提议您所需的组件! -### Crafting recipe +### 合成配方 -- `slots` - Exactly 9 resource location strings (asset names), in order from top-left to bottom-right. -- `result` - Resource location of the resulting item asset -- `count` - Optionally, specify the output item amount +- `slots` - 恰好 9 个资源位置字符串(资产名称),按从左上到右下的顺序排列。 +- `result` - 结果物品的资源位置 +- `count` - 可选,指定输出物品的数量 -※ Images shown in crafting recipes are sourced from documentation assets as described [here](./devs#assets). +※ 合成配方中显示的图像来自文档资产,如 [这里](./devs#assets) 所述。 ```jsx ``` -Results in: +效果如下: -### Callouts +### 提示框 -Draw the reader's attention with callouts. +使用提示框吸引读者的注意力。 -Available attributes: +可用属性: -- `variant` Optional; can be either of [`default`, `info`, `warning`, `danger`] (default: `default`) +- `variant` 可选;可以是 [`default`, `info`, `warning`, `danger`] 中的一个(默认为 `default`) ```jsx - This is a sample callout + 这是一个示例提示框 - This is a sample info callout + 这是一个示例信息提示框 -/* Other variants shown below */ +/* 其它变体如下所示 */ ``` -Results in: +效果如下: -This is a sample callout +这是一个示例提示框 -Info variant: +信息(info)变体: -This is a sample info callout +这是一个示例信息提示框 -Warning variant: +警告(warning)变体: -This is a sample warning callout +这是一个示例警告提示框 -Danger variant: +危险(danger)变体: -This is a sample danger callout +这是一个示例危险提示框 -### Mod Asset +### 模组资源 -Displays an [asset](./devs#assets) image. +显示一个[资源](./devs#assets)图片。 -Available attributes: +可用属性: -- `location` Required, Resource Location of the asset you wish to display -- All properties of `img` except for `src` are accepted +- `location` 必填,您希望显示的资产的资源位置 +- 接受除 `src` 外的所有 `img` 属性 ```jsx ``` -Results in: +效果如下: -### Icons +### 图标 -The entire collection of [Lucide icons](https://lucide.dev/icons/) is available to use in documentation files via -React components. +整个 [Lucide 图标](https://lucide.dev/icons/) 集合都可以通过 React 组件在文档文件中使用。 -Names of icon components consist of an icon's "component name" (which you can find on the website or make an educated -guess by converting the icon id to PascalCase (e.g. `align-vertical-justify-start` -> `AlignVerticalJustifyStart`) -and the `Icon` suffix. All properties supported by [Lucide React](https://lucide.dev/guide/packages/lucide-react) are -available as well. +图标组件的名称由图标的“组件名称”(您可以在网站上找到或通过将图标 ID 转换为 PascalCase 来猜测,例如 `align-vertical-justify-start` -> `AlignVerticalJustifyStart`)和 `Icon` 后缀组成。所有 [Lucide React](https://lucide.dev/guide/packages/lucide-react) 支持的属性都可用。 -For example: +例如: ```jsx ``` -Results in: +效果如下: -## Next steps +## 下一步 -Once your documentation folder is set up, and you're satisfied with the looks and content of your documentation, -it is time to get it published on the wiki. +一旦您的文档文件夹设置完成,并且您对文档的外观和内容感到满意,就可以将其发布到维基上。 -➡️ See the [Publishing](./publishing) page for more information. +➡️ 请参阅 [发布](./publishing) 页面获取更多信息。 diff --git a/docs/help/zh_cn.mdx b/docs/help/zh_cn.mdx index ab8d5069..25238b0d 100644 --- a/docs/help/zh_cn.mdx +++ b/docs/help/zh_cn.mdx @@ -1,33 +1,26 @@ -# Get help +# 获取帮助 -If you've found a bug or run into an issue with the Wiki, you can use one of the methods below to reach out to us -depending on the type of the issue. +如果您在使用 Wiki 时发现了错误或遇到问题,可以根据问题的类型选择以下方法之一联系我们。 -We'll always try our best to respond as soon as possible, however, please remain patient even if that's not the case. -As long as your issue / thread is open, it will not be ignored. Thanks! +我们会尽最大努力尽快回复,但即使不是这样,也请保持耐心。只要您的问题/帖子仍然打开,就不会被忽视。谢谢! -## 🙋 I have a question / feedback +## 🙋 我要提问 / 反馈 -=> Ask us on [Discord](https://discord.sinytra.org)\ -=> Open a thread on [GitHub discussions](https://github.com/Sinytra/Wiki/discussions) +=> 在 [Discord](https://discord.sinytra.org) 上询问我们 +=> 在 [GitHub 讨论区](https://github.com/Sinytra/Wiki/discussions) 开启一个新话题 -For general questions about the wiki or developer features, join us on our [Discord](https://discord.sinytra.org) and -post your question on one of the appropriate channels. A member of the community or the wiki team will get back to you -with an answer soon. +关于 Wiki 或开发者功能的一般问题,欢迎加入我们的 [Discord](https://discord.sinytra.org),并在适当的频道发布您的问题。社区成员或 Wiki 团队成员会尽快回复您。 -## 🐞 I've found a bug +## 🐞 我发现了一个 bug -=> Open a new GitHub [issue](https://github.com/Sinytra/Wiki/issues/new). +=> 在 GitHub 上开启一个新的 [issue](https://github.com/Sinytra/Wiki/issues/new) -A bug can be anything out of the ordinary, such as a page not displaying correctly or broken navigation, please -open a [new issue](https://github.com/Sinytra/Wiki/issues/new) on our [GitHub repository](https://github.com/Sinytra/Wiki). +Bug 可以是任何不寻常的情况,例如页面显示不正确或导航失效。请在我们的 [GitHub 仓库](https://github.com/Sinytra/Wiki) 上开启一个新的 [issue](https://github.com/Sinytra/Wiki/issues/new)。 -Also make sure to provide as much detail as possible. Include environmental information such as your browser and devide. -Describe what steps you took to trigger the bug. +同时,请尽可能提供详细信息。包括环境信息(如浏览器和设备),并描述触发错误的步骤。 -## ✉️ Contact +## ✉️ 联系方式 -=> Email `contact@moddedmc.org` +=> 邮件 `contact@moddedmc.org` -For other issues, such as security issues or inquiries about our ToS and Privacy Policy, you can always write to us -directly to our email at `contact@moddedmc.org`. We'll try our best to reply within a few business days. +对于其他问题,例如安全问题或关于我们服务条款和隐私政策的查询,您可以直接发送邮件至 `contact@moddedmc.org`。我们会在几个工作日内尽快回复。 diff --git a/docs/publishing/zh_cn.mdx b/docs/publishing/zh_cn.mdx index 32b0c7b3..a5d34b43 100644 --- a/docs/publishing/zh_cn.mdx +++ b/docs/publishing/zh_cn.mdx @@ -1,134 +1,108 @@ import {RefreshCwIcon, SettingsIcon, TrashIcon} from "lucide-react"; -# Publishing +# 发布 -Learn how to publish your documentation on our website! +学习如何在我们的网站上发布您的文档! -## Developer portal +## 开发者面板 -You can access our [developer portal](../dev) by clicking the `Developer area` button on the home page or in the footer. +您可以通过点击主页或页脚上的 `开发者区域` 按钮访问我们的 [开发者面板](../dev)。 -### First login +### 首次登录 -If this is your first time signing in, you'll be redirected to the login page where you can sign in using -your **GitHub account**. +如果您是第一次登录,您将被重定向到登录页面,您可以使用 **GitHub 账户** 登录。 -GitHub will ask you to authorize our GitHub App to access your account. It only requires minimal permissions used to -verify your identify and repository access permissions. Upon approving the request, you'll be automatically taken -to the developer portal. +GitHub 会要求您授权我们的 GitHub 应用程序访问您的账户。它仅需要用于验证身份和仓库访问权限的最小权限。批准请求后,您将自动进入开发者面板。 -## Registering projects +## 注册项目 -To add a new project to the wiki, hit the `Add Project` button. This will open a modal dialog, where you'll be asked -to fill out the following information: +要向 Wiki 添加新项目,请点击 `添加项目` 按钮。这将打开一个模态对话框,要求您填写以下信息: -- `Owner` - GitHub repository owner. Can be a user or an organization -- `Name` - GitHub repository name -- `Branch` - Name of the branch where the documentation is located -- `Path to documentation root` - Path to the documentation root folder inside the repository. - Should begin with a leading `/`. +- `所有者` - GitHub 仓库所有者。可以是用户或组织 +- `名称` - GitHub 仓库名称 +- `分支` - 文档所在的分支名称 +- `文档根路径` - 仓库中文档根文件夹的路径。应以 `/` 开头。 -Once you've filled everything out, hit the `Submit` button to complete the registration process. +填写完毕后,点击 `提交` 按钮完成注册过程。 -If the process completed successfully, you're good to go! Try opening the project on the wiki to see the rendered result. +如果注册成功,恭喜!尝试在 Wiki 上打开该项目以查看渲染结果。 -**Should you run into any errors, please see the Troubleshooting section below. If the issue still persists, -[reach out to us](./help).** +**如果您遇到任何错误,请参阅下面的故障排除部分。如果问题仍然存在,请[联系我们](./help)。** - As wiki content is rendered lazily, you may experience slightly increased loading times when first visiting pages, - but this only occurs the first time a given page is opened and will be **cached for all visitors** afterward, - achieving near-instant navigation times. + 由于 Wiki 内容是惰性加载的,首次访问页面时可能会有稍微增加的加载时间,但这只会在首次打开给定页面时发生,并且之后会为所有访客**缓存**,实现几乎即时的导航时间。 -( also don't forget to let your users know they can now find docs for your mod here :) ) +(别忘了告诉您的用户,他们现在可以在我们这里找到您模组的文档 :)) - If you change your default branch on GitHub (e.g. as when porting your mod to newer versions), don't forget to - update the source branch in the wiki project's settings as well, so that the website can keep showing the latest - docs version. + 如果您更改了 GitHub 上的默认分支(例如,在移植模组到更新版本时),请不要忘记在 Wiki 项目的设置中更新源分支,以便网站可以继续显示最新的文档版本。 -#### Troubleshooting +#### 故障排除 -> Please first install our GitHub app on your repository (here). +> 请首先在您的仓库上安装我们的 GitHub 应用程序(这里)。 -1. **Possible cause:** The wiki GitHub app is not installed on the project's GitHub repository, and therefore cannot access it.\ - **Fix:** Navigate to the link provided in the error message and grant the wiki GitHub App access to your repository. - It's enough if you only grant it access to the project's repository rather than all of them at once.\ - Don't worry about leaving the page - filled out information will be saved and re-applied when you return. +1. **可能原因:** 维基 GitHub 应用程序未安装在项目的 GitHub 仓库上,因此无法访问它。 + **解决方法:** 导航到错误消息提供的链接并授予维基 GitHub 应用程序访问您的仓库的权限。只需授予其对项目仓库的访问权限即可,无需一次性授予所有仓库的权限。不用担心离开页面——已填写的信息将保存并在您返回时自动填入。 -2. **Possible cause:** The provided GitHub repository does not exist.\ - **Fix:** Make sure you've filled out the repository `Owner` and `Name` fields correctly. These should match each the - repository `owner/name` pair as seen in its URL, e.g. `https://github.com/Sinytra/Wiki` would use `Sinytra` as the owner - and `Wiki` as the name. +2. **可能原因:** 提供的 GitHub 仓库不存在。 + **解决方法:** 确保您正确填写了仓库的 `所有者` 和 `名称` 字段。这些应该与 URL 中看到的仓库 `owner/name` 对应,例如 `https://github.com/Sinytra/Wiki` 使用 `Sinytra` 作为所有者,`Wiki` 作为名称。 -> Verification error +> 验证错误 -- **Possible cause:** Your mod's hosting platform project (see [documentation metadata](./devs#wiki-metadata)) does not - provide a Source Code link pointing to the mod's GitHub repository.\ - **Fix:** For the purposes of verifying project ownership, please momentarily set the Source Code url of your project - to match the GitHub repository url. +- **可能原因:** 您的模组托管平台项目(见[文档元数据](./devs#wiki-metadata))没有提供指向模组 GitHub 仓库的源代码链接。\ + **解决方法:** 为了验证项目所有权,请暂时将项目的源代码 URL 设置为匹配 GitHub 仓库 URL。
- Expand to get assistance for Modrinth projects - - 1. Open to your project's settings. - 2. Navigate to the `Links` tab. - 3. Enter the GitHub repository url in the `Source code` field. - 4. Apply the changes. - + 展开以获取 Modrinth 项目的帮助 + + 1. 打开项目的设置。 + 2. 导航到 `链接` 标签。 + 3. 在 `源代码` 字段中输入 GitHub 仓库 URL。 + 4. 应用更改。 + ![](/meta-docs-assets/mr_src_url.png)

- Expand to get assistance for CurseForge projects - - 1. Open your project's settings. - 2. Navigate to the `Source` tab. - 3. Enter the GitHub repository url in the `Repository URL` field. - 4. Apply the changes. + 展开以获取 CurseForge 项目的帮助 -``` -![](/meta-docs-assets/cf_src_url.png) -``` + 1. 打开项目的设置。 + 2. 导航到 `源` 标签。 + 3. 在 `Repository URL` 字段中输入 GitHub 仓库 URL。 + 4. 应用更改。 + ![](/meta-docs-assets/cf_src_url.png)
-> User does not have access to repository. +> 用户无权访问仓库。 -Your repository access permissions are insufficient to register it to the wiki. Please make sure you have at least -**Maintain** or **Admin** access. +您的仓库访问权限不足以将其注册到 Wiki。请确保您至少具有 **维护** 或 **管理员** 权限。 -> Invalid path provided +> 提供的路径无效 -The provided path does not exist or is a regular file. Please make sure the path points to an existing directory within -the repository. There is no need to prefix the path with a branch or tag name. +提供的路径不存在或是一个普通文件。请确保路径指向仓库中现有的目录。无需在路径前加上分支或标签名。 -This field is identical to the `path` parameter of GitHub's "[Get repository content](https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#get-repository-content)" -REST API route. +此字段等同于 GitHub 的 "[获取仓库内容](https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#get-repository-content)" REST API 路由中的 `path` 参数。 -## Project management +## 项目管理 -On your developer dashboard, you can find a couple options that let your manage your mod project. These are described -in detail below. +在您的开发者面板上,您可以找到几个选项来管理您的模组项目。详细描述如下。 -### Revalidate project +### 重新验证项目 -Purges all cached documentation pages, forcing them to be re-rendered lazily on-demand. -This option should only be used upon updating the documentation source itself. +清除所有缓存的文档页面,强制它们按需重新渲染。 +只有在更新文档源时才应使用此选项。 -For your own convenience, we recommend automatically revalidating docs after publication using our -[Gradle plugin](./devs#-gradle-plugin-companion) instead. +为了方便起见,我们建议在发布后使用我们的 [Gradle 插件](./devs#-gradle-plugin-companion) 自动重新验证文档。 -### Edit project +### 编辑项目 -Edit the project's parameters that have been set during registration. The project's ownership will be re-validated -during an update. +编辑注册时设置的项目参数。更新期间将重新验证项目的所属关系。 -### Delete a project +### 删除项目 -Permanently delete the project and removes all associated data from our servers. The cache for documentation pages will -be immediately purged as well, but it might take some time to propagate to the CDN and browser clients. +永久删除项目并从我们的服务器中移除所有相关数据。文档页面的缓存将立即清除,但可能需要一些时间传播到 CDN 和浏览器客户端。 -**This is a destructive operation and cannot be undone.** +**这是一个破坏性操作,无法撤销。** diff --git a/example/docs/examplemod/.translated/zh_cn/_meta.json b/example/docs/examplemod/.translated/zh_cn/_meta.json new file mode 100644 index 00000000..7d41bb26 --- /dev/null +++ b/example/docs/examplemod/.translated/zh_cn/_meta.json @@ -0,0 +1,4 @@ +{ + "introduction.mdx": "介绍", + "blocks": "方块" +} diff --git a/example/docs/examplemod/.translated/zh_cn/introduction.mdx b/example/docs/examplemod/.translated/zh_cn/introduction.mdx new file mode 100644 index 00000000..bb157de3 --- /dev/null +++ b/example/docs/examplemod/.translated/zh_cn/introduction.mdx @@ -0,0 +1,13 @@ +--- +title: 介绍 +hide_meta: true +--- + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ex turpis, bibendum ac nisl eu, gravida pretium nisi. +Nullam rutrum at augue vel lobortis. Vestibulum hendrerit dictum dui, ac semper lectus dictum ac. Phasellus eget +faucibus ipsum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; + +Sed orci justo, tempor ac nibh ac, dictum pellentesque nibh. Aliquam erat volutpat. Aliquam erat volutpat. +Sed ac nulla eget ante euismod efficitur. Quisque accumsan, mi id ullamcorper imperdiet, lorem urna blandit ante, et +malesuada purus ex ut nibh. Proin in dui posuere, gravida libero eget, iaculis ante. Nam molestie sit amet dolor +vitae lobortis. Vivamus hendrerit tellus rhoncus nisl blandit tempus.