conf.py 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # -*- coding: utf-8 -*-
  2. import sys, os
  3. from searx.version import VERSION_STRING
  4. from pallets_sphinx_themes import ProjectLink
  5. GIT_URL = os.environ.get("GIT_URL", "https://github.com/asciimoo/searx")
  6. SEARX_URL = os.environ.get("SEARX_URL", "https://searx.me")
  7. DOCS_URL = os.environ.get("DOCS_URL", "https://asciimoo.github.io/searx/")
  8. # Project --------------------------------------------------------------
  9. project = u'searx'
  10. copyright = u'2015-2019, Adam Tauber, Noémi Ványi'
  11. author = u'Adam Tauber'
  12. release, version = VERSION_STRING, VERSION_STRING
  13. highlight_language = 'none'
  14. # General --------------------------------------------------------------
  15. master_doc = "index"
  16. source_suffix = '.rst'
  17. numfig = True
  18. # usage:: lorem :patch:`f373169` ipsum
  19. extlinks = {}
  20. # upstream links
  21. extlinks['wiki'] = ('https://github.com/asciimoo/searx/wiki/%s', ' ')
  22. extlinks['pull'] = ('https://github.com/asciimoo/searx/pull/%s', 'PR ')
  23. # links to custom brand
  24. extlinks['origin'] = (GIT_URL + '/blob/master/%s', 'git://')
  25. extlinks['patch'] = (GIT_URL + '/commit/%s', '#')
  26. extlinks['search'] = (SEARX_URL + '/%s', '#')
  27. extlinks['docs'] = (DOCS_URL + '/%s', 'docs: ')
  28. extlinks['pypi'] = ('https://pypi.org/project/%s', 'PyPi: ')
  29. extlinks['man'] = ('https://manpages.debian.org/jump?q=%s', '')
  30. #extlinks['role'] = (
  31. # 'https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-%s', '')
  32. extlinks['duref'] = (
  33. 'http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#%s', '')
  34. extlinks['durole'] = (
  35. 'http://docutils.sourceforge.net/docs/ref/rst/roles.html#%s', '')
  36. extlinks['dudir'] = (
  37. 'http://docutils.sourceforge.net/docs/ref/rst/directives.html#%s', '')
  38. extensions = [
  39. 'sphinx.ext.extlinks',
  40. 'sphinx.ext.viewcode',
  41. "sphinx.ext.autodoc",
  42. "sphinx.ext.intersphinx",
  43. "pallets_sphinx_themes",
  44. "sphinx_issues", # https://github.com/sloria/sphinx-issues/blob/master/README.rst
  45. 'linuxdoc.rstFlatTable', # Implementation of the 'flat-table' reST-directive.
  46. 'linuxdoc.rstKernelDoc', # Implementation of the 'kernel-doc' reST-directive.
  47. 'linuxdoc.kernel_include', # Implementation of the 'kernel-include' reST-directive.
  48. 'linuxdoc.manKernelDoc', # Implementation of the 'kernel-doc-man' builder
  49. 'linuxdoc.cdomain', # Replacement for the sphinx c-domain.
  50. 'linuxdoc.kfigure', # Sphinx extension which implements scalable image handling.
  51. ]
  52. intersphinx_mapping = {
  53. "python": ("https://docs.python.org/3/", None),
  54. "flask": ("https://flask.palletsprojects.com/", None),
  55. # "werkzeug": ("https://werkzeug.palletsprojects.com/", None),
  56. "jinja": ("https://jinja.palletsprojects.com/", None),
  57. "linuxdoc" : ("https://return42.github.io/linuxdoc/", None),
  58. "sphinx" : ("https://www.sphinx-doc.org/en/master/", None),
  59. }
  60. issues_github_path = "asciimoo/searx"
  61. # HTML -----------------------------------------------------------------
  62. sys.path.append(os.path.abspath('_themes'))
  63. html_theme_path = ['_themes']
  64. html_theme = "searx"
  65. html_theme_options = {"index_sidebar_logo": True}
  66. html_context = {
  67. "project_links": [
  68. ProjectLink("Source", GIT_URL),
  69. ProjectLink("Wiki", "https://github.com/asciimoo/searx/wiki"),
  70. ProjectLink("Public instances", "https://github.com/asciimoo/searx/wiki/Searx-instances"),
  71. ProjectLink("Twitter", "https://twitter.com/Searx_engine"),
  72. ]
  73. }
  74. html_sidebars = {
  75. "**": ["project.html", "relations.html", "searchbox.html"],
  76. }
  77. singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}
  78. html_static_path = ["static"]
  79. html_logo = "static/img/searx_logo_small.png"
  80. html_title = "Searx Documentation ({})".format("Searx-{}.tex".format(VERSION_STRING))
  81. html_show_sourcelink = False
  82. # LaTeX ----------------------------------------------------------------
  83. latex_documents = [
  84. (master_doc, "searx-{}.tex".format(VERSION_STRING), html_title, author, "manual")
  85. ]