|
1 | | -import subprocess, os |
| 1 | +import os |
| 2 | +import subprocess |
2 | 3 |
|
3 | 4 | project = 'KiT-RT' |
4 | | -copyright = '2022, Karlsruhe Institute of Technology' |
| 5 | +copyright = '2024, Steffen Schotthoefer, Pia Stammer, Jonas Kusch' |
5 | 6 | author = 'Jonas Kusch, Steffen Schotthöfer, Pia Stammer, Jannick Wolters, Tianbai Xiao' |
6 | 7 |
|
7 | 8 | version = '1.2.0' |
|
13 | 14 | 'sphinx_rtd_theme' |
14 | 15 | ] |
15 | 16 |
|
16 | | -#templates_path = ['_templates'] |
| 17 | +# templates_path = ['_templates'] |
17 | 18 | master_doc = 'index' |
18 | | -exclude_patterns = [] |
| 19 | + |
| 20 | +# Legacy API stub pages for classes that have been removed, renamed, or folded |
| 21 | +# into aggregate pages. Excluding them keeps source-discovery builds from |
| 22 | +# publishing stale API references. |
| 23 | +exclude_patterns = [ |
| 24 | + 'optimizers/mloptimizer.rst', |
| 25 | + 'problems/checkerboardpn.rst', |
| 26 | + 'problems/checkerboardsn.rst', |
| 27 | + 'problems/electronrt.rst', |
| 28 | + 'problems/icru.rst', |
| 29 | + 'problems/linesourcepn.rst', |
| 30 | + 'problems/linesourcesn.rst', |
| 31 | + 'problems/linesourcesnpseudo1d.rst', |
| 32 | + 'problems/linesourcesnpseudo1dphysics.rst', |
| 33 | + 'problems/musclebonelung.rst', |
| 34 | + 'problems/phantom2d.rst', |
| 35 | + 'problems/slabgeohg.rst', |
| 36 | + 'problems/waterphantom.rst', |
| 37 | + 'solvers/csdsnsolverfp.rst', |
| 38 | + 'solvers/csdsnsolvernotrafo.rst', |
| 39 | + 'solvers/csdsolvertrafofp.rst', |
| 40 | + 'solvers/csdsolvertrafofp2d.rst', |
| 41 | + 'solvers/csdsolvertrafofpsh2d.rst', |
| 42 | +] |
19 | 43 |
|
20 | 44 | html_theme = 'sphinx_rtd_theme' |
21 | 45 | html_theme_options = { |
|
24 | 48 | } |
25 | 49 | html_logo = 'images/KiT-RT_logo_small.png' |
26 | 50 | html_static_path = ['_static'] |
| 51 | + |
27 | 52 | def setup(app): |
28 | 53 | app.add_css_file('theme_overrides.css') |
29 | 54 |
|
| 55 | +conf_dir = os.path.abspath(os.path.dirname(__file__)) |
| 56 | +default_doxygen_xml = os.path.abspath(os.path.join(conf_dir, '..', 'build', 'docs', 'doxygen', 'xml')) |
| 57 | +doxygen_xml = os.environ.get('KITRT_DOXYGEN_XML', default_doxygen_xml) |
| 58 | + |
30 | 59 | breathe_projects = { |
31 | | - "KiT-RT": "../build/docs/doxygen/xml", |
| 60 | + 'KiT-RT': doxygen_xml, |
32 | 61 | } |
33 | 62 |
|
34 | | -breathe_default_project = "KiT-RT" |
| 63 | +breathe_default_project = 'KiT-RT' |
35 | 64 |
|
36 | 65 | read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True' |
37 | 66 | if read_the_docs_build: |
38 | | - inputDir = '../' |
39 | | - outputDir = '../build/docs/doxygen' |
40 | | - if not os.path.exists(outputDir): |
41 | | - os.makedirs(outputDir) |
42 | | - with open("Doxyfile.in", "rt") as fin: |
43 | | - with open("Doxyfile", "wt") as fout: |
| 67 | + inputDir = os.path.abspath(os.path.join(conf_dir, '..')) |
| 68 | + outputDir = os.path.abspath(os.path.join(conf_dir, '..', 'build', 'docs', 'doxygen')) |
| 69 | + os.makedirs(outputDir, exist_ok=True) |
| 70 | + with open(os.path.join(conf_dir, 'Doxyfile.in'), 'rt') as fin: |
| 71 | + with open(os.path.join(conf_dir, 'Doxyfile'), 'wt') as fout: |
44 | 72 | for line in fin: |
45 | 73 | line = line.replace('GENERATE_HTML = YES', 'GENERATE_HTML = NO') |
46 | 74 | line = line.replace('SEARCH_INCLUDES = YES', 'SEARCH_INCLUDES = NO') |
47 | 75 | line = line.replace('CLASS_DIAGRAMS = YES', 'CLASS_DIAGRAMS = NO') |
48 | 76 | line = line.replace('@DOXYGEN_OUTPUT_DIR@', outputDir) |
49 | 77 | line = line.replace('@DOXYGEN_INPUT_DIR@', inputDir) |
50 | 78 | fout.write(line) |
51 | | - subprocess.call('doxygen', shell=True) |
| 79 | + subprocess.call('doxygen', cwd=conf_dir, shell=True) |
0 commit comments