Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

conf.py 3.0 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
  1. """
  2. An opinionated sphinx setup for academic or scientific reports in Sphinx.
  3. Sphinx Documentation: https://www.sphinx-doc.org/en/master/usage/configuration.html
  4. """
  5. import re
  6. from datetime import datetime
  7. from dynaconf import settings
  8. # -- Project Information ------
  9. import os
  10. import sys
  11. # Autodoc!
  12. sys.path.insert(0, os.path.abspath('..'))
  13. # Project or Documentation Title
  14. project = settings.get("project_title", "My Project")
  15. project_slug = re.sub("([^a-zA-Z0-9])+", "-", project).lower()
  16. # TODO: Handle Multiple Authors
  17. author = settings.get("author", "")
  18. # Academic Work should not be copy righted
  19. copyright = settings.get("copyright", "") or f"{datetime.today().year}, {author}"
  20. # -- Document Settings ------
  21. # Index Document (excluding suffix)
  22. master_doc = "index"
  23. # Files to ignore
  24. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
  25. # Parsers for source file extensions
  26. source_suffix = {
  27. '.rst': 'restructuredtext',
  28. '.md': 'markdown',
  29. }
  30. # Template Paths
  31. templates_path = ["templates"]
  32. # -- Extensions -----
  33. extensions = [
  34. # Autodoc
  35. "sphinx.ext.autodoc",
  36. # TODOs for WIP Docs
  37. "sphinx.ext.todo",
  38. # Render LaTeX for HTML outputs
  39. "sphinx.ext.mathjax",
  40. # Configuration-driven Content
  41. "sphinx.ext.ifconfig",
  42. # Add Code Documentation if there is associated code
  43. "sphinx.ext.viewcode",
  44. # Embed Jupyter Notebooks
  45. "nbsphinx",
  46. # PlantUML driven Diagrams
  47. "sphinx.ext.graphviz",
  48. "sphinxcontrib.plantuml",
  49. "sphinx.ext.napoleon",
  50. # Citations and Reference Management
  51. "sphinxcontrib.bibtex",
  52. # Markdown Support
  53. "recommonmark",
  54. ]
  55. # TODO: Add in other extensions in the toml file
  56. # Pseudo-code:
  57. extensions.extend(filter(lambda ext: ext not in extensions, settings.get("extensions")))
  58. # -- Figure and Caption Settings -----
  59. # See: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-numfig
  60. numfig = True
  61. # -- LaTeX Settings -----
  62. # See: https://www.sphinx-doc.org/en/master/latex.html
  63. # See: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-latex_documents
  64. _targetname = f"{project_slug}.tex"
  65. latex_documents = [
  66. (master_doc, _targetname, project, author, "howto")
  67. ]
  68. latex_logo = settings.get("logo", None)
  69. if settings.get("printed", False):
  70. latex_show_pagerefs = True
  71. latex_show_urls = "footnote"
  72. _latex_preamble = r"""
  73. \usepackage{booktabs}
  74. % See: https://sphinxcontrib-bibtex.readthedocs.io/en/latest/usage.html
  75. % make phantomsection empty inside figures
  76. \usepackage{etoolbox}
  77. \AtBeginEnvironment{figure}{\renewcommand{\phantomsection}{}}
  78. """
  79. # See: https://www.sphinx-doc.org/en/master/latex.html#the-latex-elements-configuration-setting
  80. latex_elements = {
  81. "figure_align": "H",
  82. "preamble": _latex_preamble,
  83. }
  84. # -- HTML Settings -----
  85. html_theme = "haiku"
  86. html_static_path = ["static"]
  87. html_theme_options = {
  88. # Disable showing the sidebar. Defaults to 'false'
  89. "nosidebar": True,
  90. "relbarbgcolor": "black"
  91. }
  92. # -- TODOS Settings -----
  93. todo_include_todos = True
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...