• sphinx-doc的中文搜索


    第一,你的系统需要安装jieba类库, pip install jieba

    第二,接下来修改sphinx的conf.py文件,为项目设置为中文的搜索配置。

    # Language to be used for generating the HTML full-text search index.
    # Sphinx supports the following languages:
    #   'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
    #   'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
    html_search_language = 'zh'
    

    第三,可选配置

    # A dictionary with options for the search language support, empty by default.
    # 'ja' uses this config value.
    # 'zh' user can custom change `jieba` dictionary path.
    # html_search_options = {'dict': '/usr/lib/jieba.txt'}   # 根据需要设置jieba的词典路径
    

    第四,接下来重新编译生成文档。make html

    -------------------------------------------------------------------------------------
    原文地址:https://www.chenyudong.com/archives/sphinx-doc-support-chinese-search.html

  • 相关阅读:
    让用户打开你app的位置功能
    函数递归与栈的关系
    公务员考试
    毕达哥拉斯的故事
    OC5_NSMutableString操作
    OC4_NSString操作
    OC_NSString
    OC3_MyRect
    OC6_类方法
    OC5_构造方法与self指针
  • 原文地址:https://www.cnblogs.com/chunyin/p/9610857.html
Copyright © 2020-2023  润新知