You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

conf.py 2.8 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import os
  2. import re
  3. import sys
  4. from docutils import nodes
  5. from docutils.parsers.rst import roles
  6. from sphinx.application import Sphinx
  7. # -- Path setup --------------------------------------------------------------
  8. sys.path.insert(0, os.path.abspath(".."))
  9. # -- Project information -----------------------------------------------------
  10. project = "ABL Kit"
  11. copyright = "LAMDA, 2024"
  12. # -- General configuration ---------------------------------------------------
  13. extensions = [
  14. "sphinx.ext.intersphinx",
  15. "sphinx.ext.autodoc",
  16. "sphinx.ext.autosummary",
  17. "sphinx.ext.mathjax",
  18. "sphinx.ext.viewcode",
  19. "sphinx_rtd_theme",
  20. "recommonmark",
  21. "sphinx_markdown_tables",
  22. "sphinx.ext.napoleon",
  23. "sphinx_copybutton",
  24. ]
  25. templates_path = ["_templates"]
  26. source_suffix = [".rst", ".md"]
  27. exclude_patterns = []
  28. gettext_compact = False
  29. master_doc = "index"
  30. suppress_warnings = ["image.nonlocal_uri"]
  31. pygments_style = "default"
  32. # -- Options for HTML output -------------------------------------------------
  33. html_theme = "sphinx_rtd_theme"
  34. html_theme_options = {"display_version": True}
  35. html_static_path = ["_static"]
  36. html_css_files = ["custom.css"]
  37. slug = re.sub(r"\W+", "", project.lower())
  38. htmlhelp_basename = slug
  39. man_pages = [("index", slug, project, 1)]
  40. texinfo_documents = [
  41. ("index", slug, project, slug, project, "Miscellaneous"),
  42. ]
  43. copybutton_selector = "div:not(.code-out) > div.highlight > pre"
  44. def remove_noqa(app: Sphinx, what: str, name: str, obj, options, lines):
  45. new_lines = []
  46. for line in lines:
  47. new_line = re.sub(r"\s*#\s*noqa.*$", "", line)
  48. new_lines.append(new_line)
  49. lines[:] = new_lines
  50. def colored_text_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
  51. node = nodes.inline(rawtext, text, classes=[role])
  52. return [node], []
  53. roles.register_local_role("green-bold", colored_text_role)
  54. roles.register_local_role("blue-bold", colored_text_role)
  55. roles.register_local_role("yellow-bold", colored_text_role)
  56. roles.register_local_role("green", colored_text_role)
  57. roles.register_local_role("blue", colored_text_role)
  58. roles.register_local_role("yellow", colored_text_role)
  59. # Extensions to theme docs
  60. def setup(app):
  61. from sphinx.domains.python import PyField
  62. from sphinx.util.docfields import Field
  63. app.connect("autodoc-process-docstring", remove_noqa)
  64. app.add_object_type(
  65. "confval",
  66. "confval",
  67. objname="configuration value",
  68. indextemplate="pair: %s; configuration value",
  69. doc_field_types=[
  70. PyField("type", label=("Type"), has_arg=False, names=("type",), bodyrolename="class"),
  71. Field(
  72. "default",
  73. label=("Default"),
  74. has_arg=False,
  75. names=("default",),
  76. ),
  77. ],
  78. )

An efficient Python toolkit for Abductive Learning (ABL), a novel paradigm that integrates machine learning and logical reasoning in a unified framework.