conf.py 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. """
  2. Sphinx documentation generator configuration.
  3. More information on the configuration options is available at:
  4. http://www.sphinx-doc.org/en/master/usage/configuration.html
  5. """
  6. from os import environ
  7. import django
  8. import sphinx_rtd_theme
  9. from pkg_resources import get_distribution
  10. environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")
  11. django.setup()
  12. # -- Extra custom configuration ------------------------------------------
  13. title = "django-axes documentation"
  14. description = ("Keep track of failed login attempts in Django-powered sites.",)
  15. # -- General configuration ------------------------------------------------
  16. # Add any Sphinx extension module names here, as strings.
  17. # They can be extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
  18. extensions = ["sphinx.ext.autodoc"]
  19. # Add any paths that contain templates here, relative to this directory.
  20. templates_path = ["_templates"]
  21. # The suffix(es) of source filenames.
  22. # You can specify multiple suffix as a list of string: source_suffix = ['.rst', '.md']
  23. source_suffix = ".rst"
  24. # The master toctree document.
  25. master_doc = "index"
  26. # General information about the project.
  27. project = "django-axes"
  28. copyright = "2016, Jazzband"
  29. author = "Jazzband"
  30. # The full version, including alpha/beta/rc tags.
  31. release = get_distribution("django-axes").version
  32. # The short X.Y version.
  33. version = ".".join(release.split(".")[:2])
  34. # The language for content autogenerated by Sphinx. Refer to documentation
  35. # for a list of supported languages.
  36. #
  37. # This is also used if you do content translation via gettext catalogs.
  38. # Usually you set "language" from the command line for these cases.
  39. language = None
  40. # List of patterns, relative to source directory, that match files and
  41. # directories to ignore when looking for source files.
  42. exclude_patterns = ["_build"]
  43. # The name of the Pygments (syntax highlighting) style to use.
  44. pygments_style = "sphinx"
  45. # If true, `todo` and `todoList` produce output, else they produce nothing.
  46. todo_include_todos = False
  47. # -- Options for HTML output ----------------------------------------------
  48. # The theme to use for HTML and HTML Help pages. See the documentation for
  49. # a list of builtin themes.
  50. html_theme = "sphinx_rtd_theme"
  51. # Add any paths that contain custom themes here, relative to this directory.
  52. html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
  53. # Add any paths that contain custom static files (such as style sheets) here,
  54. # relative to this directory. They are copied after the builtin static files,
  55. # so a file named "default.css" will overwrite the builtin "default.css".
  56. html_static_path = ["_static"]
  57. # Custom sidebar templates, maps document names to template names.
  58. html_sidebars = {
  59. "**": ["globaltoc.html", "relations.html", "sourcelink.html", "searchbox.html"]
  60. }
  61. # Output file base name for HTML help builder.
  62. htmlhelp_basename = "DjangoAxesdoc"
  63. # -- Options for LaTeX output ---------------------------------------------
  64. latex_elements = {
  65. "papersize": "a4paper",
  66. "pointsize": "12pt",
  67. "preamble": "",
  68. "figure_align": "htbp",
  69. }
  70. # Grouping the document tree into LaTeX files. List of tuples
  71. # (source start file, target name, title, author, documentclass [howto, manual, or own class]).
  72. latex_documents = [(master_doc, "DjangoAxes.tex", title, author, "manual")]
  73. # -- Options for manual page output ---------------------------------------
  74. # One entry per manual page. List of tuples
  75. # (source start file, name, description, authors, manual section).
  76. man_pages = [(master_doc, "djangoaxes", description, [author], 1)]
  77. # -- Options for Texinfo output -------------------------------------------
  78. # Grouping the document tree into Texinfo files. List of tuples
  79. # (source start file, target name, title, author, dir menu entry, description, category)
  80. texinfo_documents = [
  81. (
  82. master_doc,
  83. "DjangoAxes",
  84. title,
  85. author,
  86. "DjangoAxes",
  87. description,
  88. "Miscellaneous",
  89. )
  90. ]