zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    KVM 重命名虚机
    甲醛了解
    递归函数,匿名函数
    函数
    zabbix监控URL
    zabbix自动发现
    vim常用命令总结
    saltstack常用命令
    zabbix监控Apache
    nginx配置详解
  • 原文地址:https://www.cnblogs.com/chunyin/p/9610857.html
Copyright © 2011-2022 走看看