Skip to content

Commit 2be7118

Browse files
Start using Doxyfile for the docs build
1 parent 49840cf commit 2be7118

5 files changed

Lines changed: 104 additions & 34 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- 1165-migrate-to-nodejs-24
78

89
jobs:
910
call_with_gcc:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ test/build
2020
test/bin
2121
output.txt
2222
Doxyfile
23+
!docs/Doxyfile
2324
apidoc_warning_logfile.txt
2425
third-party/distros/gmp-6.1.1
2526
third-party/distros/gmp-6.1.2

docs/Doxyfile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
PROJECT_NAME = "OpenFHE"
2+
PROJECT_BRIEF = "OpenFHE Library API"
3+
CREATE_SUBDIRS = NO
4+
ALLOW_UNICODE_NAMES = NO
5+
BRIEF_MEMBER_DESC = YES
6+
REPEAT_BRIEF = YES
7+
ALWAYS_DETAILED_SEC = NO
8+
INLINE_INHERITED_MEMB = NO
9+
FULL_PATH_NAMES = YES
10+
STRIP_FROM_PATH = ../src
11+
TAB_SIZE = 4
12+
13+
INPUT = ../src/binfhe/include \
14+
../src/binfhe/lib \
15+
../src/core/extras \
16+
../src/core/include \
17+
../src/core/lib \
18+
../src/pke/extras \
19+
../src/pke/include \
20+
../src/pke/lib
21+
FILE_PATTERNS = *.h \
22+
*.cpp
23+
RECURSIVE = YES
24+
EXCLUDE_PATTERNS = *.md
25+
26+
GENERATE_HTML = NO
27+
GENERATE_LATEX = NO
28+
GENERATE_XML = YES
29+
XML_OUTPUT = xml
30+
XML_PROGRAMLISTING = NO
31+
32+
QUIET = YES
33+
WARNINGS = NO
34+
WARN_IF_UNDOCUMENTED = NO
35+
WARN_IF_DOC_ERROR = NO
36+
WARN_IF_INCOMPLETE_DOC = NO
37+
WARN_NO_PARAMDOC = NO
38+
39+
EXTRACT_ALL = NO
40+
EXTRACT_PRIVATE = NO
41+
EXTRACT_PRIV_VIRTUAL = NO
42+
EXTRACT_STATIC = YES
43+
EXTRACT_LOCAL_CLASSES = YES
44+
EXTRACT_ANON_NSPACES = NO
45+
HIDE_UNDOC_MEMBERS = NO
46+
HIDE_UNDOC_CLASSES = NO
47+
48+
ENABLE_PREPROCESSING = YES
49+
MACRO_EXPANSION = YES
50+
EXPAND_ONLY_PREDEF = YES
51+
PREDEFINED += NAMESPACE_BEGIN(arbitrary)="namespace arbitrary {"
52+
PREDEFINED += NAMESPACE_END(arbitrary)="}"

docs/conf.py

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import shlex
1818
import textwrap
1919
import re
20+
from pathlib import Path
2021
from exhale import utils
2122
# If extensions (or modules to document with autodoc) are in another directory,
2223
# add these directories to sys.path here. If the directory is relative to the
@@ -53,8 +54,6 @@
5354
breathe_default_project = "OpenFHE"
5455

5556
# Setup the `exhale` extension
56-
import textwrap
57-
5857
__exhale_base = "../src"
5958
__exhale_path = {
6059
# Binfhe
@@ -70,10 +69,32 @@
7069
f"{__exhale_base}/pke/lib",
7170
}
7271

72+
_docs_dir = Path(__file__).resolve().parent
73+
_doxyfile_path = _docs_dir / "Doxyfile"
74+
7375
container = "INPUT = "
7476
for path in __exhale_path:
7577
container += f"{path} "
7678

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+
7798

7899
def specificationsForKind(kind):
79100
'''
@@ -110,20 +131,7 @@ def specificationsForKind(kind):
110131
############################################################################
111132
"createTreeView": True,
112133
"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,
127135
############################################################################
128136
# HTML Theme specific configurations. #
129137
############################################################################
@@ -510,4 +518,3 @@ def setup(app):
510518
the_req.write(".. code-block:: nginx\n\n")
511519
the_req.write(prefix(" ", "".join(l for l in requirements)))
512520
the_req.write("\n")
513-

docs/conf_extensions.rst

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.. code-block:: py
22
3+
from pathlib import Path
4+
import textwrap
5+
36
# Tell Sphinx to use both the `breathe` and `exhale` extensions
47
58
extensions = [
@@ -21,8 +24,6 @@
2124
breathe_default_project = "OpenFHE"
2225
2326
# Setup the `exhale` extension
24-
import textwrap
25-
2627
__exhale_base = "../src"
2728
__exhale_path = {
2829
# Binfhe
@@ -38,10 +39,32 @@
3839
f"{__exhale_base}/pke/lib",
3940
}
4041
42+
_docs_dir = Path(__file__).resolve().parent
43+
_doxyfile_path = _docs_dir / "Doxyfile"
44+
4145
container = "INPUT = "
4246
for path in __exhale_path:
4347
container += f"{path} "
4448
49+
_default_doxygen_config = textwrap.dedent(container + '''
50+
# For this code-base, the following helps Doxygen get past a macro
51+
# that it has trouble with. It is only meaningful for this code,
52+
# not for yours.
53+
PREDEFINED += NAMESPACE_BEGIN(arbitrary)="namespace arbitrary {"
54+
PREDEFINED += NAMESPACE_END(arbitrary)="}"
55+
EXCLUDE_PATTERNS += *.md
56+
57+
WARN_IF_UNDOCUMENTED = NO
58+
WARNINGS = NO
59+
WARN_IF_DOC_ERROR = NO
60+
WARN_IF_INCOMPLETE_DOC = NO
61+
WARN_NO_PARAMDOC = NO
62+
''')
63+
64+
_doxygen_config = _default_doxygen_config
65+
if _doxyfile_path.exists():
66+
_doxygen_config = _doxyfile_path.read_text()
67+
4568
4669
def specificationsForKind(kind):
4770
'''
@@ -78,20 +101,7 @@
78101
############################################################################
79102
"createTreeView": True,
80103
"exhaleExecutesDoxygen": True,
81-
"exhaleDoxygenStdin": textwrap.dedent(container + '''
82-
# For this code-base, the following helps Doxygen get past a macro
83-
# that it has trouble with. It is only meaningful for this code,
84-
# not for yours.
85-
PREDEFINED += NAMESPACE_BEGIN(arbitrary)="namespace arbitrary {"
86-
PREDEFINED += NAMESPACE_END(arbitrary)="}"
87-
EXCLUDE_PATTERNS += *.md
88-
89-
WARN_IF_UNDOCUMENTED = NO,
90-
WARNINGS" = NO,
91-
WARN_IF_DOC_ERROR: NO,
92-
WARN_IF_INCOMPLETE_DOC: NO,
93-
WARN_NO_PARAMDOC: NO
94-
'''),
104+
"exhaleDoxygenStdin": _doxygen_config,
95105
############################################################################
96106
# HTML Theme specific configurations. #
97107
############################################################################
@@ -131,4 +141,3 @@
131141
132142
# Tell sphinx what the pygments highlight language should be.
133143
highlight_language = 'cpp'
134-

0 commit comments

Comments
 (0)