OI-wiki/OI-Wiki-export

YAMLException: unknown tag

CCXXXI opened this issue · 0 comments

https://github.com/OI-wiki/OI-wiki/runs/6565354326?check_suite_focus=true#step:4:261

// 处理 OI Wiki 目前使用的两种特殊 YAML type
const ConfigYamlType1 = new yaml.Type('tag:yaml.org,2002:python/name:pymdownx.emoji.to_svg', {
kind: 'mapping',
construct: function (data) {
return data
}
})
const ConfigYamlType2 = new yaml.Type('tag:yaml.org,2002:python/name:pymdownx.arithmatex.fence_mathjax_format', {
kind: 'mapping',
construct: function (data) {
return data
}
})
const CONFIG_SCHEMA = yaml.Schema.create([ConfigYamlType1, ConfigYamlType2])

感觉可以预先读一下 mkdocs.yml,查找 !!python 开头的串,动态生成 YAML types