-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markdown 文档能否通过元数据的方式存放更多的信息? #502
Comments
linux-command/scripts/build.mjs Lines 154 to 159 in 023ce79
有一些规则,你可以直接用
Lines 19 to 26 in 023ce79
@conglinyizhi 更多的元信息,我建议如下方法添加到 <!--
date: "2023-05-24"
source: "https://www.gnu.org/software/bash/"
install: "sudo apt-get install bash"
supported_linux_systems:
- Ubuntu
- Debian
- Fedora
- CentOS
--> 开发使用可以通过 npm install linux-command var comm = require("linux-command");
console.log("---->", comm.ls);
var alias = require("linux-command/command/alias.md");
console.log("---->", alias); // markdown string 你也可以通过 CDN 来访问索引数据,和对应的命令详细内容,我将更新内容定期发布版本,提供大家使用,UNPKG 带上版本号,将锁定版本访问,删除版本号请求数据,将会自动重定向最新版本。 # 命令索引 JSON 数据
https://unpkg.com/linux-command/dist/data.json
# 对应命令详情(Markdown)数据
https://unpkg.com/linux-command/command/<命令名称>.md 你也可以通过 Github 的 Raw 来,获取最新的内容 # 命令索引 JSON 数据
https://raw.githubusercontent.com/jaywcjlove/linux-command/master/dist/data.json
# 对应命令详情(Markdown)数据
https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命令名称>.md |
好吧,我本来是希望元数据代替三个等号作为命令描述的,看起来您似乎不愿意实现这些 顺带一提,如果希望做国际化的话,我找到了一个翻译网站,可以用来托管需要翻译的项目 https://hosted.weblate.org/hosting/ 不过我建议提前对国际化进行准备 |
@conglinyizhi 目前这种方式迎合 GitHub 的自带预览功能,所以添加**“元数据”**尽量使用 注释语法添加 对国际化目前没有想法,因为英文版本(#21)有更多更好的工具,例如:https://github.com/tldr-pages/tldr |
在 Markdown 文档中,可以使用元数据的方式存储一些自定义的数据,就像这样:
这种被三个减号包裹的 yaml 格式的数据可以存储更多信息,也更方便接口的第三方开发者开发更多的功能,比如过滤只支持某个 Linux 发行版的指令
但是由于目前的文档数量较多,如果应用这种更改可能会导致其他接口的不兼容,所以我想询问一下,我可以这么做吗?
The text was updated successfully, but these errors were encountered: