|
103 | 103 | # The suffix of source filenames. |
104 | 104 | source_suffix = { |
105 | 105 | ".yml": "yaml", |
| 106 | + ".toml": "toml", |
106 | 107 | ".md": "markdown", |
107 | 108 | ".txt": "markdown", |
108 | 109 | "Makefile": "makefile", |
|
197 | 198 | "default": pygments_options, |
198 | 199 | "python": pygments_options, |
199 | 200 | "yaml": pygments_yaml_options, |
| 201 | + "ini": pygments_yaml_options, |
200 | 202 | "makefile": pygments_options, |
201 | 203 | } |
202 | 204 |
|
|
292 | 294 | # Output file base name for HTML help builder. |
293 | 295 | htmlhelp_basename = "multicast_doc" |
294 | 296 |
|
| 297 | +# -- Options for MyST markdown parser ------------------------------------------- |
| 298 | +# see https://github.com/mgaitan/sphinxcontrib-mermaid?tab=readme-ov-file#markdown-support |
| 299 | + |
| 300 | +# GFM style mermaid use zoom |
| 301 | +mermaid_d3_zoom = True |
| 302 | + |
| 303 | +# themes |
| 304 | +mermaid_params = ["--theme", "dark", "--backgroundColor", "transparent"] |
| 305 | + |
295 | 306 | # -- Options for MyST markdown parser ------------------------------------------- |
296 | 307 | # see https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html |
297 | 308 |
|
|
444 | 455 |
|
445 | 456 |
|
446 | 457 | def linkcode_resolve(domain, info): |
| 458 | + """ |
| 459 | + Resolves selectivly linking to GitHub source-code for the multicast module. |
| 460 | +
|
| 461 | + See https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html for more details. |
| 462 | +
|
| 463 | + Unit-Testing: |
| 464 | +
|
| 465 | + First set up test fixtures by importing conf. |
| 466 | +
|
| 467 | + >>> import docs.conf as _conf |
| 468 | + >>> |
| 469 | +
|
| 470 | + Testcase 1: Test function with input. |
| 471 | +
|
| 472 | + >>> _conf.linkcode_resolve is not None |
| 473 | + True |
| 474 | + >>> ignored_input = "docs.conf" # this is unchanged |
| 475 | + >>> test_text = "docs.conf" # this is resolved |
| 476 | + >>> bad_input = False # this is invalid |
| 477 | + >>> res_text = _conf.linkcode_resolve("py", info={"module": test_text}) |
| 478 | + >>> res_text is not None |
| 479 | + True |
| 480 | + >>> type(res_text) is type(str()) |
| 481 | + True |
| 482 | + >>> res_text is not test_text |
| 483 | + True |
| 484 | + >>> _conf.linkcode_resolve("py", info={"module": test_text,}) is res_text |
| 485 | + True |
| 486 | + >>> _conf.linkcode_resolve("py", info={"module": ignored_input,}) is ignored_input |
| 487 | + True |
| 488 | + >>> _conf.linkcode_resolve("py", info={"module": bad_input,}) is None |
| 489 | + True |
| 490 | + >>> len(res_text) > 0 |
| 491 | + True |
| 492 | + >>> |
| 493 | + >>> # cleanup from unit-test |
| 494 | + >>> del ignored_input |
| 495 | + >>> del bad_input |
| 496 | + >>> del test_text |
| 497 | + >>> del res_text |
| 498 | + >>> |
| 499 | + """ |
447 | 500 | if not isinstance(domain, str) or domain != "py": |
448 | 501 | return None |
449 | 502 | if not isinstance(info, dict) or "module" not in info or not info["module"]: |
|
0 commit comments