MarkChat
简介
在我开始游玩单人多人服务器(SMP)时,我发现自己一直在使用 *Markdown 语法* 来编写聊天消息。尽管 Minecraft 本身不会对玩家发送的聊天消息进行格式化,但客户端具备 显示 已格式化聊天消息的功能,前提是它们从服务器接收到这些数据。
本模组将聊天消息解析为 Markdown,对其进行格式化,并将格式化后的版本发送给客户端。这让玩家可以像大佬一样使用 粗体 和 斜体,其语法与 Discord 及其他各种即时通讯应用相同。此外,它还能防止聊天举报功能,嗯,这还不错。
书籍
除了聊天格式化之外,MarkChat 还包含一个附加模块,允许将 Markdown 文件作为撰写好的书上传。使用方法:手持笔和书,输入 /book upload <title>。这将提示你上传一个 Markdown 文件到 Filebin,随后由服务器下载该文件。你也可以使用 /book download <title> (url|filebin) <address> 直接下载一本书。请注意,撰写好的书每页允许的字符数量有限,虽然分页符会自动插入,但最好保持段落简短。
此模块可以在设置中禁用。
配置
config/markchat.json
-
formatting (object): 关于格式样式的各项设置。
-
ulPrefix (string): 用于无序(项目符号)列表的前缀。
-
olPrefix (string): 用于有序(编号)列表的前缀。使用 %d 表示列表索引。
-
headingColors (list): 字符串列表,格式与 linkColor 相同,指示每个标题标签应使用的颜色。索引大于列表长度的标题标签将使用列表中的最后一个元素。
-
linkColor (string): 链接所使用的颜色。可以是 Minecraft 的 颜色名称 之一,也可以是十六进制代码。
-
allowLinks (string): 是否允许在聊天和书籍中使用链接。可选值为 NEVER、ADMINS 或 ALWAYS。
-
enableBooks (boolean): 是否启用书籍上传模块。如果为 false,本模组的功能将仅限于聊天。
-
filebinUrl (string): Filebin 的基础 URL,用于上传 Markdown 文件。
-
commandPrefix (string): book 命令的前缀。如果 /book 与其他模组冲突,可在此更改。
支持的 Markdown 元素
当前实现基于 CommonMark 规范。
| 元素 |
支持情况 |
| 标题 |
仅限书籍 |
| 粗体 |
支持 |
| 斜体 |
支持 |
| 引用块 |
仅限书籍 |
| 代码 |
不支持 |
| 水平线 |
仅限书籍(变为新页面) |
| 链接 |
仅在启用时可用(见 配置) |
| 图片 |
不支持 |
| 删除线 |
计划中 |
MarkChat
About
When I started my SMP, I noticed that I was consistently using *markdown syntax* to write chat messages. Although Minecraft doesn't format chat messages sent by players, the client does have the functionality to display formatted chat messages, should it receive them from the server.
This mod parses chat messages as Markdown, formats them, and sends the formatted version to clients. This allows players to write in bold and italics like a boss, with the same syntax used by Discord and various other messaging apps. It also prevents chat reporting, so that's nice, I guess.
Books
In addition to chat formatting, MarkChat includes an additional module that allows markdown files to be uploaded as written books. To use this, hold a book and quill and type /book upload <title>. This will prompt you to upload a markdown file to Filebin, where it will be downloaded by the server. You can also user /book download <title> (url|filebin) <address> to download a book directly. Keep in mind that written books permit a small amount of characters per page, and although page breaks are automatically inserted, it's best to keep paragraphs brief.
This module can be disabled in the settings.
Config
config/markchat.json
-
formatting (object): Various settings regarding format style.
-
ulPrefix (string): Prefix to use for unordered (bullet) lists.
-
olPrefix (string): Prefix to use for ordered (numbered) lists. Use %d to indicate list index.
-
headingColors (list): A list of strings, formatted the same way as linkColor, indicating the colors to use for each heading tag. Heading tags with an index greater than the length of the list will use the last element in the list.
-
linkColor (string): The color to use for links. May be one of Minecraft's color names or a hex code.
-
allowLinks (string): Whether links should be allowed in chat and books. One of NEVER, ADMINS or ALWAYS.
-
enableBooks (boolean): Whether the book upload module should be enabled. If false, this mod's functionality will be restricted to chat only.
-
filebinUrl (string): The base URL of Filebin, used for uploading markdown files.
-
commandPrefix (string): The prefix of the book command. Change this if /book conflicts with another mod.
Supported Markdown Elements
The current implementation uses the CommonMark specification.
| Element |
Support |
| Headings |
Only in books |
| Bold |
Yes |
| Italic |
Yes |
| Blockquote |
Only in books |
| Code |
No |
| Horizontal rule |
Only in books (becomes new page) |
| Link |
Only if enabled (see config) |
| Image |
No |
| Strikethrough |
Planned |
评论 0
登录后参与评分
还没有评论,来抢沙发吧