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

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