|
17 | 17 | import shlex |
18 | 18 | import textwrap |
19 | 19 | import re |
| 20 | +from pathlib import Path |
20 | 21 | from exhale import utils |
21 | 22 | # If extensions (or modules to document with autodoc) are in another directory, |
22 | 23 | # add these directories to sys.path here. If the directory is relative to the |
|
53 | 54 | breathe_default_project = "OpenFHE" |
54 | 55 |
|
55 | 56 | # Setup the `exhale` extension |
56 | | -import textwrap |
57 | | - |
58 | 57 | __exhale_base = "../src" |
59 | 58 | __exhale_path = { |
60 | 59 | # Binfhe |
|
70 | 69 | f"{__exhale_base}/pke/lib", |
71 | 70 | } |
72 | 71 |
|
| 72 | +_docs_dir = Path(__file__).resolve().parent |
| 73 | +_doxyfile_path = _docs_dir / "Doxyfile" |
| 74 | + |
73 | 75 | container = "INPUT = " |
74 | 76 | for path in __exhale_path: |
75 | 77 | container += f"{path} " |
76 | 78 |
|
| 79 | +_default_doxygen_config = textwrap.dedent(container + ''' |
| 80 | + # For this code-base, the following helps Doxygen get past a macro |
| 81 | + # that it has trouble with. It is only meaningful for this code, |
| 82 | + # not for yours. |
| 83 | + PREDEFINED += NAMESPACE_BEGIN(arbitrary)="namespace arbitrary {" |
| 84 | + PREDEFINED += NAMESPACE_END(arbitrary)="}" |
| 85 | + EXCLUDE_PATTERNS += *.md |
| 86 | +
|
| 87 | + WARN_IF_UNDOCUMENTED = NO |
| 88 | + WARNINGS = NO |
| 89 | + WARN_IF_DOC_ERROR = NO |
| 90 | + WARN_IF_INCOMPLETE_DOC = NO |
| 91 | + WARN_NO_PARAMDOC = NO |
| 92 | +''') |
| 93 | + |
| 94 | +_doxygen_config = _default_doxygen_config |
| 95 | +if _doxyfile_path.exists(): |
| 96 | + _doxygen_config = _doxyfile_path.read_text() |
| 97 | + |
77 | 98 |
|
78 | 99 | def specificationsForKind(kind): |
79 | 100 | ''' |
@@ -110,20 +131,7 @@ def specificationsForKind(kind): |
110 | 131 | ############################################################################ |
111 | 132 | "createTreeView": True, |
112 | 133 | "exhaleExecutesDoxygen": True, |
113 | | - "exhaleDoxygenStdin": textwrap.dedent(container + ''' |
114 | | - # For this code-base, the following helps Doxygen get past a macro |
115 | | - # that it has trouble with. It is only meaningful for this code, |
116 | | - # not for yours. |
117 | | - PREDEFINED += NAMESPACE_BEGIN(arbitrary)="namespace arbitrary {" |
118 | | - PREDEFINED += NAMESPACE_END(arbitrary)="}" |
119 | | - EXCLUDE_PATTERNS += *.md |
120 | | - |
121 | | - WARN_IF_UNDOCUMENTED = NO, |
122 | | - WARNINGS" = NO, |
123 | | - WARN_IF_DOC_ERROR: NO, |
124 | | - WARN_IF_INCOMPLETE_DOC: NO, |
125 | | - WARN_NO_PARAMDOC: NO |
126 | | - '''), |
| 134 | + "exhaleDoxygenStdin": _doxygen_config, |
127 | 135 | ############################################################################ |
128 | 136 | # HTML Theme specific configurations. # |
129 | 137 | ############################################################################ |
@@ -510,4 +518,3 @@ def setup(app): |
510 | 518 | the_req.write(".. code-block:: nginx\n\n") |
511 | 519 | the_req.write(prefix(" ", "".join(l for l in requirements))) |
512 | 520 | the_req.write("\n") |
513 | | - |
|
0 commit comments