如何用俄语制作docfx搜索?它搜索英语单词很好,但不搜索俄语单词。我试着调试它,并且可以看到它使用lunr库进行搜索。如何用docfx中的俄文lunr替换标准lunr库?
发布于 2019-06-17 09:02:05
结果很简单:为了支持其他语言,除了那些支持lunr的语言,使用这个repo:https://github.com/MihaiValentin/lunr-languages
从docfx中打开search-worker.js文件,并按github自述的方式修改它:
添加进口
importScripts('lunr.stemmer.support.js');
importScripts('lunr.ru.js');将这些文件从github复制到带有lunr.js的文件夹
修改以下方法:
var lunrIndex = lunr(function() {
this.pipeline.remove(lunr.stopWordFilter);
Add this line...>this.use(lunr.ru);
this.ref('href');好好享受吧。
https://stackoverflow.com/questions/56624189
复制相似问题