├── .clang-format ├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ └── build.yml ├── .gitignore ├── .pep8speaks.yml ├── .readthedocs.yaml ├── .style.yapf ├── .stylelintignore ├── .stylelintrc ├── CONTRIBUTING.md ├── LICENSE ├── MKDOCS_MATERIAL_MERGE_BASE ├── README.rst ├── codecov.yml ├── docs ├── _static │ ├── custom_font_example.css │ ├── example-custom-font │ │ ├── comic-mono-latin-400-normal.woff │ │ ├── comic-mono-latin-400-normal.woff2 │ │ ├── comic-neue-latin-400-normal.woff │ │ └── comic-neue-latin-400-normal.woff2 │ ├── extra_css.css │ ├── images │ │ ├── Ybin.gif │ │ ├── blank.png │ │ └── favicon.ico │ └── sphinx_logo.svg ├── _templates │ ├── autosummary │ │ ├── attribute.rst │ │ ├── class.rst │ │ ├── member.rst │ │ ├── method.rst │ │ └── minimal_module.rst │ ├── base.html │ └── material-design-build-icon.svg ├── additional_samples.rst ├── admonitions.rst ├── apidoc │ ├── cpp │ │ ├── apigen.rst │ │ ├── cppreference.rst │ │ ├── external_cpp_references.rst │ │ └── index.rst │ ├── format_signatures.rst │ ├── index.rst │ ├── json │ │ ├── domain.rst │ │ ├── index_transform_schema.yml │ │ └── inheritance_schema.yml │ └── python │ │ ├── apigen.rst │ │ └── index.rst ├── block_annotations.rst ├── code_annotations.rst ├── code_syntax_highlighting.rst ├── conf.py ├── content_tabs.rst ├── cpp_apigen_demo.rst ├── cpp_apigen_demo │ ├── array.h │ ├── fake_stdlib.h │ └── index_interval.h ├── customization.rst ├── demo_api.rst ├── desert-flower.jpg ├── favicon.xcf ├── graphviz.rst ├── index.rst ├── inline_icons.rst ├── keys.rst ├── mermaid_diagrams.rst ├── myst_typography.md ├── python_apigen_demo.rst ├── rst-cheatsheet │ ├── README-cp.txt │ ├── attrib.png │ ├── biohazard.png │ ├── magnetic-balls.jpg │ ├── noncomm.png │ ├── rst-cheatsheet.rst │ └── sharealike.png ├── rst_basics.rst ├── specimen.rst ├── subpage1.rst ├── subpage1subpage1.rst ├── subpage1subpage2.rst ├── subpage2.rst ├── task_lists.rst ├── tensorstore_demo │ ├── __init__.py │ └── _tensorstore.py ├── test.dot ├── test_py_module │ ├── __init__.py │ └── test.py ├── theme_result.rst └── type_param_demo.py ├── dprint.json ├── merge_from_mkdocs_material.py ├── noxfile.py ├── package-lock.json ├── package.json ├── pyproject.toml ├── setup.py ├── sphinx_immaterial ├── __init__.py ├── apidoc │ ├── __init__.py │ ├── apidoc_formatting.py │ ├── apigen_utils.py │ ├── cpp │ │ ├── __init__.py │ │ ├── api_parser.py │ │ ├── apigen.py │ │ ├── ast_fixes.py │ │ ├── cpp_resolve_c_xrefs.py │ │ ├── cppreference.py │ │ ├── cppreference_data │ │ │ ├── __init__.py │ │ │ ├── index-functions-c.xml │ │ │ ├── index-functions-cpp.xml │ │ │ └── update.sh │ │ ├── default.py │ │ ├── external_cpp_references.py │ │ ├── fix_cpp_domain_symbol_resolution_through_type_aliases.py │ │ ├── fix_cpp_domain_symbol_resolution_through_type_aliases_sphinx81.py │ │ ├── include_directives_in_signatures.py │ │ ├── last_resolved_symbol.py │ │ ├── macro_parameters.py │ │ ├── parameter_objects.py │ │ ├── signodes.py │ │ ├── strip_namespaces_from_signatures.py │ │ ├── symbol_ids.py │ │ └── synopses.py │ ├── fix_sphinx_issue_11147.py │ ├── format_signatures.py │ ├── generic_synopses.py │ ├── json │ │ ├── __init__.py │ │ ├── domain.py │ │ └── json_pprint.py │ ├── object_description_options.py │ ├── object_toc.py │ ├── python │ │ ├── __init__.py │ │ ├── annotation_style.py │ │ ├── apigen.py │ │ ├── attribute_style.py │ │ ├── autodoc_property_type.py │ │ ├── default.py │ │ ├── domain_fixes.py │ │ ├── napoleon_admonition_classes.py │ │ ├── object_ids.py │ │ ├── parameter_objects.py │ │ ├── strip_property_prefix.py │ │ ├── strip_self_and_return_type_annotations.py │ │ ├── style_default_values_as_code.py │ │ ├── subscript_methods.py │ │ ├── synopses.py │ │ ├── type_annotation_transforms.py │ │ └── type_param_utils.py │ └── wrap_signatures.py ├── code_annotations.py ├── content_tabs.py ├── css_and_javascript_bundles.py ├── custom_admonitions.css ├── custom_admonitions.py ├── default_literal_role.py ├── external_resource_cache.py ├── google_fonts.py ├── graphviz.py ├── highlight_push_pop.py ├── html_translator_mixin.py ├── inline_icons.py ├── json_builder_serializing_implementation.py ├── kbd_keys.py ├── local_mathjax.py ├── mermaid_diagrams.py ├── nav_adapt.py ├── postprocess_html.py ├── search_adapt.py ├── sections.py ├── sphinx_utils.py ├── task_lists.py ├── theme.conf └── theme_result.py ├── src └── templates │ ├── assets │ ├── javascripts │ │ ├── _ │ │ │ └── index.ts │ │ ├── browser │ │ │ ├── document │ │ │ │ └── index.ts │ │ │ ├── element │ │ │ │ ├── _ │ │ │ │ │ ├── .eslintrc │ │ │ │ │ └── index.ts │ │ │ │ ├── focus │ │ │ │ │ └── index.ts │ │ │ │ ├── hover │ │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ ├── offset │ │ │ │ │ ├── _ │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── content │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── size │ │ │ │ │ ├── _ │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── content │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── index.ts │ │ │ │ └── visibility │ │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ ├── keyboard │ │ │ │ └── index.ts │ │ │ ├── location │ │ │ │ ├── _ │ │ │ │ │ └── index.ts │ │ │ │ ├── hash │ │ │ │ │ └── index.ts │ │ │ │ └── index.ts │ │ │ ├── media │ │ │ │ └── index.ts │ │ │ ├── request │ │ │ │ └── index.ts │ │ │ ├── script │ │ │ │ └── index.ts │ │ │ ├── toggle │ │ │ │ └── index.ts │ │ │ └── viewport │ │ │ │ ├── _ │ │ │ │ └── index.ts │ │ │ │ ├── at │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ ├── offset │ │ │ │ └── index.ts │ │ │ │ └── size │ │ │ │ └── index.ts │ │ ├── bundle.ts │ │ ├── components │ │ │ ├── _ │ │ │ │ └── index.ts │ │ │ ├── announce │ │ │ │ └── index.ts │ │ │ ├── consent │ │ │ │ └── index.ts │ │ │ ├── content │ │ │ │ ├── _ │ │ │ │ │ └── index.ts │ │ │ │ ├── annotation │ │ │ │ │ ├── _ │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── block │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── list │ │ │ │ │ │ └── index.ts │ │ │ │ ├── code │ │ │ │ │ ├── _ │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── details │ │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ ├── mermaid │ │ │ │ │ ├── index.css │ │ │ │ │ └── index.ts │ │ │ │ ├── table │ │ │ │ │ └── index.ts │ │ │ │ └── tabs │ │ │ │ │ └── index.ts │ │ │ ├── dialog │ │ │ │ └── index.ts │ │ │ ├── header │ │ │ │ ├── _ │ │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ └── title │ │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ ├── main │ │ │ │ └── index.ts │ │ │ ├── palette │ │ │ │ └── index.ts │ │ │ ├── progress │ │ │ │ └── index.ts │ │ │ ├── search │ │ │ │ ├── _ │ │ │ │ │ └── index.ts │ │ │ │ ├── highlight │ │ │ │ │ ├── .eslintrc │ │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ ├── query │ │ │ │ │ └── index.ts │ │ │ │ ├── result │ │ │ │ │ └── index.ts │ │ │ │ ├── share │ │ │ │ │ └── index.ts │ │ │ │ └── suggest │ │ │ │ │ └── index.ts │ │ │ ├── sidebar │ │ │ │ └── index.ts │ │ │ ├── source │ │ │ │ ├── _ │ │ │ │ │ └── index.ts │ │ │ │ ├── facts │ │ │ │ │ ├── _ │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── github │ │ │ │ │ │ └── index.ts │ │ │ │ │ ├── gitlab │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── index.ts │ │ │ │ └── index.ts │ │ │ ├── tabs │ │ │ │ └── index.ts │ │ │ ├── toc │ │ │ │ └── index.ts │ │ │ ├── tooltip │ │ │ │ └── index.ts │ │ │ ├── tooltip2 │ │ │ │ └── index.ts │ │ │ └── top │ │ │ │ └── index.ts │ │ ├── integrations │ │ │ ├── clipboard │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ ├── instant │ │ │ │ ├── .eslintrc │ │ │ │ └── index.ts │ │ │ ├── search │ │ │ │ ├── _ │ │ │ │ │ └── index.ts │ │ │ │ ├── config │ │ │ │ │ └── index.ts │ │ │ │ ├── highlighter │ │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ └── query │ │ │ │ │ ├── _ │ │ │ │ │ └── index.ts │ │ │ │ │ └── index.ts │ │ │ ├── sitemap │ │ │ │ ├── .eslintrc │ │ │ │ └── index.ts │ │ │ └── version │ │ │ │ ├── .eslintrc │ │ │ │ ├── findurl │ │ │ │ └── index.ts │ │ │ │ └── index.ts │ │ ├── patches │ │ │ ├── ellipsis │ │ │ │ └── index.ts │ │ │ ├── indeterminate │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ ├── scrollfix │ │ │ │ └── index.ts │ │ │ └── scrolllock │ │ │ │ └── index.ts │ │ ├── polyfills │ │ │ └── index.ts │ │ ├── sphinx_search.ts │ │ ├── templates │ │ │ ├── annotation │ │ │ │ └── index.tsx │ │ │ ├── clipboard │ │ │ │ └── index.tsx │ │ │ ├── index.ts │ │ │ ├── search │ │ │ │ └── index.tsx │ │ │ ├── source │ │ │ │ └── index.tsx │ │ │ ├── tabbed │ │ │ │ └── index.tsx │ │ │ ├── table │ │ │ │ └── index.tsx │ │ │ ├── tooltip │ │ │ │ └── index.tsx │ │ │ └── version │ │ │ │ └── index.tsx │ │ └── utilities │ │ │ ├── h │ │ │ ├── .eslintrc │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ └── round │ │ │ └── index.ts │ └── stylesheets │ │ ├── _config.scss │ │ ├── main.scss │ │ ├── main │ │ ├── _api.scss │ │ ├── _colors.scss │ │ ├── _icons.scss │ │ ├── _resets.scss │ │ ├── _sphinx.scss │ │ ├── _typeset.scss │ │ ├── components │ │ │ ├── _author.scss │ │ │ ├── _banner.scss │ │ │ ├── _base.scss │ │ │ ├── _clipboard.scss │ │ │ ├── _code.scss │ │ │ ├── _consent.scss │ │ │ ├── _content.scss │ │ │ ├── _dialog.scss │ │ │ ├── _feedback.scss │ │ │ ├── _footer.scss │ │ │ ├── _form.scss │ │ │ ├── _header.scss │ │ │ ├── _hero.scss │ │ │ ├── _meta.scss │ │ │ ├── _nav.scss │ │ │ ├── _pagination.scss │ │ │ ├── _post.scss │ │ │ ├── _progress.scss │ │ │ ├── _search.scss │ │ │ ├── _select.scss │ │ │ ├── _sidebar.scss │ │ │ ├── _source.scss │ │ │ ├── _status.scss │ │ │ ├── _tabs.scss │ │ │ ├── _tag.scss │ │ │ ├── _tooltip.scss │ │ │ ├── _tooltip2.scss │ │ │ ├── _top.scss │ │ │ └── _version.scss │ │ ├── extensions │ │ │ ├── markdown │ │ │ │ ├── _admonition.scss │ │ │ │ ├── _footnotes.scss │ │ │ │ └── _toc.scss │ │ │ ├── pymdownx │ │ │ │ ├── _arithmatex.scss │ │ │ │ ├── _critic.scss │ │ │ │ ├── _details.scss │ │ │ │ ├── _emoji.scss │ │ │ │ ├── _highlight.scss │ │ │ │ ├── _keys.scss │ │ │ │ ├── _tabbed.scss │ │ │ │ └── _tasklist.scss │ │ │ └── readthedocs │ │ │ │ └── _readthedocs.scss │ │ ├── integrations │ │ │ ├── _giscus.scss │ │ │ ├── _graphviz.scss │ │ │ └── _mermaid.scss │ │ └── modifiers │ │ │ ├── _grid.scss │ │ │ └── _inline.scss │ │ ├── palette.scss │ │ ├── palette │ │ ├── _accent.scss │ │ ├── _primary.scss │ │ └── _scheme.scss │ │ └── utilities │ │ ├── _break.scss │ │ └── _convert.scss │ ├── base.html │ ├── blog-post.html │ ├── blog.html │ ├── layout.html │ ├── main.html │ ├── partials │ ├── actions.html │ ├── alternate.html │ ├── comments.html │ ├── consent.html │ ├── content.html │ ├── copyright.html │ ├── feedback.html │ ├── footer.html │ ├── header.html │ ├── hero.html │ ├── icons.html │ ├── integrations │ │ ├── analytics.html │ │ └── analytics │ │ │ └── google.html │ ├── javascripts │ │ ├── announce.html │ │ ├── base.html │ │ ├── consent.html │ │ ├── content.html │ │ ├── outdated.html │ │ └── palette.html │ ├── language.html │ ├── languages │ │ ├── af.html │ │ ├── ar.html │ │ ├── az.html │ │ ├── be.html │ │ ├── bg.html │ │ ├── bn.html │ │ ├── ca.html │ │ ├── cs.html │ │ ├── da.html │ │ ├── de.html │ │ ├── el.html │ │ ├── en.html │ │ ├── eo.html │ │ ├── es.html │ │ ├── et.html │ │ ├── eu.html │ │ ├── fa.html │ │ ├── fi.html │ │ ├── fr.html │ │ ├── gl.html │ │ ├── he.html │ │ ├── hi.html │ │ ├── hr.html │ │ ├── hu.html │ │ ├── hy.html │ │ ├── id.html │ │ ├── is.html │ │ ├── it.html │ │ ├── ja.html │ │ ├── ka.html │ │ ├── kn.html │ │ ├── ko.html │ │ ├── ku-IQ.html │ │ ├── lb.html │ │ ├── lt.html │ │ ├── lv.html │ │ ├── mk.html │ │ ├── mn.html │ │ ├── ms.html │ │ ├── my.html │ │ ├── nb.html │ │ ├── nl.html │ │ ├── nn.html │ │ ├── pl.html │ │ ├── pt-BR.html │ │ ├── pt.html │ │ ├── ro.html │ │ ├── ru.html │ │ ├── sa.html │ │ ├── sh.html │ │ ├── si.html │ │ ├── sk.html │ │ ├── sl.html │ │ ├── sq.html │ │ ├── sr.html │ │ ├── sv.html │ │ ├── ta.html │ │ ├── te.html │ │ ├── th.html │ │ ├── tl.html │ │ ├── tr.html │ │ ├── uk.html │ │ ├── ur.html │ │ ├── uz.html │ │ ├── vi.html │ │ ├── zh-Hant.html │ │ ├── zh-TW.html │ │ └── zh.html │ ├── logo.html │ ├── nav-item.html │ ├── nav.html │ ├── pagination.html │ ├── palette.html │ ├── post.html │ ├── progress.html │ ├── search.html │ ├── social.html │ ├── source-file.html │ ├── source.html │ ├── tabs-item.html │ ├── tabs.html │ ├── tags.html │ ├── toc-item.html │ ├── toc.html │ └── top.html │ └── redirect.html ├── tests ├── README.rst ├── admonition_test.py ├── code_annotations_test.py ├── conftest.py ├── content_tabs_test.py ├── cpp_api_parser_test.py ├── cpp_apigen_test.py ├── cpp_domain_test.py ├── cpp_xref_c_domain_test.py ├── extra_scope_test.py ├── format_signatures_test.py ├── genindex_test.py ├── graphviz_test.py ├── inline_icon_test.py ├── inline_syntax_highlight_test.py ├── issue_134 │ ├── issue_134_test.py │ └── sphinx-immaterial-pybind11-issue-134 │ │ ├── pyproject.toml │ │ ├── setup.py │ │ └── sphinx_immaterial_pybind11_issue_134.cpp ├── json_domain_test.py ├── kbd_keys_test.py ├── mermaid_test.py ├── nav_adapt_test.py ├── python_apigen_test.py ├── python_apigen_test_modules │ ├── __init__.py │ ├── _alpha.py │ ├── _bravo.py │ ├── alphabetical.py │ ├── classmethod.py │ ├── issue147.py │ ├── property.py │ └── type_params.py ├── python_object_ids_test.py ├── python_parameter_cross_link_test.py ├── python_synopsis_test.py ├── python_transform_type_annotations_test.py ├── python_type_param_utils_test.py ├── search_index_test.py ├── sitemap_test.py ├── snapshots │ ├── cpp_domain_test │ │ ├── test_macro_parameter_objects │ │ │ └── references.txt │ │ ├── test_parameter_objects │ │ │ ├── None │ │ │ │ └── references.txt │ │ │ ├── abc │ │ │ │ └── references.txt │ │ │ └── empty │ │ │ │ └── references.txt │ │ └── test_template_parameter_objects │ │ │ └── references.txt │ ├── format_signatures_test │ │ └── test_format_signatures │ │ │ ├── cpp_function_astext.txt │ │ │ ├── cpp_function_long_astext.txt │ │ │ ├── cpp_function_long_return_type_astext.txt │ │ │ ├── py_class_astext.txt │ │ │ ├── py_class_constructor_astext.txt │ │ │ ├── py_class_constructor_long_astext.txt │ │ │ ├── py_function2_astext.txt │ │ │ ├── py_function3_astext.txt │ │ │ └── py_function_astext.txt │ ├── nav_adapt_test │ │ ├── test_include_rubrics_in_toc │ │ │ ├── False │ │ │ │ └── index.yml │ │ │ └── True │ │ │ │ └── index.yml │ │ └── test_nav │ │ │ ├── collapse_False-includeonly_False │ │ │ ├── a.yml │ │ │ ├── b.yml │ │ │ ├── c.yml │ │ │ └── index.yml │ │ │ ├── collapse_False-includeonly_True │ │ │ ├── a.yml │ │ │ ├── b.yml │ │ │ ├── c.yml │ │ │ └── index.yml │ │ │ ├── collapse_True-includeonly_False │ │ │ ├── a.yml │ │ │ ├── b.yml │ │ │ ├── c.yml │ │ │ └── index.yml │ │ │ └── collapse_True-includeonly_True │ │ │ ├── a.yml │ │ │ ├── b.yml │ │ │ ├── c.yml │ │ │ └── index.yml │ ├── python_apigen_test │ │ └── test_pybind11_overloaded_function │ │ │ ├── Example.bar_bool.json │ │ │ ├── Example.bar_int.json │ │ │ ├── Example.foo_bool.json │ │ │ └── Example.foo_int.json │ └── python_synopsis_test │ │ └── test_python_class_synopsis │ │ └── reftitle.txt ├── system_fonts_test.py ├── task_list_test.py ├── test_serializable_build.py └── theme_result_test.py ├── tools └── build │ ├── _ │ └── index.ts │ ├── copy │ └── index.ts │ ├── index.ts │ └── transform │ └── index.ts ├── tsconfig.json ├── typings ├── _ │ └── index.d.ts ├── google-fonts │ └── index.d.ts └── mermaid │ └── index.d.ts ├── typings_py └── pymdownx │ ├── __init__.pyi │ └── keymap_db.pyi └── uv.lock /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: "Google" 2 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016-2025 Martin Donath 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to 5 | # deal in the Software without restriction, including without limitation the 6 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | # sell copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | # IN THE SOFTWARE. 20 | 21 | # Top-level config 22 | root = true 23 | 24 | # All files 25 | [*] 26 | charset = utf-8 27 | indent_style = space 28 | indent_size = 2 29 | end_of_line = lf 30 | insert_final_newline = true 31 | trim_trailing_whitespace = true 32 | 33 | # Python 34 | [*.py] 35 | indent_style = space 36 | indent_size = 4 37 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016-2025 Martin Donath 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to 5 | # deal in the Software without restriction, including without limitation the 6 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | # sell copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | # IN THE SOFTWARE. 20 | 21 | # ----------------------------------------------------------------------------- 22 | # Node, TypeScript, Python 23 | # ----------------------------------------------------------------------------- 24 | 25 | # Dependencies 26 | node_modules 27 | __pycache__ 28 | venv 29 | 30 | # Build files 31 | /docs/_build 32 | MANIFEST 33 | manifest.json 34 | site 35 | 36 | # Configuration 37 | typings 38 | webpack.config.ts 39 | 40 | # Distribution files 41 | dist 42 | mkdocs_material.egg-info 43 | 44 | # Caches and logs 45 | *.cpuprofile 46 | *.log 47 | *.tsbuildinfo 48 | .eslintcache 49 | 50 | # ----------------------------------------------------------------------------- 51 | # General 52 | # ----------------------------------------------------------------------------- 53 | 54 | # Temporary files 55 | tmp 56 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Prevent line ending conversions by default to avoid problems with binary files. 2 | * -text 3 | 4 | # Known text files should have LF line endings. 5 | *.py text eol=lf 6 | *.rst text eol=lf 7 | *.md text eol=lf 8 | *.toml text eol=lf 9 | *.txt text eol=lf 10 | *.scss text eol=lf 11 | *.ts text eol=lf 12 | *.json text eol=lf 13 | *.html text eol=lf 14 | *.css text eol=lf 15 | *.tsx text eol=lf 16 | *.svg text eol=lf 17 | *.sh text eol=lf 18 | *.xml text eol=lf 19 | *.dot text eol=lf 20 | LICENSE text eol=lf 21 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | # Note: Disable dependabot for Python until uv support is available: https://github.com/dependabot/dependabot-core/issues/10478 9 | # - package-ecosystem: "pip" # See documentation for possible values 10 | # directory: "/" # recursive; requirements.txt in subdirectories are also monitored 11 | # schedule: 12 | # interval: "weekly" 13 | # ignore: 14 | # - dependency-name: sphinxcontrib-*help 15 | # - dependency-name: sphinxcontrib-serializinghtml 16 | # node.js dependencies are pinned to last merge from upstream. 17 | # - package-ecosystem: "npm" 18 | # directory: "/" # Location of package manifests 19 | # schedule: 20 | # interval: "weekly" 21 | - package-ecosystem: "github-actions" 22 | directory: "/" # auto-scans .github/workflows/*.yml 23 | schedule: 24 | interval: "weekly" 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | *.py[cod] 3 | /.eslintcache 4 | 5 | /.log 6 | /.eggs 7 | /.tox 8 | 9 | /*.egg-info 10 | /dist 11 | 12 | # python virtual env 13 | .env/ 14 | .venv/ 15 | 16 | # Unit test / coverage reports 17 | .pytest_cache/ 18 | htmlcov/ 19 | .coverage* 20 | coverage.xml 21 | .nox/ 22 | 23 | # Sphinx documentation 24 | docs/_build/ 25 | docs/python_apigen_generated/ 26 | docs/cpp_apigen_generated/ 27 | 28 | # mypy 29 | .mypy_cache/ 30 | .dmypy.json 31 | dmypy.json 32 | 33 | # Pyre type checker 34 | .pyre/ 35 | .idea/ 36 | 37 | # NPM modules 38 | /node_modules/ 39 | 40 | # Built version 41 | /sphinx_immaterial/partials 42 | /sphinx_immaterial/*.html 43 | /sphinx_immaterial/.icons 44 | /sphinx_immaterial/static 45 | /sphinx_immaterial/bundles 46 | /sphinx_immaterial/LICENSE 47 | 48 | # user specific 49 | .vscode/ 50 | 51 | # pybind11 tests' build artifacts 52 | tests/**/build/ 53 | tests/**/*.egg-info/ 54 | tests/**/*.so 55 | tests/**/*.pyd 56 | -------------------------------------------------------------------------------- /.pep8speaks.yml: -------------------------------------------------------------------------------- 1 | scanner: 2 | diff_only: True 3 | linter: flake8 4 | 5 | flake8: 6 | max-line-length: 90 # Default is 79 in PEP 8 7 | ignore: # Errors and warnings to ignore 8 | - E203 9 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yaml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Set the version of Python and other tools you might need 9 | build: 10 | os: ubuntu-24.04 11 | tools: 12 | python: "3.13" 13 | nodejs: "16" 14 | apt_packages: 15 | - graphviz 16 | jobs: 17 | post_install: 18 | - pip install uv 19 | - UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --all-extras --group docs --link-mode=copy 20 | 21 | 22 | # Build documentation in the docs/ directory with Sphinx 23 | sphinx: 24 | configuration: docs/conf.py 25 | -------------------------------------------------------------------------------- /.style.yapf: -------------------------------------------------------------------------------- 1 | [style] 2 | based_on_style = pep8 3 | -------------------------------------------------------------------------------- /.stylelintignore: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016-2025 Martin Donath 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to 5 | # deal in the Software without restriction, including without limitation the 6 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | # sell copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | # IN THE SOFTWARE. 20 | 21 | # Distribution files 22 | docs 23 | material 24 | src/**/*.html 25 | 26 | # Prevent stylelint from constantly complaining 27 | *.css 28 | *.ts 29 | -------------------------------------------------------------------------------- /MKDOCS_MATERIAL_MERGE_BASE: -------------------------------------------------------------------------------- 1 | 396c493f4774fa0bafeada5d0b555d02193557e8 2 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | patch: 4 | default: 5 | informational: true 6 | project: 7 | default: 8 | target: auto 9 | # adjust accordingly based on how flaky your tests are 10 | # this allows a 2% drop from the previous base commit coverage 11 | threshold: 2% 12 | -------------------------------------------------------------------------------- /docs/_static/custom_font_example.css: -------------------------------------------------------------------------------- 1 | /* comic-neue-latin-400-normal */ 2 | @font-face { 3 | font-family: 'Comic Neue'; 4 | font-style: normal; 5 | font-display: swap; 6 | font-weight: 400; 7 | src: url('./example-custom-font/comic-neue-latin-400-normal.woff2') format('woff2'), url('./example-custom-font/comic-neue-latin-400-normal.woff') format('woff'); 8 | } 9 | /* comic-mono-latin-400-normal */ 10 | @font-face { 11 | font-family: 'Comic Mono'; 12 | font-style: normal; 13 | font-display: swap; 14 | font-weight: 400; 15 | src: url('./example-custom-font/comic-mono-latin-400-normal.woff2') format('woff2'), url('./example-custom-font/comic-mono-latin-400-normal.woff') format('woff'); 16 | } 17 | -------------------------------------------------------------------------------- /docs/_static/example-custom-font/comic-mono-latin-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/_static/example-custom-font/comic-mono-latin-400-normal.woff -------------------------------------------------------------------------------- /docs/_static/example-custom-font/comic-mono-latin-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/_static/example-custom-font/comic-mono-latin-400-normal.woff2 -------------------------------------------------------------------------------- /docs/_static/example-custom-font/comic-neue-latin-400-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/_static/example-custom-font/comic-neue-latin-400-normal.woff -------------------------------------------------------------------------------- /docs/_static/example-custom-font/comic-neue-latin-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/_static/example-custom-font/comic-neue-latin-400-normal.woff2 -------------------------------------------------------------------------------- /docs/_static/images/Ybin.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/_static/images/Ybin.gif -------------------------------------------------------------------------------- /docs/_static/images/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/_static/images/blank.png -------------------------------------------------------------------------------- /docs/_static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/_static/images/favicon.ico -------------------------------------------------------------------------------- /docs/_static/sphinx_logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_templates/autosummary/attribute.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | {{ fullname | escape | underline}} 4 | 5 | .. currentmodule:: {{ module }} 6 | 7 | attribute 8 | 9 | .. auto{{ objtype }}:: {{ objname }} 10 | -------------------------------------------------------------------------------- /docs/_templates/autosummary/class.rst: -------------------------------------------------------------------------------- 1 | {{ fullname | escape | underline}} 2 | 3 | .. currentmodule:: {{ module }} 4 | 5 | .. autoclass:: {{ objname }} 6 | :exclude-members: 7 | 8 | {% block methods %} 9 | {% if methods %} 10 | .. rubric:: Methods 11 | 12 | .. autosummary:: 13 | :toctree: generated/ 14 | 15 | {% for item in methods %} 16 | {%- if not item.startswith('_') or item in ['__call__'] %} ~{{ name }}.{{ item }} 17 | {% endif %} 18 | {%- endfor %} 19 | {% endif %} 20 | {% endblock %} 21 | {% block attributes %} 22 | {% if attributes %} 23 | .. rubric:: Properties 24 | 25 | .. autosummary:: 26 | :toctree: generated/ 27 | 28 | {% for item in attributes %} 29 | {%- if not item.startswith('_') or item in ['__call__'] %} ~{{ name }}.{{ item }} 30 | {% endif %} 31 | {%- endfor %} 32 | {% endif %} 33 | {% endblock %} 34 | -------------------------------------------------------------------------------- /docs/_templates/autosummary/member.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | {{ fullname | escape | underline}} 4 | 5 | .. currentmodule:: {{ module }} 6 | 7 | member 8 | 9 | .. auto{{ objtype }}:: {{ objname }} 10 | -------------------------------------------------------------------------------- /docs/_templates/autosummary/method.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | {{ fullname | escape | underline}} 4 | 5 | .. currentmodule:: {{ module }} 6 | 7 | method 8 | 9 | .. auto{{ objtype }}:: {{ objname }} 10 | -------------------------------------------------------------------------------- /docs/_templates/autosummary/minimal_module.rst: -------------------------------------------------------------------------------- 1 | {{ fullname | escape | underline}} 2 | 3 | .. automodule:: {{ fullname }} 4 | 5 | {% block docstring %} 6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /docs/_templates/base.html: -------------------------------------------------------------------------------- 1 | {% extends "!base.html" %} 2 | {% block announce %} 3 |

4 | Now includes 5 | changes from mkdocs-material theme 6 | v9.6.5 7 |

8 | {% endblock %} 9 | -------------------------------------------------------------------------------- /docs/_templates/material-design-build-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/apidoc/cpp/cppreference.rst: -------------------------------------------------------------------------------- 1 | Automatic cross-linking to cppreference.com 2 | =========================================== 3 | 4 | This theme provides an optional 5 | :python:`sphinx_immaterial.apidoc.cpp.cppreference` extension that provides 6 | automatic linking to C/C++ standard symbols documented at 7 | https://cppreference.com. 8 | 9 | To use this extension, simply add it to the list of extensions in :file:`conf.py`: 10 | 11 | .. code-block:: python 12 | 13 | extensions = [ 14 | # other extensions... 15 | "sphinx_immaterial.apidoc.cpp.cppreference", 16 | ] 17 | 18 | .. rst-example:: 19 | 20 | .. cpp:function:: template \ 21 | std::enable_if_t || \ 22 | std::is_same_v, \ 23 | std::string> \ 24 | ConvertVectorToString(std::vector x); 25 | 26 | Converts an :cpp:expr:`std::vector` to an :cpp:expr:`std::string`. 27 | 28 | .. confval:: cppreference_xml_files 29 | 30 | Overrides the default list of XML data files to use. This allows an 31 | alternative (e.g. newer) version of the cppreference XML data files that are 32 | available at: 33 | 34 | - https://raw.githubusercontent.com/p12tic/cppreference-doc/master/index-functions-c.xml 35 | - https://raw.githubusercontent.com/p12tic/cppreference-doc/master/index-functions-cpp.xml 36 | 37 | For example, if newer versions of the C and C++ XML files have been copied 38 | to the documentation root directory, they can be used with the following 39 | configuration: 40 | 41 | .. code-block:: python 42 | 43 | cppreference_xml_files = [ 44 | ("C", "index-functions-c.xml"), 45 | ("C++", "index-functions-cpp.xml"), 46 | ] 47 | 48 | .. seealso:: 49 | 50 | - :doc:`external_cpp_references` 51 | -------------------------------------------------------------------------------- /docs/apidoc/cpp/external_cpp_references.rst: -------------------------------------------------------------------------------- 1 | External C++ symbol links 2 | ========================= 3 | 4 | This theme includes an optional 5 | :python:`sphinx_immaterial.apidoc.cpp.external_cpp_references` extension that 6 | allows normal C++ symbol references, e.g. through the :rst:role:`cpp:expr` role 7 | or in C++ function signatures, to resolve to externally-defined C++ symbols that 8 | are manually specified in :file:`conf.py`. Unlike the `sphinx.ext.intersphinx` 9 | extension, template arguments are stripped when resolving references, which 10 | allows template entities to be resolved based on their base name. 11 | 12 | To use this extension, add it to the list of extensions in :file:`conf.py` and 13 | define the :confval:`external_cpp_references` configuration option: 14 | 15 | .. code-block:: python 16 | 17 | extensions = [ 18 | # other extensions... 19 | "sphinx_immaterial.apidoc.cpp.external_cpp_references", 20 | ] 21 | 22 | .. literalinclude:: /conf.py 23 | :language: python 24 | :start-after: # BEGIN: sphinx_immaterial.apidoc.cpp.external_cpp_references extension options 25 | :end-before: # END: sphinx_immaterial.apidoc.cpp.external_cpp_references extension options 26 | 27 | .. rst-example:: 28 | 29 | .. cpp:function:: int ExtractValueFromJson(::nlohmann::json json_value); 30 | 31 | Extracts a value from a JSON object. 32 | 33 | .. confval:: external_cpp_references 34 | 35 | A dictionary specifying the URL, object type, and descriptive text for each externally 36 | documented symbol name. 37 | 38 | .. autoclass:: sphinx_immaterial.apidoc.cpp.external_cpp_references.ExternalCppReference 39 | :members: 40 | :show-inheritance: 41 | :exclude-members: __new__ 42 | 43 | .. seealso:: 44 | :doc:`cppreference` 45 | -------------------------------------------------------------------------------- /docs/apidoc/json/inheritance_schema.yml: -------------------------------------------------------------------------------- 1 | $schema: http://json-schema.org/draft-07/schema# 2 | $id: Pet 3 | title: "Represents a generic pet." 4 | type: object 5 | properties: 6 | type: 7 | type: string 8 | title: Type of pet. 9 | name: 10 | type: string 11 | title: Name of the pet. 12 | age: 13 | type: number 14 | title: Age of the pet in years. 15 | minimum: 0 16 | required: 17 | - type 18 | - name 19 | 20 | definitions: 21 | dog: 22 | $id: Dog 23 | title: "Represents a dog." 24 | allOf: 25 | - $ref: Pet 26 | - type: object 27 | properties: 28 | type: 29 | const: "dog" 30 | bark_volume: 31 | type: number 32 | title: "Bark volume in dB." 33 | favorite_walk: 34 | type: string 35 | title: "Favorite place to walk." 36 | cat: 37 | $id: Cat 38 | title: "Represents a cat." 39 | allOf: 40 | - $ref: Pet 41 | - type: object 42 | properties: 43 | type: 44 | const: "cat" 45 | meow_volume: 46 | type: number 47 | title: "Meow volume in dB." 48 | favorite_scratching_post: 49 | type: string 50 | title: "Favorite place to scratch." 51 | examples: 52 | - {"type": "cat", "name": "Tom", "age": 10, "meow_volume": 45} 53 | -------------------------------------------------------------------------------- /docs/code_syntax_highlighting.rst: -------------------------------------------------------------------------------- 1 | Code syntax highlighting 2 | ======================== 3 | 4 | .. rst:directive:: .. default-literal-role:: role 5 | 6 | Sets the default literal role generated by double backticks literal syntax. 7 | 8 | Normally, double backticks: 9 | 10 | .. code-block:: rst 11 | 12 | ``abc`` 13 | 14 | is equivalent to the :durole:`literal` role: 15 | 16 | .. code-block:: rst 17 | 18 | :literal:`abc` 19 | 20 | This directive causes the double backticks syntax to instead generate the 21 | specified role. Invoking the directive with no argument resets the literal 22 | role back to the default of :durole:`literal`. 23 | 24 | .. rst-example:: Changing the literal role 25 | 26 | Normal literal role: ``1 + 2`` 27 | 28 | .. default-literal-role:: python 29 | 30 | Python literal role: ``1 + 2`` 31 | 32 | .. default-literal-role:: 33 | 34 | Normal literal role again: ``1 + 2`` 35 | 36 | .. rst:directive:: highlight-push 37 | 38 | Saves the current :rst:dir:`highlight` settings. The saved settings can be 39 | restored using the :rst:dir:`highlight-pop` directive. 40 | 41 | .. rst-example:: Temporarily changing the highlight language 42 | 43 | .. highlight-push:: 44 | 45 | .. highlight:: json 46 | 47 | The following literal block will be highlighted as JSON:: 48 | 49 | {"a": 10, "b": null, "c": 10} 50 | 51 | .. highlight-push:: 52 | 53 | .. highlight:: python 54 | 55 | The following block will be highlighted as Python:: 56 | 57 | def foo(x: int) -> None: ... 58 | 59 | .. highlight-pop:: 60 | 61 | The following block will be highlighted as JSON:: 62 | 63 | [1, 2, true, false] 64 | 65 | .. rst:directive:: highlight-pop 66 | 67 | Restores the :rst:dir:`highlight` settings saved by a prior invocation of 68 | :rst:dir:`highlight-push`. 69 | -------------------------------------------------------------------------------- /docs/cpp_apigen_demo.rst: -------------------------------------------------------------------------------- 1 | cpp_apigen demo 2 | =============== 3 | 4 | Indexing 5 | -------- 6 | 7 | .. cpp-apigen-group:: indexing 8 | 9 | 10 | Array 11 | ----- 12 | 13 | .. cpp-apigen-group:: array 14 | -------------------------------------------------------------------------------- /docs/cpp_apigen_demo/array.h: -------------------------------------------------------------------------------- 1 | #ifndef CPP_APIGEN_DEMO_ARRAY_H 2 | #define CPP_APIGEN_DEMO_ARRAY_H 3 | 4 | #include "fake_stdlib.h" 5 | 6 | namespace cpp_apigen_demo { 7 | 8 | /// Specifies the array data order. 9 | /// 10 | /// \ingroup array 11 | enum class DataOrder { 12 | /// C order 13 | C = 0, 14 | /// Fortran order 15 | F = 1, 16 | }; 17 | 18 | /// Prints a string representation of a data order. 19 | /// 20 | /// \relates DataOrder 21 | std::ostream& operator<<(std::ostream& os, DataOrder order); 22 | 23 | /// Defines a multi-dimensional array view. 24 | /// 25 | /// \ingroup array 26 | /// \tparam T Array element type. 27 | /// \tparam Rank Number of dimensions. 28 | template 29 | class Array { 30 | public: 31 | /// Constructs an array. 32 | /// 33 | /// \param data The data pointer. 34 | /// \param shape The shape of the array. 35 | /// \id data, shape 36 | Array(T* data, std::array shape, DataOrder order = DataOrder::C); 37 | 38 | /// Converts from a compatible array. 39 | /// 40 | /// \tparam U Compatible array element type. 41 | /// \id convert 42 | template >> 44 | Array(const Array& other); 45 | 46 | /// Returns the data pointer. 47 | T* data() const; 48 | 49 | /// Returns the shape pointer. 50 | const std::array& shape() const; 51 | 52 | /// Returns the data order. 53 | DataOrder order() const; 54 | 55 | /// Returns the element at the specified index or index vector. 56 | /// 57 | /// \param index The index vector, or an integer index in the case that `Rank == 1`. 58 | template > 59 | T operator[](int index); 60 | T operator[](std::array index); 61 | }; 62 | 63 | } // namespace cpp_apigen_demo 64 | 65 | #endif // CPP_APIGEN_DEMO_ARRAY_H 66 | -------------------------------------------------------------------------------- /docs/cpp_apigen_demo/fake_stdlib.h: -------------------------------------------------------------------------------- 1 | #ifndef CPP_APIGEN_DEMO_FAKE_STDLIB_H 2 | #define CPP_APIGEN_DEMO_FAKE_STDLIB_H 3 | 4 | namespace std { 5 | class ostream; 6 | template 7 | class array; 8 | template 9 | using enable_if_t = T; 10 | template 11 | constexpr inline bool is_convertible_v = true; 12 | } // namespace std 13 | 14 | #endif // CPP_APIGEN_DEMO_FAKE_STDLIB_H 15 | -------------------------------------------------------------------------------- /docs/cpp_apigen_demo/index_interval.h: -------------------------------------------------------------------------------- 1 | #ifndef CPP_APIGEN_DEMO_INDEX_INTERVAL_H 2 | #define CPP_APIGEN_DEMO_INDEX_INTERVAL_H 3 | 4 | #include "fake_stdlib.h" 5 | 6 | namespace cpp_apigen_demo { 7 | 8 | /// Demonstrates a non-template class. 9 | /// 10 | /// \ingroup indexing 11 | class IndexInterval { 12 | public: 13 | /// Constructs an interval. 14 | /// 15 | /// \param lower Lower bound. 16 | /// \param upper Upper bound. 17 | explicit IndexInterval(int lower, int upper); 18 | 19 | /// Prints a string representation to `os`. 20 | friend std::ostream& operator<<(std::ostream& os, IndexInterval x); 21 | 22 | /// Returns the lower bound. 23 | /// 24 | //! @returns The lower bound. 25 | int lower() const; 26 | 27 | /// Returns the upper bound. 28 | int upper() const; 29 | }; 30 | 31 | /// Computes the union of two intervals. 32 | /// 33 | /// \relates IndexInterval 34 | IndexInterval Union(IndexInterval a, IndexInterval b); 35 | 36 | } // namespace cpp_apigen_demo 37 | 38 | #endif // CPP_APIGEN_DEMO_INDEX_INTERVAL_H 39 | -------------------------------------------------------------------------------- /docs/desert-flower.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/desert-flower.jpg -------------------------------------------------------------------------------- /docs/favicon.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/favicon.xcf -------------------------------------------------------------------------------- /docs/python_apigen_demo.rst: -------------------------------------------------------------------------------- 1 | python_apigen demo 2 | ================== 3 | 4 | Indexing 5 | -------- 6 | 7 | .. python-apigen-group:: indexing 8 | 9 | Some other group 10 | ---------------- 11 | 12 | .. python-apigen-group:: some-other-group 13 | 14 | Type parameter demo 15 | ------------------- 16 | 17 | .. python-apigen-group:: type-param 18 | -------------------------------------------------------------------------------- /docs/rst-cheatsheet/README-cp.txt: -------------------------------------------------------------------------------- 1 | You are free: 2 | 3 | * to copy, distribute, display, and perform the work 4 | * to make derivative works 5 | 6 | 7 | Under the following conditions: 8 | 9 | Attribution. You must give the original author credit. 10 | 11 | * For any reuse or distribution, you must make clear to others the licence terms of this work. 12 | * Any of the above conditions can be waived if you get permission from the copyright holder. 13 | * Nothing in this license impairs or restricts the author's moral rights. 14 | 15 | 16 | http://creativecommons.org/licenses/by/3.0/de/deed.en_GB 17 | -------------------------------------------------------------------------------- /docs/rst-cheatsheet/attrib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/rst-cheatsheet/attrib.png -------------------------------------------------------------------------------- /docs/rst-cheatsheet/biohazard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/rst-cheatsheet/biohazard.png -------------------------------------------------------------------------------- /docs/rst-cheatsheet/magnetic-balls.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/rst-cheatsheet/magnetic-balls.jpg -------------------------------------------------------------------------------- /docs/rst-cheatsheet/noncomm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/rst-cheatsheet/noncomm.png -------------------------------------------------------------------------------- /docs/rst-cheatsheet/sharealike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/rst-cheatsheet/sharealike.png -------------------------------------------------------------------------------- /docs/subpage1.rst: -------------------------------------------------------------------------------- 1 | Sub page 1 with a very long page title so that it is sure to wrap 2 | ================================================================= 3 | 4 | This is sub page 1. 5 | 6 | This is an extremely long caption for the first set of TOC entries, we are making it long so that it wraps. 7 | ----------------------------------------------------------------------------------------------------------- 8 | 9 | .. toctree:: 10 | :caption: This is an extremely long caption for the first set of TOC entries, we are making it long so that it wraps. 11 | 12 | subpage1subpage1 13 | 14 | .. toctree:: 15 | :caption: This is another extremely long caption for the second set of TOC entries. 16 | 17 | subpage1subpage2 18 | -------------------------------------------------------------------------------- /docs/subpage1subpage1.rst: -------------------------------------------------------------------------------- 1 | Sub page 1 sub page 1 2 | ===================== 3 | 4 | This is sub page 1 sub page 1. 5 | -------------------------------------------------------------------------------- /docs/subpage1subpage2.rst: -------------------------------------------------------------------------------- 1 | Sub page 1 sub page 2 2 | ===================== 3 | 4 | This is sub page 1 sub page 2. 5 | 6 | This page has multiple top-level headings. 7 | 8 | 9 | Another top-level heading 10 | ========================= 11 | 12 | This is the content of the additional top-level heading. 13 | 14 | Yet another top-level heading 15 | ============================= 16 | 17 | This is yet another top-level heading. 18 | -------------------------------------------------------------------------------- /docs/subpage2.rst: -------------------------------------------------------------------------------- 1 | Sub page 2 2 | ========== 3 | 4 | This is sub page 2. 5 | -------------------------------------------------------------------------------- /docs/tensorstore_demo/_tensorstore.py: -------------------------------------------------------------------------------- 1 | """Demo file for Python API documentation generation. 2 | 3 | This defines some entities that are aliased into the `tensorstore_demo` module. 4 | """ 5 | 6 | import typing 7 | 8 | 9 | class Foo: 10 | """ 11 | This is a class defined in the ``tensorstore_demo._tensorstore`` module 12 | but should appear to be defined in the ``tensorstore_demo`` module. 13 | 14 | Group: 15 | Some other group 16 | """ 17 | 18 | def bar(self, x: int) -> int: 19 | """Returns :py:param:`x`. 20 | 21 | :param x: Parameter to :py:obj:`.bar`. 22 | """ 23 | pass 24 | 25 | 26 | def bar(x: Foo) -> Foo: 27 | """Returns :py:param:`x`. 28 | 29 | :param x: Parameter to :py:obj:`.bar`. 30 | 31 | Group: 32 | Some other group. 33 | """ 34 | pass 35 | 36 | 37 | bar_also = bar 38 | 39 | 40 | class FooSubclass(Foo): 41 | """This is a subclass of :py:obj:`.Foo`. 42 | 43 | Group: 44 | Some other group. 45 | """ 46 | 47 | def baz(self, x: str) -> str: 48 | """Does the baz operation.""" 49 | return x 50 | 51 | @typing.overload 52 | def overloaded_method(self, x: int) -> int: 53 | pass 54 | 55 | @typing.overload 56 | def overloaded_method(self, x: str) -> str: 57 | pass 58 | 59 | def overloaded_method(self, x): 60 | """Returns its argument.""" 61 | return x 62 | -------------------------------------------------------------------------------- /docs/test.dot: -------------------------------------------------------------------------------- 1 | graph { 2 | // use a radial layout (because mermaid.js cannot) 3 | layout=twopi 4 | 5 | A [shape=diamond] 6 | B [shape=box] 7 | C [shape=circle] 8 | 9 | A -- B [style=dashed] 10 | // edge using a static color with transparent fill 11 | A -- C [color="black:invis:black"] 12 | A -- D [penwidth=5, arrowhead=none] 13 | 14 | } 15 | -------------------------------------------------------------------------------- /docs/test_py_module/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/docs/test_py_module/__init__.py -------------------------------------------------------------------------------- /dprint.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | // specify plugin urls here 4 | "https://plugins.dprint.dev/toml-0.6.3.wasm" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/sphinx_immaterial/apidoc/__init__.py -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/cpp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/sphinx_immaterial/apidoc/cpp/__init__.py -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/cpp/ast_fixes.py: -------------------------------------------------------------------------------- 1 | """Fixes limitations of the Sphinx C++ parser.""" 2 | 3 | import sphinx 4 | 5 | if sphinx.version_info >= (8, 2): 6 | from . import ( # noqa: F401 7 | fix_cpp_domain_symbol_resolution_through_type_aliases, 8 | ) 9 | else: 10 | from . import ( # noqa: F401 11 | fix_cpp_domain_symbol_resolution_through_type_aliases_sphinx81, 12 | ) 13 | -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/cpp/cppreference_data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/sphinx_immaterial/apidoc/cpp/cppreference_data/__init__.py -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/cpp/cppreference_data/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | wget https://raw.githubusercontent.com/p12tic/cppreference-doc/master/index-functions-cpp.xml -O index-functions-cpp.xml 4 | wget https://raw.githubusercontent.com/p12tic/cppreference-doc/master/index-functions-c.xml -O index-functions-c.xml 5 | -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/cpp/default.py: -------------------------------------------------------------------------------- 1 | import sphinx.application 2 | 3 | from . import ( 4 | ast_fixes, # noqa: F401 5 | cpp_resolve_c_xrefs, # noqa: F401 6 | include_directives_in_signatures, # noqa: F401 7 | last_resolved_symbol, # noqa: F401 8 | macro_parameters, # noqa: F401 9 | parameter_objects, # noqa: F401 10 | signodes, # noqa: F401 11 | strip_namespaces_from_signatures, # noqa: F401 12 | symbol_ids, # noqa: F401 13 | synopses, # noqa: F401 14 | ) 15 | 16 | 17 | def setup(app: sphinx.application.Sphinx): 18 | app.setup_extension(signodes.__name__) 19 | app.setup_extension(strip_namespaces_from_signatures.__name__) 20 | app.setup_extension(cpp_resolve_c_xrefs.__name__) 21 | 22 | return { 23 | "parallel_read_safe": True, 24 | "parallel_write_safe": True, 25 | } 26 | -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/cpp/macro_parameters.py: -------------------------------------------------------------------------------- 1 | """Adds support for `macroParam` as an object type.""" 2 | 3 | import sphinx.domains.c 4 | from sphinx.domains.c import ( 5 | ASTDeclaration, 6 | ASTMacro, 7 | ASTMacroParameter, 8 | ) 9 | from sphinx.domains.c import ( 10 | Symbol as CSymbol, 11 | ) 12 | 13 | 14 | def _monkey_patch_c_macro_parameter_symbols(): 15 | """Adds support for the `macroParam` object type to the C domain.""" 16 | 17 | orig_add_function_params = CSymbol._add_function_params 18 | 19 | def _add_function_params(self: CSymbol) -> None: 20 | orig_add_function_params(self) 21 | if self.declaration is None or not isinstance( 22 | self.declaration.declaration, ASTMacro 23 | ): 24 | return 25 | args = self.declaration.declaration.args 26 | if not args: 27 | return 28 | for p in args: 29 | nn = p.arg 30 | if nn is None: 31 | continue 32 | decl = ASTDeclaration("macroParam", None, p) # type: ignore[arg-type] 33 | assert not nn.rooted 34 | assert len(nn.names) == 1 35 | self._add_symbols(nn, decl, self.docname, self.line) 36 | 37 | CSymbol._add_function_params = _add_function_params # type: ignore[assignment] 38 | 39 | def get_id( 40 | self: ASTMacroParameter, version: int, objectType: str, symbol: CSymbol 41 | ) -> str: 42 | # the anchor will be our parent 43 | assert symbol.parent is not None 44 | declaration = symbol.parent.declaration 45 | assert declaration is not None 46 | return declaration.get_id(version, prefixed=False) 47 | 48 | ASTMacroParameter.get_id = get_id # type: ignore[attr-defined] 49 | 50 | sphinx.domains.c.CDomain.object_types["macroParam"] = sphinx.domains.ObjType( 51 | "macro parameter", "identifier", "var", "member", "data" 52 | ) 53 | 54 | 55 | _monkey_patch_c_macro_parameter_symbols() 56 | -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/fix_sphinx_issue_11147.py: -------------------------------------------------------------------------------- 1 | """Monkey patches a fix for https://github.com/sphinx-doc/sphinx/pull/11147.""" 2 | 3 | import inspect 4 | 5 | import sphinx.directives 6 | import sphinx.util.docutils 7 | import sphinx.util.nodes 8 | 9 | 10 | def _monkey_patch_nested_parse_with_titles(): 11 | orig_nested_parse_with_titles = sphinx.util.nodes.nested_parse_with_titles 12 | 13 | if list(inspect.signature(orig_nested_parse_with_titles).parameters.keys()) != [ 14 | "state", 15 | "content", 16 | "node", 17 | ]: 18 | # Assume https://github.com/sphinx-doc/sphinx/pull/11147 has been merged. 19 | return 20 | 21 | # Note that this is different from the fix in 22 | # https://github.com/sphinx-doc/sphinx/pull/11147, since it is not practical 23 | # to monkey patch all callers to pass in the `content_offset`. Instead, we 24 | # use `switch_source_input`, which makes it unnecessary to pass in 25 | # `content_offset`. 26 | def nested_parse_with_titles(state, content, node): 27 | with sphinx.util.docutils.switch_source_input(state, content): 28 | return orig_nested_parse_with_titles(state, content, node) 29 | 30 | sphinx.util.nodes.nested_parse_with_titles = nested_parse_with_titles # type: ignore[assignment] 31 | sphinx.directives.nested_parse_with_titles = nested_parse_with_titles # type: ignore[assignment,attr-defined] 32 | 33 | 34 | _monkey_patch_nested_parse_with_titles() 35 | -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/json/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/sphinx_immaterial/apidoc/json/__init__.py -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/python/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/sphinx_immaterial/apidoc/python/__init__.py -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/python/annotation_style.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | import docutils.nodes 4 | import sphinx 5 | import sphinx.addnodes 6 | import sphinx.domains.python 7 | import sphinx.environment 8 | 9 | 10 | def ensure_wrapped_in_desc_type( 11 | nodes: List[docutils.nodes.Node], 12 | ) -> List[docutils.nodes.Node]: 13 | if len(nodes) != 1 or not isinstance(nodes[0], sphinx.addnodes.desc_type): 14 | nodes = [sphinx.addnodes.desc_type("", "", *nodes)] 15 | return nodes 16 | 17 | 18 | def _monkey_patch_python_parse_annotation(): 19 | """Ensures that type annotations in signatures are wrapped in `desc_type`. 20 | 21 | This allows them to be distinguished from parameter names in CSS rules. 22 | """ 23 | if sphinx.version_info >= (7, 3): 24 | orig_parse_annotation = sphinx.domains.python._annotations._parse_annotation # type: ignore[attr-defined] 25 | else: 26 | orig_parse_annotation = sphinx.domains.python._parse_annotation 27 | 28 | def parse_annotation( 29 | annotation: str, env: Optional[sphinx.environment.BuildEnvironment] = None 30 | ) -> List[docutils.nodes.Node]: 31 | return ensure_wrapped_in_desc_type(orig_parse_annotation(annotation, env)) # type: ignore[arg-type] 32 | 33 | if sphinx.version_info >= (7, 3): 34 | sphinx.domains.python._annotations._parse_annotation = parse_annotation # type: ignore[attr-defined] 35 | sphinx.domains.python._object._parse_annotation = parse_annotation # type: ignore[attr-defined] 36 | sphinx.domains.python._parse_annotation = parse_annotation 37 | 38 | 39 | _monkey_patch_python_parse_annotation() 40 | -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/python/attribute_style.py: -------------------------------------------------------------------------------- 1 | from typing import Tuple, Type 2 | 3 | import docutils.nodes 4 | import sphinx 5 | import sphinx.addnodes 6 | import sphinx.domains.python 7 | 8 | if sphinx.version_info >= (7, 3): 9 | from sphinx.domains.python._annotations import ( 10 | _parse_annotation, # type: ignore[import-not-found] 11 | ) 12 | else: 13 | from sphinx.domains.python import _parse_annotation 14 | 15 | 16 | def _monkey_patch_pyattribute_handle_signature( 17 | directive_cls: Type[sphinx.domains.python.PyObject], 18 | ): 19 | """Modifies PyAttribute or PyVariable to improve styling of signature.""" 20 | 21 | def handle_signature( 22 | self, sig: str, signode: sphinx.addnodes.desc_signature 23 | ) -> Tuple[str, str]: 24 | result = super(directive_cls, self).handle_signature(sig, signode) 25 | typ = self.options.get("type") 26 | if typ: 27 | signode += sphinx.addnodes.desc_sig_punctuation("", " : ") 28 | signode += _parse_annotation(typ, self.env) 29 | 30 | value = self.options.get("value") 31 | if value: 32 | signode += sphinx.addnodes.desc_sig_punctuation("", " = ") 33 | signode += docutils.nodes.literal( 34 | text=value, classes=["code", "python"], language="python" 35 | ) 36 | return result 37 | 38 | directive_cls.handle_signature = handle_signature # type: ignore 39 | 40 | 41 | _monkey_patch_pyattribute_handle_signature(sphinx.domains.python.PyAttribute) 42 | _monkey_patch_pyattribute_handle_signature(sphinx.domains.python.PyVariable) 43 | -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/python/default.py: -------------------------------------------------------------------------------- 1 | import sphinx 2 | import sphinx.application 3 | 4 | from . import ( 5 | annotation_style, # noqa: F401 6 | attribute_style, # noqa: F401 7 | autodoc_property_type, # noqa: F401 8 | napoleon_admonition_classes, # noqa: F401 9 | object_ids, # noqa: F401 10 | parameter_objects, 11 | strip_property_prefix, 12 | strip_self_and_return_type_annotations, 13 | style_default_values_as_code, # noqa: F401 14 | subscript_methods, # noqa: F401 15 | synopses, # noqa: F401 16 | type_annotation_transforms, 17 | ) 18 | 19 | 20 | def setup(app: sphinx.application.Sphinx): 21 | app.setup_extension(parameter_objects.__name__) 22 | app.setup_extension(strip_property_prefix.__name__) 23 | app.setup_extension(type_annotation_transforms.__name__) 24 | app.setup_extension(strip_self_and_return_type_annotations.__name__) 25 | 26 | return { 27 | "parallel_read_safe": True, 28 | "parallel_write_safe": True, 29 | } 30 | -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/python/domain_fixes.py: -------------------------------------------------------------------------------- 1 | """Fixes for the Python domain.""" 2 | 3 | import sphinx 4 | import sphinx.addnodes 5 | import sphinx.application 6 | import sphinx.builders 7 | import sphinx.domains 8 | import sphinx.domains.python 9 | import sphinx.environment 10 | import sphinx.errors 11 | import sphinx.ext.napoleon 12 | import sphinx.util.logging 13 | import sphinx.util.nodes 14 | 15 | from . import autodoc_property_type # noqa: F401 16 | 17 | PythonDomain = sphinx.domains.python.PythonDomain 18 | PyTypedField = sphinx.domains.python.PyTypedField 19 | PyObject = sphinx.domains.python.PyObject 20 | 21 | 22 | logger = sphinx.util.logging.getLogger(__name__) 23 | 24 | 25 | def setup(app: sphinx.application.Sphinx): 26 | return { 27 | "parallel_read_safe": True, 28 | "parallel_write_safe": True, 29 | } 30 | -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/python/napoleon_admonition_classes.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from sphinx.ext.napoleon.docstring import GoogleDocstring 4 | 5 | 6 | def _monkey_patch_napoleon_admonition_classes(): 7 | def _add_admonition_class(method_name: str, class_name: str) -> None: 8 | orig_method = getattr(GoogleDocstring, method_name) 9 | 10 | def wrapper(self: GoogleDocstring, section: str) -> List[str]: 11 | result = orig_method(self, section) 12 | result.insert(1, f" :class: {class_name}") 13 | return result 14 | 15 | setattr(GoogleDocstring, method_name, wrapper) 16 | 17 | _add_admonition_class("_parse_examples_section", "example") 18 | 19 | 20 | _monkey_patch_napoleon_admonition_classes() 21 | -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/python/strip_property_prefix.py: -------------------------------------------------------------------------------- 1 | from typing import List, Sequence, Type, Union, cast 2 | 3 | import docutils.nodes 4 | import sphinx.domains.python 5 | 6 | 7 | def _monkey_patch_python_get_signature_prefix( 8 | directive_cls: Type[sphinx.domains.python.PyObject], 9 | ) -> None: 10 | orig_get_signature_prefix = directive_cls.get_signature_prefix 11 | 12 | def get_signature_prefix( 13 | self, sig: str 14 | ) -> Union[str, Sequence[docutils.nodes.Node]]: 15 | prefix = orig_get_signature_prefix(self, sig) 16 | if not self.env.config.python_strip_property_prefix: 17 | return prefix 18 | prefix = cast(List[docutils.nodes.Node], prefix) 19 | assert isinstance(prefix, list) 20 | for prop_idx, node in enumerate(prefix): 21 | if node == "property": 22 | assert isinstance(prefix[prop_idx + 1], sphinx.addnodes.desc_sig_space) 23 | prefix = list(prefix) 24 | del prefix[prop_idx : prop_idx + 2] 25 | break 26 | return prefix 27 | 28 | directive_cls.get_signature_prefix = get_signature_prefix # type: ignore 29 | 30 | 31 | _monkey_patch_python_get_signature_prefix(sphinx.domains.python.PyFunction) 32 | _monkey_patch_python_get_signature_prefix(sphinx.domains.python.PyMethod) 33 | _monkey_patch_python_get_signature_prefix(sphinx.domains.python.PyProperty) 34 | 35 | 36 | def setup(app: sphinx.application.Sphinx): 37 | app.add_config_value( 38 | "python_strip_property_prefix", default=False, rebuild="env", types=(bool,) 39 | ) 40 | return { 41 | "parallel_read_safe": True, 42 | "parallel_write_safe": True, 43 | } 44 | -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/python/style_default_values_as_code.py: -------------------------------------------------------------------------------- 1 | import docutils.nodes 2 | import sphinx 3 | import sphinx.addnodes 4 | import sphinx.domains.python 5 | import sphinx.environment 6 | 7 | 8 | def _monkey_patch_python_parse_arglist(): 9 | """Ensures default values in signatures are styled as code.""" 10 | 11 | if sphinx.version_info >= (7, 3): 12 | orig_parse_arglist = sphinx.domains.python._annotations._parse_arglist # type: ignore[attr-defined] 13 | else: 14 | orig_parse_arglist = sphinx.domains.python._parse_arglist 15 | 16 | def parse_arglist( 17 | arglist: str, *args, **kwargs 18 | ) -> sphinx.addnodes.desc_parameterlist: 19 | result = orig_parse_arglist(arglist, *args, **kwargs) 20 | for node in result.findall(condition=docutils.nodes.inline): 21 | if "default_value" not in node["classes"]: 22 | continue 23 | node.replace_self( 24 | docutils.nodes.literal( 25 | text=node.astext(), 26 | classes=["code", "python", "default_value"], 27 | language="python", 28 | ) 29 | ) 30 | return result 31 | 32 | if sphinx.version_info >= (7, 3): 33 | sphinx.domains.python._annotations._parse_arglist = parse_arglist # type: ignore[attr-defined] 34 | sphinx.domains.python._object._parse_arglist = parse_arglist # type: ignore[attr-defined] 35 | else: 36 | sphinx.domains.python._parse_arglist = parse_arglist 37 | 38 | 39 | _monkey_patch_python_parse_arglist() 40 | -------------------------------------------------------------------------------- /sphinx_immaterial/apidoc/python/subscript_methods.py: -------------------------------------------------------------------------------- 1 | from sphinx.addnodes import desc_parameterlist 2 | 3 | from ... import html_translator_mixin 4 | 5 | 6 | @html_translator_mixin.override 7 | def visit_desc_parameterlist( 8 | self: html_translator_mixin.HTMLTranslatorMixin, 9 | node: desc_parameterlist, 10 | super_func: html_translator_mixin.BaseVisitCallback[desc_parameterlist], 11 | ) -> None: 12 | super_func(self, node) 13 | open_paren, _ = node.get("parens", ("(", ")")) 14 | self.body[-1] = self.body[-1].replace("(", open_paren) 15 | 16 | 17 | @html_translator_mixin.override 18 | def depart_desc_parameterlist( 19 | self: html_translator_mixin.HTMLTranslatorMixin, 20 | node: desc_parameterlist, 21 | super_func: html_translator_mixin.BaseVisitCallback[desc_parameterlist], 22 | ) -> None: 23 | super_func(self, node) 24 | _, close_paren = node.get("parens", ("(", ")")) 25 | self.body[-1] = self.body[-1].replace(")", close_paren) 26 | 27 | 28 | def _monkey_patch_parameterlist_to_support_subscript(): 29 | def astext(self: desc_parameterlist) -> str: 30 | open_paren, close_paren = self.get("parens", ("(", ")")) 31 | return f"{open_paren}{super(desc_parameterlist, self).astext()}{close_paren}" 32 | 33 | desc_parameterlist.astext = astext # type: ignore 34 | 35 | 36 | _monkey_patch_parameterlist_to_support_subscript() 37 | -------------------------------------------------------------------------------- /sphinx_immaterial/custom_admonitions.css: -------------------------------------------------------------------------------- 1 | :root{ 2 | {%- for icon, data in icons.items() -%} 3 | --si-icon--{{icon}}:url('data:image/svg+xml;charset=utf-8,{{data}}'); 4 | {%- endfor -%} 5 | } 6 | {%- for icon in icons.keys() -%} 7 | .md-typeset .si-icon-inline.{{icon}}::before{-webkit-mask-image:var(--si-icon--{{icon}});mask-image:var(--si-icon--{{icon}});} 8 | {%- endfor -%} 9 | {%- for admonition in admonitions -%} 10 | {%- set name = '.' ~ admonition.name -%} 11 | {%- set icon = '' ~ admonition.icon ~ ');' -%} 12 | {%- if admonition.color is not none -%} 13 | .md-typeset .admonition{{name}}{border-color:rgb({{ admonition.color.as_rgb_tuple(alpha=False) | join(',') }});} 14 | .md-typeset {{name}}>.admonition-title{background-color:rgba({{ admonition.color.as_rgb_tuple(alpha=False) | join(',') }},0.1);border-color:rgb({{ admonition.color.as_rgb_tuple(alpha=False) | join(',') }});} 15 | {%- endif -%} 16 | {%- if admonition.color is not none or admonition.icon is not none -%} 17 | .md-typeset {{name}}>.admonition-title::before{ 18 | {%- if admonition.color is not none -%} 19 | background-color:rgb({{ admonition.color.as_rgb_tuple(alpha=False) | join(',') }}); 20 | {%- endif -%} 21 | {%- if admonition.icon is not none -%} 22 | -webkit-mask-image:var(--si-icon--{{admonition.icon}});mask-image:var(--si-icon--{{admonition.icon}}); 23 | {%- endif -%} 24 | } 25 | {%- endif -%} 26 | {%- endfor -%} 27 | {%- for name, icon in status.items() -%} 28 | .md-status--{{name}}::after { 29 | mask-image: var(--si-icon--{{icon}}); 30 | -webkit-mask-image: var(--si-icon--{{icon}}); 31 | } 32 | {%- endfor -%} 33 | -------------------------------------------------------------------------------- /sphinx_immaterial/json_builder_serializing_implementation.py: -------------------------------------------------------------------------------- 1 | """JSON serializer implementation wrapper.""" 2 | 3 | from __future__ import annotations 4 | 5 | import json 6 | from functools import partial 7 | from typing import TYPE_CHECKING 8 | 9 | from sphinx.locale import _TranslationProxy 10 | from sphinxcontrib.serializinghtml.jsonimpl import SphinxJSONEncoder 11 | 12 | from sphinx_immaterial.nav_adapt import MkdocsNavEntry 13 | 14 | if TYPE_CHECKING: 15 | from typing import Any 16 | 17 | 18 | class SphinxImmaterialJSONEncoder(SphinxJSONEncoder): 19 | def default(self, obj: Any) -> Any: 20 | if isinstance(obj, _TranslationProxy): 21 | return str(obj) 22 | if isinstance(obj, MkdocsNavEntry): 23 | return obj.to_json() 24 | return super().default(obj) 25 | 26 | 27 | dump = partial(json.dump, cls=SphinxImmaterialJSONEncoder) 28 | dumps = partial(json.dumps, cls=SphinxImmaterialJSONEncoder) 29 | load = json.load 30 | loads = json.loads 31 | -------------------------------------------------------------------------------- /sphinx_immaterial/sections.py: -------------------------------------------------------------------------------- 1 | """Modifies HTML translation of sections. 2 | 3 | Sphinx normally writes sections with a section heading as: 4 | 5 |
......
6 | 7 | but that is incompatible with the way scroll-margin-top and the 8 | `:target` selector are used in the mkdocs-material CSS. For 9 | compatibility with mkdocs-material, we strip the outer `
` and 10 | instead add the `id` to the inner `` element. 11 | 12 | That is accomplished by overriding `visit_section` and 13 | `depart_section` not to add the `
` and `
` tags, and also 14 | modifying `visit_title` to insert the `id`. 15 | """ 16 | 17 | import docutils.nodes 18 | 19 | from . import html_translator_mixin 20 | 21 | 22 | @html_translator_mixin.override 23 | def visit_section( 24 | self: html_translator_mixin.HTMLTranslatorMixin, 25 | node: docutils.nodes.section, 26 | super_func: html_translator_mixin.BaseVisitCallback[docutils.nodes.section], 27 | ) -> None: 28 | self.section_level += 1 29 | 30 | 31 | @html_translator_mixin.override 32 | def depart_section( 33 | self: html_translator_mixin.HTMLTranslatorMixin, 34 | node: docutils.nodes.section, 35 | super_func: html_translator_mixin.BaseVisitCallback[docutils.nodes.section], 36 | ) -> None: 37 | self.section_level -= 1 38 | 39 | 40 | @html_translator_mixin.override 41 | def visit_title( 42 | self: html_translator_mixin.HTMLTranslatorMixin, 43 | node: docutils.nodes.title, 44 | super_func: html_translator_mixin.BaseVisitCallback[docutils.nodes.title], 45 | ) -> None: 46 | if isinstance(node.parent, docutils.nodes.section): 47 | if node.parent.get("ids") and not node.get("ids"): 48 | node["ids"] = node.parent.get("ids") 49 | super_func(self, node) 50 | del node["ids"] 51 | return 52 | super_func(self, node) 53 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/browser/document/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | import { 24 | ReplaySubject, 25 | Subject, 26 | fromEvent 27 | } from "rxjs" 28 | 29 | /* ---------------------------------------------------------------------------- 30 | * Functions 31 | * ------------------------------------------------------------------------- */ 32 | 33 | /** 34 | * Watch document 35 | * 36 | * Documents are implemented as subjects, so all downstream observables are 37 | * automatically updated when a new document is emitted. 38 | * 39 | * @returns Document subject 40 | */ 41 | export function watchDocument(): Subject { 42 | const document$ = new ReplaySubject(1) 43 | fromEvent(document, "DOMContentLoaded", { once: true }) 44 | .subscribe(() => document$.next(document)) 45 | 46 | /* Return document */ 47 | return document$ 48 | } 49 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/browser/element/_/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "jsdoc/require-jsdoc": "off", 4 | "jsdoc/require-returns-check": "off" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/browser/element/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | export * from "./focus" 25 | export * from "./hover" 26 | export * from "./offset" 27 | export * from "./size" 28 | export * from "./visibility" 29 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/browser/element/offset/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | export * from "./content" 25 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/browser/element/size/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | export * from "./content" 25 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/browser/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./document" 24 | export * from "./element" 25 | export * from "./keyboard" 26 | export * from "./location" 27 | export * from "./media" 28 | export * from "./request" 29 | export * from "./script" 30 | export * from "./toggle" 31 | export * from "./viewport" 32 | // sphinx-immaterial: upstream search worker not used 33 | // export * from "./worker" 34 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/browser/location/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | export * from "./hash" 25 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/browser/viewport/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | export * from "./at" 25 | export * from "./offset" 26 | export * from "./size" 27 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/components/content/annotation/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | export * from "./block" 25 | export * from "./list" 26 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/components/content/code/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/components/content/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | export * from "./annotation" 25 | export * from "./code" 26 | export * from "./details" 27 | export * from "./mermaid" 28 | export * from "./table" 29 | export * from "./tabs" 30 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/components/header/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | export * from "./title" 25 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/components/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | export * from "./announce" 25 | export * from "./consent" 26 | export * from "./content" 27 | export * from "./dialog" 28 | export * from "./header" 29 | export * from "./main" 30 | export * from "./palette" 31 | export * from "./progress" 32 | export * from "./search" 33 | export * from "./sidebar" 34 | export * from "./source" 35 | export * from "./tabs" 36 | export * from "./toc" 37 | export * from "./tooltip" 38 | export * from "./top" 39 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/components/search/highlight/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-null/no-null": "off" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/components/search/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | export * from "./highlight" 25 | export * from "./query" 26 | export * from "./result" 27 | export * from "./share" 28 | export * from "./suggest" 29 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/components/source/facts/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | export * from "./github" 25 | export * from "./gitlab" 26 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/components/source/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | export * from "./facts" 25 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/integrations/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./clipboard" 24 | export * from "./instant" 25 | export * from "./search" 26 | export * from "./sitemap" 27 | export * from "./version" 28 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/integrations/instant/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-self-assign": "off", 4 | "no-null/no-null": "off" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/integrations/search/_/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | import { 24 | SearchDocument 25 | } from "../config" 26 | import { 27 | SearchQueryTerms 28 | } from "../query" 29 | 30 | /* ---------------------------------------------------------------------------- 31 | * Types 32 | * ------------------------------------------------------------------------- */ 33 | 34 | /** 35 | * Search item 36 | */ 37 | export interface SearchItem 38 | extends SearchDocument 39 | { 40 | score: number /* Score (relevance) */ 41 | terms: SearchQueryTerms /* Search query terms */ 42 | } 43 | 44 | /** 45 | * Search result 46 | */ 47 | export interface SearchResult { 48 | items: SearchItem[][] /* Search items */ 49 | suggest?: string[] /* Search suggestions */ 50 | } 51 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/integrations/search/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | export * from "./config" 25 | export * from "./highlighter" 26 | export * from "./query" 27 | // sphinx-immaterial: upstream search worker not used 28 | // export * from "./worker" 29 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/integrations/search/query/_/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | /* ---------------------------------------------------------------------------- 24 | * Types 25 | * ------------------------------------------------------------------------- */ 26 | 27 | /** 28 | * Search query terms 29 | */ 30 | export type SearchQueryTerms = Record 31 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/integrations/search/query/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./_" 24 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/integrations/sitemap/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-null/no-null": "off" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/integrations/version/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-null/no-null": "off" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/patches/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./ellipsis" 24 | export * from "./indeterminate" 25 | export * from "./scrollfix" 26 | export * from "./scrolllock" 27 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/templates/clipboard/index.tsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | import { translation } from "~/_" 24 | import { h } from "~/utilities" 25 | 26 | /* ---------------------------------------------------------------------------- 27 | * Functions 28 | * ------------------------------------------------------------------------- */ 29 | 30 | /** 31 | * Render a 'copy-to-clipboard' button 32 | * 33 | * @param id - Unique identifier 34 | * 35 | * @returns Element 36 | */ 37 | export function renderClipboardButton(id: string): HTMLElement { 38 | return ( 39 | 44 | ) 45 | } 46 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/templates/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./annotation" 24 | export * from "./clipboard" 25 | export * from "./search" 26 | export * from "./source" 27 | export * from "./tabbed" 28 | export * from "./table" 29 | export * from "./tooltip" 30 | export * from "./version" 31 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/templates/source/index.tsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | import { SourceFacts } from "~/components" 24 | import { h, round } from "~/utilities" 25 | 26 | /* ---------------------------------------------------------------------------- 27 | * Functions 28 | * ------------------------------------------------------------------------- */ 29 | 30 | /** 31 | * Render repository facts 32 | * 33 | * @param facts - Repository facts 34 | * 35 | * @returns Element 36 | */ 37 | export function renderSourceFacts(facts: SourceFacts): HTMLElement { 38 | return ( 39 |
    40 | {Object.entries(facts).map(([key, value]) => ( 41 |
  • 42 | {typeof value === "number" ? round(value) : value} 43 |
  • 44 | ))} 45 |
46 | ) 47 | } 48 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/templates/table/index.tsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | import { h } from "~/utilities" 24 | 25 | /* ---------------------------------------------------------------------------- 26 | * Functions 27 | * ------------------------------------------------------------------------- */ 28 | 29 | /** 30 | * Render a table inside a wrapper to improve scrolling on mobile 31 | * 32 | * @param table - Table element 33 | * 34 | * @returns Element 35 | */ 36 | export function renderTable(table: HTMLElement): HTMLElement { 37 | return ( 38 |
39 |
40 | {table} 41 |
42 |
43 | ) 44 | } 45 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/utilities/h/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "@typescript-eslint/no-explicit-any": "off", 4 | "@typescript-eslint/no-namespace": "off", 5 | "jsdoc/require-jsdoc": "off" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/templates/assets/javascripts/utilities/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | export * from "./h" 24 | export * from "./round" 25 | -------------------------------------------------------------------------------- /src/templates/assets/stylesheets/_config.scss: -------------------------------------------------------------------------------- 1 | //// 2 | /// Copyright (c) 2016-2025 Martin Donath 3 | /// 4 | /// Permission is hereby granted, free of charge, to any person obtaining a 5 | /// copy of this software and associated documentation files (the "Software"), 6 | /// to deal in the Software without restriction, including without limitation 7 | /// the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | /// and/or sell copies of the Software, and to permit persons to whom the 9 | /// Software is furnished to do so, subject to the following conditions: 10 | /// 11 | /// The above copyright notice and this permission notice shall be included in 12 | /// all copies or substantial portions of the Software. 13 | /// 14 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | /// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 17 | /// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | /// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | /// DEALINGS 21 | //// 22 | 23 | // ---------------------------------------------------------------------------- 24 | // Variables: breakpoints 25 | // ---------------------------------------------------------------------------- 26 | 27 | // Device-specific breakpoints 28 | $break-devices: ( 29 | mobile: ( 30 | portrait: px2em(220px) px2em(479.75px), 31 | landscape: px2em(480px) px2em(719.75px) 32 | ), 33 | tablet: ( 34 | portrait: px2em(720px) px2em(959.75px), 35 | landscape: px2em(960px) px2em(1219.75px) 36 | ), 37 | screen: ( 38 | small: px2em(1220px) px2em(1599.75px), 39 | medium: px2em(1600px) px2em(1999.75px), 40 | large: px2em(2000px) 41 | ) 42 | ); 43 | -------------------------------------------------------------------------------- /src/templates/assets/stylesheets/main/_icons.scss: -------------------------------------------------------------------------------- 1 | //// 2 | /// Copyright (c) 2016-2025 Martin Donath 3 | /// 4 | /// Permission is hereby granted, free of charge, to any person obtaining a 5 | /// copy of this software and associated documentation files (the "Software"), 6 | /// to deal in the Software without restriction, including without limitation 7 | /// the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | /// and/or sell copies of the Software, and to permit persons to whom the 9 | /// Software is furnished to do so, subject to the following conditions: 10 | /// 11 | /// The above copyright notice and this permission notice shall be included in 12 | /// all copies or substantial portions of the Software. 13 | /// 14 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | /// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 17 | /// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | /// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | /// DEALINGS 21 | //// 22 | 23 | // ---------------------------------------------------------------------------- 24 | // Rules 25 | // ---------------------------------------------------------------------------- 26 | 27 | // Icon 28 | .md-icon { 29 | 30 | // SVG defaults 31 | svg { 32 | display: block; 33 | width: px2rem(24px); 34 | height: px2rem(24px); 35 | fill: currentcolor; 36 | } 37 | } 38 | 39 | // sphinx-immaterial: change display for inline icons 40 | .si-icon-inline::before { 41 | display: inline-flex; 42 | width: px2em(18px); 43 | height: px2em(18px); 44 | vertical-align: text-top; 45 | content: ""; 46 | background-color: var(--md-default-fg-color); 47 | mask-repeat: no-repeat; 48 | mask-position: center; 49 | } 50 | -------------------------------------------------------------------------------- /src/templates/assets/stylesheets/main/components/_code.scss: -------------------------------------------------------------------------------- 1 | //// 2 | /// Copyright (c) 2016-2025 Martin Donath 3 | /// 4 | /// Permission is hereby granted, free of charge, to any person obtaining a 5 | /// copy of this software and associated documentation files (the "Software"), 6 | /// to deal in the Software without restriction, including without limitation 7 | /// the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | /// and/or sell copies of the Software, and to permit persons to whom the 9 | /// Software is furnished to do so, subject to the following conditions: 10 | /// 11 | /// The above copyright notice and this permission notice shall be included in 12 | /// all copies or substantial portions of the Software. 13 | /// 14 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | /// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 17 | /// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | /// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | /// DEALINGS 21 | //// 22 | 23 | // ---------------------------------------------------------------------------- 24 | // Rules 25 | // ---------------------------------------------------------------------------- 26 | 27 | // Code blocks 28 | .md-code { 29 | 30 | // Code block content - when line spans are enabled, we can opt into using 31 | // grid-based rendering, which makes highlighted lines stretch. 32 | .md-typeset &__content { 33 | display: grid; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/templates/assets/stylesheets/main/extensions/readthedocs/_readthedocs.scss: -------------------------------------------------------------------------------- 1 | // css overrides for the readthedocs-sphinx-ext that 2 | // is automatically appended to projects built/hosted on RTD 3 | 4 | .rst-versions { 5 | font-family: var(--md-text-font-family); 6 | 7 | &.rst-badge { 8 | top: 50px; 9 | // stylelint-disable-next-line declaration-no-important 10 | bottom: inherit !important; 11 | height: auto; 12 | font-size: 0.85rem; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/templates/assets/stylesheets/main/integrations/_giscus.scss: -------------------------------------------------------------------------------- 1 | //// 2 | /// Copyright (c) 2016-2025 Martin Donath 3 | /// 4 | /// Permission is hereby granted, free of charge, to any person obtaining a 5 | /// copy of this software and associated documentation files (the "Software"), 6 | /// to deal in the Software without restriction, including without limitation 7 | /// the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | /// and/or sell copies of the Software, and to permit persons to whom the 9 | /// Software is furnished to do so, subject to the following conditions: 10 | /// 11 | /// The above copyright notice and this permission notice shall be included in 12 | /// all copies or substantial portions of the Software. 13 | /// 14 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | /// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 17 | /// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | /// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | /// DEALINGS 21 | //// 22 | 23 | // ---------------------------------------------------------------------------- 24 | // Rules 25 | // ---------------------------------------------------------------------------- 26 | 27 | // [print]: Hide comment section 28 | @media print { 29 | 30 | // Comments headline 31 | [id="__comments"] { 32 | display: none; 33 | } 34 | 35 | // Comments integration 36 | .giscus { 37 | display: none; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/templates/assets/stylesheets/main/integrations/_graphviz.scss: -------------------------------------------------------------------------------- 1 | // All definitions 2 | :root > * { 3 | // Colors 4 | --md-graphviz-edge-color: var(--md-default-fg-color); 5 | --md-graphviz-node-bg-color: var(--md-accent-fg-color--transparent); 6 | --md-graphviz-node-fg-color: var(--md-accent-fg-color); 7 | --md-graphviz-label-bg-color: var(--md-default-bg-color); 8 | --md-graphviz-label-fg-color: var(--md-code-fg-color); 9 | --md-graphviz-a-hover-color: var(--md-primary-fg-color); 10 | } 11 | 12 | // Mermaid container 13 | .graphviz { 14 | margin: 1em 0; 15 | } 16 | 17 | .graphviz a:hover > text { 18 | fill: var(--md-graphviz-hover-color) !important; // stylelint-disable-line declaration-no-important 19 | } 20 | -------------------------------------------------------------------------------- /src/templates/assets/stylesheets/main/modifiers/_inline.scss: -------------------------------------------------------------------------------- 1 | //// 2 | /// Copyright (c) 2016-2025 Martin Donath 3 | /// 4 | /// Permission is hereby granted, free of charge, to any person obtaining a 5 | /// copy of this software and associated documentation files (the "Software"), 6 | /// to deal in the Software without restriction, including without limitation 7 | /// the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | /// and/or sell copies of the Software, and to permit persons to whom the 9 | /// Software is furnished to do so, subject to the following conditions: 10 | /// 11 | /// The above copyright notice and this permission notice shall be included in 12 | /// all copies or substantial portions of the Software. 13 | /// 14 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | /// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 17 | /// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | /// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | /// DEALINGS 21 | //// 22 | 23 | // ---------------------------------------------------------------------------- 24 | // Rules 25 | // ---------------------------------------------------------------------------- 26 | 27 | // Scoped in typesetted content to match specificity of regular content 28 | .md-typeset { 29 | 30 | // [tablet +]: Allow for rendering content as sidebars 31 | @include break-from-device(tablet) { 32 | 33 | // Modifier to float block elements 34 | .inline { 35 | float: inline-start; 36 | width: px2rem(234px); 37 | margin-inline-end: px2rem(16px); 38 | margin-top: 0; 39 | margin-bottom: px2rem(16px); 40 | 41 | // Modifier to move to end (ltr: right, rtl: left) 42 | &.end { 43 | float: inline-end; 44 | margin-inline: px2rem(16px) 0; 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/templates/assets/stylesheets/palette.scss: -------------------------------------------------------------------------------- 1 | //// 2 | /// Copyright (c) 2016-2025 Martin Donath 3 | /// 4 | /// Permission is hereby granted, free of charge, to any person obtaining a 5 | /// copy of this software and associated documentation files (the "Software"), 6 | /// to deal in the Software without restriction, including without limitation 7 | /// the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | /// and/or sell copies of the Software, and to permit persons to whom the 9 | /// Software is furnished to do so, subject to the following conditions: 10 | /// 11 | /// The above copyright notice and this permission notice shall be included in 12 | /// all copies or substantial portions of the Software. 13 | /// 14 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | /// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 17 | /// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | /// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | /// DEALINGS 21 | //// 22 | 23 | // ---------------------------------------------------------------------------- 24 | // Dependencies 25 | // ---------------------------------------------------------------------------- 26 | 27 | @import "material-color"; 28 | 29 | // ---------------------------------------------------------------------------- 30 | // Local imports 31 | // ---------------------------------------------------------------------------- 32 | 33 | @import "utilities/break"; 34 | @import "utilities/convert"; 35 | 36 | @import "config"; 37 | 38 | @import "palette/scheme"; 39 | @import "palette/accent"; 40 | @import "palette/primary"; 41 | -------------------------------------------------------------------------------- /src/templates/blog.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | {% extends "main.html" %} 24 | 25 | 26 | {% block container %} 27 |
28 |
29 | 30 | 31 |
32 | {{ page.content }} 33 |
34 | 35 | 36 | {% for post in posts %} 37 | {% include "partials/post.html" %} 38 | {% endfor %} 39 | 40 | 41 | {% if pagination %} 42 | {% block pagination %} 43 | {% include "partials/pagination.html" %} 44 | {% endblock %} 45 | {% endif %} 46 |
47 |
48 | {% endblock %} 49 | -------------------------------------------------------------------------------- /src/templates/layout.html: -------------------------------------------------------------------------------- 1 | {# Main layout template is in `base.html` to match mkdocs-material #} 2 | {% extends "base.html" %} 3 | -------------------------------------------------------------------------------- /src/templates/main.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | {% extends "base.html" %} 24 | -------------------------------------------------------------------------------- /src/templates/partials/alternate.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 |
25 |
26 | {% set icon = config.theme.icon.alternate or "material/translate" %} 27 | 33 |
34 | 47 |
48 |
49 |
50 | -------------------------------------------------------------------------------- /src/templates/partials/comments.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/templates/partials/content.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | {% include "partials/tags.html" %} 25 | 26 | 27 | {% include "partials/actions.html" %} 28 | 29 | 30 | {{ page.content }} 31 | 32 | 33 | {% include "partials/source-file.html" %} 34 | 35 | 36 | {% include "partials/feedback.html" %} 37 | 38 | 39 | {% include "partials/comments.html" %} 40 | -------------------------------------------------------------------------------- /src/templates/partials/copyright.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | 47 | -------------------------------------------------------------------------------- /src/templates/partials/hero.html: -------------------------------------------------------------------------------- 1 | {% if meta and 'hero' in meta %} 2 | {% set hero = meta['hero'] | e %} 3 | 8 | {% endif %} 9 | -------------------------------------------------------------------------------- /src/templates/partials/integrations/analytics.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | {% if config.extra.analytics %} 25 | {% set provider = config.extra.analytics.provider %} 26 | {% endif %} 27 | 28 | 29 | {% if provider %} 30 | {% include "partials/integrations/analytics/" ~ provider ~ ".html" %} 31 | 32 | 33 | {% if config.extra.consent %} 34 | 41 | 42 | 43 | {% else %} 44 | 48 | {% endif %} 49 | {% endif %} 50 | -------------------------------------------------------------------------------- /src/templates/partials/javascripts/announce.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | 32 | -------------------------------------------------------------------------------- /src/templates/partials/javascripts/content.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | {% if "content.tabs.link" in features %} 25 | 39 | {% endif %} 40 | -------------------------------------------------------------------------------- /src/templates/partials/javascripts/outdated.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | 31 | -------------------------------------------------------------------------------- /src/templates/partials/language.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | {% import "partials/languages/" ~ language ~ ".html" as lang %} 25 | {% import "partials/languages/en.html" as fallback %} 26 | 27 | 28 | {% macro t(key) %}{{ lang.t(key) or fallback.t(key) or key }}{% endmacro %} 29 | -------------------------------------------------------------------------------- /src/templates/partials/logo.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | {%- if logo_url -%} 25 | logo 26 | {%- elif theme_logo_svg -%} 27 | {%- include theme_logo_svg -%} 28 | {%- else %} 29 | {% set icon = config.theme.icon.logo or "material/library" %} 30 | {% include ".icons/" ~ icon ~ ".svg" %} 31 | {%- endif -%} 32 | -------------------------------------------------------------------------------- /src/templates/partials/pagination.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | {% import ".icons/material/chevron-double-left.svg" as icon_first %} 25 | {% import ".icons/material/chevron-left.svg" as icon_previous %} 26 | {% import ".icons/material/chevron-right.svg" as icon_next %} 27 | {% import ".icons/material/chevron-double-right.svg" as icon_last %} 28 | 29 | 30 | 43 | -------------------------------------------------------------------------------- /src/templates/partials/progress.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 |
25 | -------------------------------------------------------------------------------- /src/templates/partials/social.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 |
25 | {% for social in config.extra.social %} 26 | 27 | 28 | {% set rel = "noopener" %} 29 | {% if "mastodon" in social.icon %} 30 | {% set rel = rel ~ " me" %} 31 | {% endif %} 32 | 33 | 34 | {% set title = social.name %} 35 | {% if not title and "//" in social.link %} 36 | {% set _, url = social.link.split("//") %} 37 | {% set title = url.split("/")[0] %} 38 | {% endif %} 39 | 45 | {% include ".icons/" ~ social.icon ~ ".svg" %} 46 | 47 | {% endfor %} 48 |
49 | -------------------------------------------------------------------------------- /src/templates/partials/source.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | 30 |
31 | {% set icon = config.theme.icon.repo or "fontawesome/brands/git-alt" %} 32 | {% include ".icons/" ~ icon ~ ".svg" %} 33 |
34 |
35 | {{ config.repo_name }} 36 |
37 |
38 | -------------------------------------------------------------------------------- /src/templates/partials/tabs.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | {% import "partials/tabs-item.html" as item with context %} 24 | 25 | 26 | 39 | -------------------------------------------------------------------------------- /src/templates/partials/toc-item.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 |
  • 25 | 26 | 27 | {% if toc_item.icon_html %} 28 | {{ toc_item.icon_html }} 29 | {% endif %} 30 | 31 | 32 | {{ toc_item.title }} 33 | 34 | 35 | 36 | 37 | {% if toc_item.children %} 38 | 45 | {% endif %} 46 |
  • 47 | -------------------------------------------------------------------------------- /src/templates/partials/toc.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | {% set title = lang.t("toc") %} 25 | {% if config.mdx_configs.toc and config.mdx_configs.toc.title %} 26 | {% set title = config.mdx_configs.toc.title %} 27 | {% endif %} 28 | 29 | 30 | 51 | -------------------------------------------------------------------------------- /src/templates/partials/top.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | 29 | -------------------------------------------------------------------------------- /src/templates/redirect.html: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | {{ config.site_name }} 29 | 32 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /tests/README.rst: -------------------------------------------------------------------------------- 1 | Unit tests 2 | ========== 3 | 4 | The unit tests require `graphviz `_ to be installed. 5 | 6 | .. code-block:: shell 7 | 8 | uv run --group test pytest -vv -s 9 | 10 | Using ``nox`` 11 | ------------- 12 | 13 | This repo is setup to use `nox `_ in a Continuous Integration 14 | workflow. The above instructions (except installing `graphviz `_) 15 | can be executed with 1 ``nox`` command. 16 | 17 | .. code-block:: shell 18 | 19 | uvx nox -s tests 20 | 21 | Code Coverage 22 | ------------- 23 | 24 | Code coverage is included when using `nox `_ as well. 25 | The coverage report should be generated *after* running the tests with ``nox``. 26 | 27 | .. code-block:: shell 28 | 29 | uvx nox -s coverage 30 | 31 | This will generate a ``.coverage_.md`` file of the coverage summary and a more in-depth analysis 32 | in HTML form located in the ``htmlcov`` folder at the repo's root. 33 | -------------------------------------------------------------------------------- /tests/code_annotations_test.py: -------------------------------------------------------------------------------- 1 | """Tests related to theme's code block annotations.""" 2 | 3 | from sphinx.testing.util import SphinxTestApp 4 | 5 | index_rst = """ 6 | The Test 7 | ======== 8 | 9 | .. code-block:: yaml 10 | :caption: A caption for good measure 11 | 12 | # (1)! 13 | 14 | .. code-annotations:: 15 | 1. An annotation 16 | 17 | .. code-annotations:: 18 | #. A regular list not used in annotations. 19 | 20 | .. code-block:: python 21 | 22 | # A normal code block without annotations 23 | """ 24 | 25 | 26 | def test_code_annotation(immaterial_make_app): 27 | app: SphinxTestApp = immaterial_make_app( 28 | files={"index.rst": index_rst}, 29 | ) 30 | 31 | app.build() 32 | assert not app._warning.getvalue() # type: ignore[attr-defined] 33 | 34 | 35 | def test_code_annotation_error(immaterial_make_app): 36 | app: SphinxTestApp = immaterial_make_app( 37 | files={ 38 | "index.rst": """ 39 | The Test 40 | ======== 41 | 42 | .. code-annotations:: 43 | This is not an enumerated list! 44 | 45 | """ 46 | }, 47 | ) 48 | 49 | app.build() 50 | warnings = app._warning.getvalue() # type: ignore[attr-defined] 51 | assert warnings 52 | assert "The code-annotations directive only accepts an enumerated list" in warnings 53 | -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | import pathlib 2 | from typing import Dict 3 | 4 | import pytest 5 | import sphinx 6 | 7 | if sphinx.version_info < (7, 2): 8 | from sphinx.testing.path import path as SphinxPath 9 | else: 10 | from pathlib import Path as SphinxPath # type: ignore[assignment] 11 | 12 | 13 | pytest_plugins = ("sphinx.testing.fixtures",) 14 | 15 | 16 | @pytest.fixture 17 | def immaterial_make_app(tmp_path: pathlib.Path, make_app): 18 | conf = """ 19 | extensions = [ 20 | "sphinx_immaterial", 21 | ] 22 | html_theme = "sphinx_immaterial" 23 | """ 24 | 25 | def make(files: Dict[str, str], extra_conf: str = "", **kwargs): 26 | (tmp_path / "conf.py").write_text(conf + extra_conf, encoding="utf-8") 27 | for filename, content in files.items(): 28 | (tmp_path / filename).write_text(content, encoding="utf-8") 29 | app = make_app(srcdir=SphinxPath(str(tmp_path)), **kwargs) 30 | app.pdb = True 31 | return app 32 | 33 | yield make 34 | 35 | 36 | def pytest_report_header(config): 37 | return f"sphinx: {sphinx.__version__}" 38 | -------------------------------------------------------------------------------- /tests/content_tabs_test.py: -------------------------------------------------------------------------------- 1 | """Tests related to theme's content tabs.""" 2 | 3 | import pytest 4 | from docutils.nodes import Node 5 | from sphinx.testing.util import SphinxTestApp 6 | 7 | from sphinx_immaterial.content_tabs import is_md_tab_type 8 | 9 | index_rst = """ 10 | The Test 11 | ======== 12 | 13 | .. md-tab-set:: 14 | :name: tab_set_ref 15 | 16 | .. md-tab-item:: A 17 | 18 | Tab A content 19 | 20 | .. md-tab-item:: B 21 | 22 | Tab B content 23 | """ 24 | 25 | 26 | def test_content_tabs(immaterial_make_app): 27 | app: SphinxTestApp = immaterial_make_app( 28 | files={"index.rst": index_rst}, 29 | ) 30 | 31 | app.build() 32 | assert not app._warning.getvalue() # type: ignore[attr-defined] 33 | 34 | 35 | def test_tab_ext_error(): 36 | assert not is_md_tab_type(Node(), "") 37 | 38 | 39 | def test_tab_set_child_error(immaterial_make_app): 40 | app: SphinxTestApp = immaterial_make_app( 41 | files={ 42 | "index.rst": """ 43 | The Test 44 | ======== 45 | 46 | .. md-tab-set:: 47 | 48 | This is not a ``md-tab-item``! 49 | """ 50 | }, 51 | ) 52 | 53 | with pytest.raises(ValueError): 54 | app.build() 55 | warnings = app._warning.getvalue() # type: ignore[attr-defined] 56 | assert warnings 57 | assert "All children of a 'md-tab-set' should be 'md-tab-item'" in warnings 58 | 59 | 60 | def test_tab_item_parent_error(immaterial_make_app): 61 | app: SphinxTestApp = immaterial_make_app( 62 | files={ 63 | "index.rst": """ 64 | The Test 65 | ======== 66 | 67 | .. md-tab-item:: Orphan 68 | 69 | This is ``md-tab-item`` has no parent ``md-tab-set``! 70 | """ 71 | }, 72 | ) 73 | app.build() 74 | warnings = app._warning.getvalue() # type: ignore[attr-defined] 75 | assert warnings 76 | assert "The parent of a 'md-tab-item' should be a 'md-tab-set'" in warnings 77 | -------------------------------------------------------------------------------- /tests/cpp_apigen_test.py: -------------------------------------------------------------------------------- 1 | """Tests cpp/apigen.""" 2 | 3 | 4 | def test_unnamed_template_parameter(immaterial_make_app): 5 | app = immaterial_make_app( 6 | extra_conf=""" 7 | extensions.append("sphinx_immaterial.apidoc.cpp.apigen") 8 | """, 9 | confoverrides=dict( 10 | nitpicky=True, 11 | cpp_apigen_configs=[ 12 | dict( 13 | document_prefix="cpp_apigen_generated/", 14 | api_parser_config=dict( 15 | input_content=r""" 16 | /// Tests if something is an array. 17 | /// 18 | /// \ingroup Array 19 | template 20 | constexpr inline bool IsArray = false; 21 | """, 22 | compiler_flags=["-std=c++17", "-x", "c++"], 23 | verbose=True, 24 | ), 25 | ), 26 | ], 27 | ), 28 | files={ 29 | "index.rst": """ 30 | .. cpp-apigen-group:: Array 31 | 32 | """ 33 | }, 34 | ) 35 | 36 | app.build() 37 | 38 | assert not app._warning.getvalue() 39 | 40 | 41 | def test_macro(immaterial_make_app): 42 | app = immaterial_make_app( 43 | extra_conf=""" 44 | extensions.append("sphinx_immaterial.apidoc.cpp.apigen") 45 | """, 46 | confoverrides=dict( 47 | nitpicky=True, 48 | cpp_apigen_configs=[ 49 | dict( 50 | document_prefix="cpp_apigen_generated/", 51 | api_parser_config=dict( 52 | input_content=r""" 53 | /// Tests something. 54 | /// 55 | /// \ingroup Array 56 | #define IS_ARRAY(x) x + 1 57 | """, 58 | compiler_flags=["-std=c++17", "-x", "c++"], 59 | verbose=True, 60 | ), 61 | ), 62 | ], 63 | ), 64 | files={ 65 | "index.rst": """ 66 | .. cpp-apigen-group:: Array 67 | 68 | """ 69 | }, 70 | ) 71 | 72 | app.build() 73 | 74 | assert not app._warning.getvalue() 75 | -------------------------------------------------------------------------------- /tests/cpp_xref_c_domain_test.py: -------------------------------------------------------------------------------- 1 | """Tests that references to C objects can be resolved via cpp domain xrefs.""" 2 | 3 | 4 | def test_cpp_xref_resolves_to_c_obj(immaterial_make_app): 5 | app = immaterial_make_app( 6 | files={ 7 | "index.rst": """ 8 | .. c:macro:: FOO 9 | 10 | Some macro. 11 | 12 | :cpp:expr:`FOO` 13 | 14 | :any:`FOO` 15 | """ 16 | }, 17 | ) 18 | 19 | app.build() 20 | 21 | assert not app._warning.getvalue() 22 | -------------------------------------------------------------------------------- /tests/extra_scope_test.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import re 4 | import textwrap 5 | from pathlib import Path 6 | from typing import TYPE_CHECKING 7 | 8 | import pytest 9 | from bs4 import BeautifulSoup 10 | 11 | if TYPE_CHECKING: 12 | from sphinx.testing.util import SphinxTestApp 13 | 14 | 15 | @pytest.mark.parametrize( 16 | "scope_url,expected_scope_url", 17 | [ 18 | (None, "."), 19 | ("", ""), 20 | ("/", "/"), 21 | ("/subsite", "/subsite"), 22 | ], 23 | ids=[ 24 | "base_url", 25 | "empty", 26 | "root", 27 | "subsite", 28 | ], 29 | ) 30 | def test_extra_scope( 31 | immaterial_make_app, 32 | scope_url: str | None, 33 | expected_scope_url: str, 34 | ): 35 | if scope_url is not None: 36 | scope_url = f'"{scope_url}"' 37 | 38 | app: SphinxTestApp = immaterial_make_app( 39 | extra_conf=textwrap.dedent( 40 | f""" 41 | html_theme_options = {{ 42 | "scope": {scope_url} 43 | }} 44 | """ 45 | ), 46 | files={ 47 | "index.rst": "Sample text", 48 | }, 49 | ) 50 | app.build() 51 | 52 | assert not app._warning.getvalue() # type: ignore[attr-defined] 53 | 54 | with open(Path(app.outdir) / "index.html", mode="r") as file: 55 | soup = BeautifulSoup(file.read(), "html.parser") 56 | 57 | head = soup.head 58 | assert head is not None 59 | 60 | scope_pattern = re.compile(r"__md_scope=new URL\(\"(?P[^\"]+)\"") 61 | matched_scope_url = "" 62 | for script in head.find_all("script"): 63 | scope_match = scope_pattern.search(script.text) 64 | if scope_match: 65 | matched_scope_url = scope_match.group("url") 66 | break 67 | 68 | assert matched_scope_url == expected_scope_url 69 | -------------------------------------------------------------------------------- /tests/genindex_test.py: -------------------------------------------------------------------------------- 1 | """Tests that genindex page is created correctly.""" 2 | 3 | from pathlib import Path 4 | 5 | from sphinx.testing.util import SphinxTestApp 6 | 7 | index_rst = """ 8 | The Test 9 | ======== 10 | 11 | .. py:module:: mymodule 12 | 13 | This is a module. 14 | 15 | """ 16 | 17 | 18 | def test_genindex(tmp_path: Path, immaterial_make_app): 19 | app: SphinxTestApp = immaterial_make_app( 20 | confoverrides=dict(html_title="Project"), 21 | files={"index.rst": index_rst}, 22 | ) 23 | app.build() 24 | assert not app._warning.getvalue() # type: ignore[attr-defined] 25 | genindex_path = tmp_path / "_build" / "html" / "genindex.html" 26 | assert genindex_path.exists() 27 | genindex_html = genindex_path.read_text(encoding="utf-8") 28 | 29 | assert "Index - Project" in genindex_html 30 | 31 | assert "module-mymodule" in genindex_html 32 | -------------------------------------------------------------------------------- /tests/graphviz_test.py: -------------------------------------------------------------------------------- 1 | """Tests related to theme's patched graphviz ext.""" 2 | 3 | import pytest 4 | from sphinx.testing.util import SphinxTestApp 5 | 6 | WITH_BRACKETS = """ 7 | .. graphviz:: 8 | 9 | graph { 10 | "foo()" [xref=":py:func:`foo()`"] 11 | } 12 | 13 | """ 14 | 15 | WITHOUT_BRACKETS = """ 16 | .. graphviz:: 17 | 18 | graph { 19 | subgraph cluster_foo { 20 | xref=":py:func:`foo()`" 21 | A_node 22 | } 23 | } 24 | 25 | """ 26 | 27 | 28 | @pytest.mark.parametrize( 29 | "graph", [WITH_BRACKETS, WITHOUT_BRACKETS], ids=["with", "without"] 30 | ) 31 | def test_square_brackets(immaterial_make_app, graph: str): 32 | """generate a graph with attributes not enclosed in square brackets""" 33 | app: SphinxTestApp = immaterial_make_app( 34 | extra_conf="\n".join( 35 | [ 36 | 'extensions.append("sphinx_immaterial.graphviz")', 37 | # tests also run on Windows in CI 38 | "graphviz_ignore_incorrect_font_metrics = True", 39 | ] 40 | ), 41 | files={ 42 | "index.rst": """ 43 | The Test 44 | ======== 45 | 46 | A function 47 | ---------- 48 | 49 | .. py:function:: foo() 50 | 51 | A graph 52 | ------- 53 | 54 | {}""".format(graph) 55 | }, 56 | ) 57 | 58 | app.build() 59 | assert not app._warning.getvalue() # type: ignore[attr-defined] 60 | -------------------------------------------------------------------------------- /tests/inline_icon_test.py: -------------------------------------------------------------------------------- 1 | """Tests related to theme's inline icon extension.""" 2 | 3 | from pathlib import Path 4 | 5 | import pytest 6 | from sphinx.testing.util import SphinxTestApp 7 | 8 | from sphinx_immaterial.inline_icons import get_custom_icons 9 | 10 | index_rst = """ 11 | The Test 12 | ======== 13 | 14 | This icon :si-icon:`sphinx_logo;custom-class` is sourced from a third-party. 15 | """ 16 | 17 | sphinx_logo = Path(__file__).parent.parent / "docs" / "_static" / "sphinx_logo.svg" 18 | 19 | 20 | @pytest.mark.parametrize( 21 | "custom_path", ["./", "./sub/path"], ids=["root", "nested_subdir"] 22 | ) 23 | def test_custom_icon(custom_path: str, tmp_path: Path, immaterial_make_app): 24 | (tmp_path / custom_path).mkdir(parents=True, exist_ok=True) 25 | app: SphinxTestApp = immaterial_make_app( 26 | extra_conf=f'sphinx_immaterial_icon_path = ["{custom_path}"]', 27 | files={ 28 | "index.rst": index_rst, 29 | f"{custom_path}/sphinx_logo.svg": sphinx_logo.read_text(encoding="utf-8"), 30 | }, 31 | ) 32 | app.build() 33 | assert not app._warning.getvalue() # type: ignore[attr-defined] 34 | 35 | 36 | def test_bundled_icon_not_found(immaterial_make_app): 37 | app: SphinxTestApp = immaterial_make_app(files={"index.rst": index_rst}) 38 | with pytest.raises(FileNotFoundError): 39 | app.build() 40 | 41 | 42 | def test_merge_env_icon_data(immaterial_make_app): 43 | toc = """ 44 | .. toctree:: 45 | :hidden: 46 | 47 | self 48 | and_more 49 | """ 50 | app: SphinxTestApp = immaterial_make_app( 51 | extra_conf='sphinx_immaterial_icon_path = ["./"]', 52 | files={ 53 | "index.rst": "\n".join([toc, index_rst]), 54 | "and_more.rst": index_rst + "\n:si-icon:`material/material-design`\n", 55 | "sphinx_logo.svg": sphinx_logo.read_text(encoding="utf-8"), 56 | }, 57 | parallel=2, 58 | ) 59 | app.builder.read() 60 | icon_data = get_custom_icons(app.env) 61 | assert icon_data 62 | assert "sphinx_logo" in icon_data 63 | assert "material_material-design" in icon_data 64 | -------------------------------------------------------------------------------- /tests/inline_syntax_highlight_test.py: -------------------------------------------------------------------------------- 1 | """Tests related to theme's syntax highlighting 2 | (default-literal inline and code-block).""" 3 | 4 | import pytest 5 | from sphinx.testing.util import SphinxTestApp 6 | 7 | rst_prologue = """.. role:: python(code) 8 | :language: python 9 | :class: highlight 10 | """ 11 | default_literal_rst = """ 12 | The Test 13 | ======== 14 | 15 | Normal literal role: ``1 + 2`` 16 | 17 | .. default-literal-role:: python 18 | 19 | Python literal role: ``1 + 2`` 20 | 21 | .. default-literal-role:: 22 | 23 | Normal literal role again: ``1 + 2`` 24 | 25 | """ 26 | 27 | highlight_push_pop = """ 28 | The Test 29 | ======== 30 | 31 | .. highlight-push:: 32 | 33 | .. highlight:: json 34 | 35 | The following literal block will be highlighted as JSON:: 36 | 37 | {"a": 10, "b": null, "c": 10} 38 | 39 | .. highlight-push:: 40 | 41 | .. highlight:: python 42 | 43 | The following block will be highlighted as Python:: 44 | 45 | def foo(x: int) -> None: ... 46 | 47 | .. highlight-pop:: 48 | 49 | The following block will be highlighted as JSON:: 50 | 51 | [1, 2, true, false] 52 | """ 53 | 54 | 55 | @pytest.mark.parametrize( 56 | "doc", 57 | [ 58 | "\n".join([rst_prologue, default_literal_rst]), 59 | pytest.param(default_literal_rst, marks=pytest.mark.xfail), 60 | highlight_push_pop, 61 | ], 62 | ids=["default_literal", "default_literal_warning", "highlight_push_pop"], 63 | ) 64 | def test_syntax_highlighting(doc: str, immaterial_make_app): 65 | app: SphinxTestApp = immaterial_make_app( 66 | files={"index.rst": doc}, 67 | ) 68 | 69 | app.build() 70 | assert not app._warning.getvalue() # type: ignore[attr-defined] 71 | -------------------------------------------------------------------------------- /tests/issue_134/issue_134_test.py: -------------------------------------------------------------------------------- 1 | """Test specific to https://github.com/jbms/sphinx-immaterial/issues/134""" 2 | 3 | from typing import List 4 | 5 | import pytest 6 | from sphinx.testing.util import SphinxTestApp 7 | from sphinx_immaterial_pybind11_issue_134 import Example # type: ignore 8 | 9 | 10 | @pytest.mark.parametrize( 11 | "args,expected", [([], False), ([True], True)], ids=["without arg", "with arg"] 12 | ) 13 | def test_issue_134_example_pkg(args: List[bool], expected: bool): 14 | cls = Example(*args) 15 | assert cls.is_set_by_init is expected 16 | 17 | 18 | def test_autoclass_members(immaterial_make_app): 19 | """Issue 134 is related to using ``:members:`` option of 20 | the ``autoclass`` directive.""" 21 | app: SphinxTestApp = immaterial_make_app( 22 | files={ 23 | "index.rst": "\n".join( 24 | [ 25 | "Some API", 26 | "========", 27 | ".. autoclass:: sphinx_immaterial_pybind11_issue_134.Example", 28 | " :members: is_set_by_init", 29 | " :special-members: __init__", # tests overloads in pybind11 (for good measure) 30 | ] 31 | ) 32 | }, 33 | extra_conf='extensions.append("sphinx.ext.autodoc")\n', 34 | ) 35 | app.build() 36 | assert not app._warning.getvalue() # type: ignore[attr-defined] 37 | print(app._status.getvalue()) # type: ignore[attr-defined] 38 | -------------------------------------------------------------------------------- /tests/issue_134/sphinx-immaterial-pybind11-issue-134/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "sphinx-immaterial-pybind11-issue-134" 3 | version = "0" 4 | 5 | [build-system] 6 | requires = [ 7 | "setuptools>=45", 8 | "pybind11", 9 | ] 10 | build-backend = "setuptools.build_meta" 11 | -------------------------------------------------------------------------------- /tests/issue_134/sphinx-immaterial-pybind11-issue-134/setup.py: -------------------------------------------------------------------------------- 1 | # type: ignore 2 | from pybind11.setup_helpers import Pybind11Extension, build_ext 3 | from setuptools import setup 4 | 5 | ext_modules = [ 6 | Pybind11Extension( 7 | "sphinx_immaterial_pybind11_issue_134", 8 | ["sphinx_immaterial_pybind11_issue_134.cpp"], 9 | ), 10 | ] 11 | 12 | setup( 13 | ext_modules=ext_modules, 14 | cmdclass={"build_ext": build_ext}, 15 | ) 16 | -------------------------------------------------------------------------------- /tests/issue_134/sphinx-immaterial-pybind11-issue-134/sphinx_immaterial_pybind11_issue_134.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct Example { 4 | const bool is_set_by_init; 5 | Example() : is_set_by_init(false) {} 6 | Example(const bool value) : is_set_by_init(value) {} 7 | }; 8 | 9 | namespace py = pybind11; 10 | 11 | PYBIND11_MODULE(sphinx_immaterial_pybind11_issue_134, m) { 12 | py::class_ cls(m, "Example"); 13 | 14 | { 15 | py::options options; 16 | options.disable_function_signatures(); 17 | 18 | cls.def(py::init<>(), R"docstr( 19 | __init__() 20 | __init__(value: bool) 21 | 22 | The default constructor takes no args. 23 | )docstr") 24 | .def(py::init(), R"docstr( 25 | The overloaded constructor takes 1 ``bool`` arg. 26 | )docstr", 27 | py::arg("value")); 28 | 29 | cls.def_property_readonly("no_signature", 30 | [](const Example& self) -> int { return 42; }); 31 | } 32 | 33 | cls.def( 34 | "foo", [](Example& self, int x) { return 1; }, R"docstr( 35 | Int overload. 36 | 37 | Overload: 38 | int 39 | )docstr"); 40 | 41 | cls.def( 42 | "foo", [](Example& self, bool x) { return 1; }, R"docstr( 43 | Bool overload. 44 | 45 | Overload: 46 | bool 47 | )docstr"); 48 | 49 | cls.attr("bar") = cls.attr("foo"); 50 | 51 | cls.def_readonly("is_set_by_init", &Example::is_set_by_init, R"docstr( 52 | This read-only ``bool`` attribute is set by the constructor. 53 | )docstr"); 54 | } 55 | -------------------------------------------------------------------------------- /tests/kbd_keys_test.py: -------------------------------------------------------------------------------- 1 | """Tests related to theme's kbd_keys extension.""" 2 | 3 | import pytest 4 | from sphinx.testing.util import SphinxTestApp 5 | 6 | index_rst = """ 7 | The Test 8 | ======== 9 | 10 | :keys:`ctrl+alt+tab` 11 | 12 | :keys:`caps-lock`, :keys:`left-cmd+shift+a`, :keys:`backspace` 13 | 14 | :keys:`my-special-key+My Special Key` 15 | """ 16 | 17 | 18 | @pytest.mark.parametrize("builder", ["html", "latex", "json", "pickle"]) 19 | def test_keys_role(builder: str, immaterial_make_app): 20 | app: SphinxTestApp = immaterial_make_app( 21 | extra_conf="\n".join( 22 | [ 23 | "extensions.append('sphinx_immaterial.kbd_keys')", 24 | 'keys_map = {"my-special-key": "Awesome Key"}', 25 | ] 26 | ), 27 | files={"index.rst": index_rst}, 28 | buildername=builder, 29 | ) 30 | 31 | app.build() 32 | assert not app._warning.getvalue() # type: ignore[attr-defined] 33 | -------------------------------------------------------------------------------- /tests/mermaid_test.py: -------------------------------------------------------------------------------- 1 | """Tests related to theme's mermaid graphs extension.""" 2 | 3 | import pytest 4 | from sphinx.testing.util import SphinxTestApp 5 | 6 | index_rst = """ 7 | The Test 8 | ======== 9 | 10 | .. md-mermaid:: 11 | :name: flowcharts 12 | 13 | graph LR 14 | A[Start] --> B{Error?}; 15 | B -->|Yes| C[Hmm...]; 16 | C --> D[Debug]; 17 | D --> B; 18 | B ---->|No| E[Yay!]; 19 | """ 20 | 21 | 22 | @pytest.mark.parametrize("builder", ["html", "latex", "json", "pickle"]) 23 | def test_mermaid_graph(builder: str, immaterial_make_app): 24 | app: SphinxTestApp = immaterial_make_app( 25 | files={"index.rst": index_rst}, 26 | buildername=builder, 27 | ) 28 | 29 | app.build() 30 | assert not app._warning.getvalue() # type: ignore[attr-defined] 31 | -------------------------------------------------------------------------------- /tests/python_apigen_test_modules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/tests/python_apigen_test_modules/__init__.py -------------------------------------------------------------------------------- /tests/python_apigen_test_modules/_alpha.py: -------------------------------------------------------------------------------- 1 | from ._bravo import Bravo 2 | 3 | 4 | class Alpha(Bravo): 5 | """ 6 | Class Alpha docstring. 7 | """ 8 | 9 | def my_method_Alpha(self) -> int: 10 | """ 11 | This is my_method_Alpha. 12 | 13 | This is paragraph two. 14 | """ 15 | return 1 16 | 17 | @property 18 | def my_property_Alpha(self) -> str: 19 | """ 20 | This is my_property_Alpha. 21 | 22 | This is paragraph two. 23 | """ 24 | return "alpha" 25 | -------------------------------------------------------------------------------- /tests/python_apigen_test_modules/_bravo.py: -------------------------------------------------------------------------------- 1 | class Bravo: 2 | """ 3 | Class Bravo docstring. 4 | """ 5 | 6 | def my_method_Bravo(self) -> int: 7 | """ 8 | This is my_method_Bravo. 9 | 10 | This is paragraph two. 11 | """ 12 | return 1 13 | 14 | @property 15 | def my_property_Bravo(self) -> str: 16 | """ 17 | This is my_property_Bravo. 18 | 19 | This is paragraph two. 20 | """ 21 | return "bravo" 22 | -------------------------------------------------------------------------------- /tests/python_apigen_test_modules/alphabetical.py: -------------------------------------------------------------------------------- 1 | def b(): 2 | pass 3 | 4 | 5 | def a(): 6 | pass 7 | -------------------------------------------------------------------------------- /tests/python_apigen_test_modules/classmethod.py: -------------------------------------------------------------------------------- 1 | class Foo: 2 | @classmethod 3 | def my_classmethod(cls, arg: str) -> int: 4 | return 1 5 | 6 | @staticmethod 7 | def my_staticmethod(arg: str) -> int: 8 | return 1 9 | 10 | def my_method(self, arg: str) -> int: 11 | return 1 12 | -------------------------------------------------------------------------------- /tests/python_apigen_test_modules/issue147.py: -------------------------------------------------------------------------------- 1 | from ._alpha import Alpha # noqa: F401 2 | from ._bravo import Bravo # noqa: F401 3 | -------------------------------------------------------------------------------- /tests/python_apigen_test_modules/property.py: -------------------------------------------------------------------------------- 1 | class Example: 2 | @property 3 | def foo(self) -> int: 4 | return 42 5 | 6 | bar = foo 7 | 8 | 9 | class InheritsFromExample(Example): 10 | foo = "abc" # type: ignore[assignment] 11 | 12 | baz = Example.bar 13 | -------------------------------------------------------------------------------- /tests/python_apigen_test_modules/type_params.py: -------------------------------------------------------------------------------- 1 | from typing import TypeVar 2 | 3 | T = TypeVar("T") 4 | 5 | 6 | def foo(x: T) -> T: 7 | """Foo function. 8 | 9 | :param x: Something or other. 10 | """ 11 | return x 12 | 13 | 14 | def bar(x: T) -> T: 15 | return x 16 | 17 | 18 | class C: 19 | def get(self, x: T, y: T) -> T: 20 | """Get function. 21 | 22 | :param x: Something or other. 23 | :param y: Another param. 24 | :type y: T 25 | """ 26 | return x 27 | 28 | 29 | __all__ = ["foo", "bar", "C"] 30 | -------------------------------------------------------------------------------- /tests/python_object_ids_test.py: -------------------------------------------------------------------------------- 1 | import sphinx.addnodes 2 | 3 | 4 | def test_nonodeid(immaterial_make_app): 5 | app = immaterial_make_app( 6 | files={ 7 | "index.rst": """ 8 | .. py:class:: Bar 9 | 10 | .. py:class:: Foo 11 | :nonodeid: 12 | """ 13 | }, 14 | ) 15 | 16 | app.build() 17 | 18 | assert not app._warning.getvalue() 19 | 20 | doc = app.env.get_and_resolve_doctree("index", app.builder) 21 | 22 | nodes = list(doc.findall(condition=sphinx.addnodes.desc_signature)) 23 | 24 | assert len(nodes) == 2 25 | 26 | assert nodes[0]["ids"] == ["Bar"] 27 | assert nodes[1]["ids"] == [] 28 | 29 | 30 | def test_invalid_signature(immaterial_make_app): 31 | app = immaterial_make_app( 32 | files={ 33 | "index.rst": """ 34 | .. py:function:: bar( 35 | """ 36 | }, 37 | ) 38 | 39 | app.build() 40 | 41 | assert not app._warning.getvalue() 42 | 43 | doc = app.env.get_and_resolve_doctree("index", app.builder) 44 | 45 | nodes = list(doc.findall(condition=sphinx.addnodes.desc_signature)) 46 | 47 | assert len(nodes) == 1 48 | 49 | assert nodes[0]["ids"] == [] 50 | -------------------------------------------------------------------------------- /tests/python_parameter_cross_link_test.py: -------------------------------------------------------------------------------- 1 | def test_python_parameter_cross_link(immaterial_make_app, snapshot): 2 | app = immaterial_make_app( 3 | files={ 4 | "index.rst": r""" 5 | .. py:function:: foo(x: int, *args: list[int], **kwargs: dict[str, int]) -> int 6 | 7 | Description goes here. 8 | 9 | :param x: X parameter. 10 | :param \*args: Args parameter. 11 | :param \*\*kwargs: Kwargs parameter. 12 | 13 | """ 14 | }, 15 | ) 16 | 17 | app.build() 18 | 19 | assert not app._warning.getvalue() 20 | -------------------------------------------------------------------------------- /tests/python_synopsis_test.py: -------------------------------------------------------------------------------- 1 | import docutils.nodes 2 | 3 | 4 | def test_python_class_synopsis(immaterial_make_app, snapshot): 5 | app = immaterial_make_app( 6 | files={ 7 | "index.rst": """ 8 | .. py:class:: Bar 9 | 10 | Synopsis goes here. 11 | 12 | Rest of description goes here. 13 | 14 | :py:obj:`Bar` 15 | """ 16 | }, 17 | ) 18 | 19 | app.build() 20 | 21 | assert not app._warning.getvalue() 22 | 23 | doc = app.env.get_and_resolve_doctree("index", app.builder) 24 | 25 | node = list(doc.findall(condition=docutils.nodes.reference))[-1] 26 | 27 | snapshot.assert_match(node["reftitle"], "reftitle.txt") 28 | -------------------------------------------------------------------------------- /tests/python_type_param_utils_test.py: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | import pytest 4 | import sphinx 5 | 6 | from sphinx_immaterial.apidoc.python import type_param_utils 7 | 8 | if sphinx.version_info < (7, 1): 9 | pytest.skip( 10 | f"Type parameters not supported by Sphinx {sphinx.version_info}", 11 | allow_module_level=True, 12 | ) 13 | 14 | 15 | T = typing.TypeVar("T") 16 | U = typing.TypeVar("U") 17 | 18 | 19 | class Foo(typing.Generic[T, U]): 20 | pass 21 | 22 | 23 | class Bar1(Foo): 24 | pass 25 | 26 | 27 | class Bar2(Foo, typing.Generic[U, T]): 28 | pass 29 | 30 | 31 | class Bar3(Foo[int, T]): 32 | pass 33 | 34 | 35 | def test_get_class_type_params(): 36 | assert type_param_utils.get_class_type_params(int) == () 37 | assert type_param_utils.get_class_type_params(Foo) == (T, U) 38 | assert type_param_utils.get_class_type_params(Bar1) == (T, U) 39 | assert type_param_utils.get_class_type_params(Bar2) == (U, T) 40 | assert type_param_utils.get_class_type_params(Bar3) == (T,) 41 | 42 | 43 | def test_get_base_class_type_param_substitutions(): 44 | class Bar4(Bar3[tuple[U, int]]): 45 | pass 46 | 47 | assert type_param_utils.get_base_class_type_param_substitutions(Bar4) == { 48 | Foo: {"T": "int", "U": "tuple[__SPHINX_IMMATERIAL_TYPE_VAR__V_U, int]"}, 49 | Bar3: {"T": "tuple[__SPHINX_IMMATERIAL_TYPE_VAR__V_U, int]"}, 50 | } 51 | -------------------------------------------------------------------------------- /tests/search_index_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pathlib 3 | 4 | import sphinx.search 5 | 6 | 7 | def test_object_anchor(immaterial_make_app): 8 | app = immaterial_make_app( 9 | files={ 10 | "index.rst": """ 11 | Overall title 12 | ============= 13 | 14 | .. py:class:: Foo 15 | """, 16 | }, 17 | ) 18 | app.build() 19 | 20 | assert not app._warning.getvalue() 21 | search_index_js = pathlib.Path( 22 | os.path.join(app.outdir, "searchindex.js") 23 | ).read_text("utf-8") 24 | search_index = sphinx.search.js_index.loads(search_index_js) 25 | 26 | assert search_index["objects"] == {"": [[0, 0, 1, 0, "Foo", ""]]} 27 | -------------------------------------------------------------------------------- /tests/sitemap_test.py: -------------------------------------------------------------------------------- 1 | """Tests related to theme's postprocess_html extension (which creates a sitemap).""" 2 | 3 | from pathlib import Path 4 | 5 | from sphinx.testing.util import SphinxTestApp 6 | 7 | index_rst = """ 8 | The Test 9 | ======== 10 | """ 11 | 12 | 13 | def test_create_sitemap(tmp_path: Path, immaterial_make_app): 14 | url = "https://example.com/test" 15 | app: SphinxTestApp = immaterial_make_app( 16 | extra_conf=f'html_theme_options = {{"site_url": "{url}"}}', 17 | files={"index.rst": index_rst}, 18 | ) 19 | app.build() 20 | assert not app._warning.getvalue() # type: ignore[attr-defined] 21 | sitemap = tmp_path / "_build" / "html" / "sitemap.xml" 22 | assert sitemap.exists() 23 | sitemap_data = sitemap.read_text(encoding="utf-8") 24 | for doc in ["index", "genindex"]: 25 | assert f"{url}/{doc}.html" in sitemap_data 26 | -------------------------------------------------------------------------------- /tests/snapshots/cpp_domain_test/test_macro_parameter_objects/references.txt: -------------------------------------------------------------------------------- 1 | {"text": "a", "refid": "c.FOO-p-a", "reftitle": "a (C macro parameter) \u2014 A parameter."} 2 | {"text": "b", "refid": "c.FOO-p-b", "reftitle": "b (C macro parameter) \u2014 B parameter."} 3 | {"text": "c", "refid": "c.FOO", "reftitle": "c (C macro parameter)"} -------------------------------------------------------------------------------- /tests/snapshots/cpp_domain_test/test_parameter_objects/None/references.txt: -------------------------------------------------------------------------------- 1 | {"text": "bar", "refid": "_CPPv43fooiii-p-bar", "reftitle": "foo::bar (C++ function parameter) \u2014 Bar parameter."} 2 | {"text": "baz", "refid": "_CPPv43fooiii-p-baz", "reftitle": "foo::baz (C++ function parameter) \u2014 Baz parameter."} 3 | {"text": "undocumented", "refid": "_CPPv43fooiii", "reftitle": "foo::undocumented (C++ function parameter)"} -------------------------------------------------------------------------------- /tests/snapshots/cpp_domain_test/test_parameter_objects/abc/references.txt: -------------------------------------------------------------------------------- 1 | {"text": "bar", "refid": "abc-p-bar", "reftitle": "foo::bar (C++ function parameter) \u2014 Bar parameter."} 2 | {"text": "baz", "refid": "abc-p-baz", "reftitle": "foo::baz (C++ function parameter) \u2014 Baz parameter."} 3 | {"text": "undocumented", "refid": "abc", "reftitle": "foo::undocumented (C++ function parameter)"} -------------------------------------------------------------------------------- /tests/snapshots/cpp_domain_test/test_parameter_objects/empty/references.txt: -------------------------------------------------------------------------------- 1 | {"text": "bar", "refid": "p-bar", "reftitle": "foo::bar (C++ function parameter) \u2014 Bar parameter."} 2 | {"text": "baz", "refid": "p-baz", "reftitle": "foo::baz (C++ function parameter) \u2014 Baz parameter."} 3 | {"text": "undocumented", "refid": "", "reftitle": "foo::undocumented (C++ function parameter)"} -------------------------------------------------------------------------------- /tests/snapshots/cpp_domain_test/test_template_parameter_objects/references.txt: -------------------------------------------------------------------------------- 1 | {"text": "T", "refid": "_CPPv4I0_iI0E0E3foovv-p-T", "reftitle": "foo::T (C++ type template parameter) \u2014 T parameter."} 2 | {"text": "N", "refid": "_CPPv4I0_iI0E0E3foovv-p-N", "reftitle": "foo::N (C++ non-type template parameter) \u2014 N parameter."} 3 | {"text": "U", "refid": "_CPPv4I0_iI0E0E3foovv", "reftitle": "foo::U (C++ template template parameter)"} -------------------------------------------------------------------------------- /tests/snapshots/format_signatures_test/test_format_signatures/cpp_function_astext.txt: -------------------------------------------------------------------------------- 1 | void foo(int something, int something_else, bool third_param, 2 | bool fourth_param, int fifth_param); -------------------------------------------------------------------------------- /tests/snapshots/format_signatures_test/test_format_signatures/cpp_function_long_astext.txt: -------------------------------------------------------------------------------- 1 | template 2 | requires std::is_const_v 3 | const MyType 4 | LongFunctionSignatureExample(const MyType bar, uint8_t *arr, 5 | unsigned int len = DEFAULT_LENGTH, 6 | bool baz = false); -------------------------------------------------------------------------------- /tests/snapshots/format_signatures_test/test_format_signatures/cpp_function_long_return_type_astext.txt: -------------------------------------------------------------------------------- 1 | std::integral_constant 2 | tensorstore::GetStaticOrDynamicExtent(span); 3 | -------------------------------------------------------------------------------- /tests/snapshots/format_signatures_test/test_format_signatures/py_class_astext.txt: -------------------------------------------------------------------------------- 1 | class my.very.long.python_class.ClassName( 2 | zarr.core.chunk_key_encodings.ChunkKeyEncoding1, 3 | zarr.core.chunk_key_encodings.GenericBase[ 4 | tuple[str, float, numbers.Real], dict[int, str] 5 | ], 6 | ) -------------------------------------------------------------------------------- /tests/snapshots/format_signatures_test/test_format_signatures/py_class_constructor_astext.txt: -------------------------------------------------------------------------------- 1 | class zarr.abc.store.Store(*, read_only: bool = False) -------------------------------------------------------------------------------- /tests/snapshots/format_signatures_test/test_format_signatures/py_class_constructor_long_astext.txt: -------------------------------------------------------------------------------- 1 | class zarr.abc.store.Store2( 2 | some_long_positional_parameter: collections.abc.MutableMapping[ 3 | tuple[str, float, numbers.Real], 4 | dict[int, tuple[list[frozenset[int]]]], 5 | ], 6 | *, 7 | read_only: bool = False 8 | ) -------------------------------------------------------------------------------- /tests/snapshots/format_signatures_test/test_format_signatures/py_function2_astext.txt: -------------------------------------------------------------------------------- 1 | create( 2 | chunk_key_encoding: ( 3 | zarr.core.chunk_key_encodings.ChunkKeyEncoding 4 | | tuple["default", "." | "/"] 5 | | tuple["v2", "." | "/"] 6 | | None 7 | ) = None, 8 | ) -> Array -------------------------------------------------------------------------------- /tests/snapshots/format_signatures_test/test_format_signatures/py_function3_astext.txt: -------------------------------------------------------------------------------- 1 | zarr.Array.from_dict( 2 | store_path: StorePath, 3 | data: dict[ 4 | str, 5 | str 6 | | int 7 | | float 8 | | Mapping[ 9 | str, 10 | str 11 | | int 12 | | float 13 | | Mapping[str, JSON] 14 | | collections.abc.Sequence[JSON] 15 | | None, 16 | ] 17 | | collections.abc.Sequence[ 18 | str 19 | | int 20 | | float 21 | | Mapping[str, JSON] 22 | | collections.abc.Sequence[JSON] 23 | | None 24 | ] 25 | | None, 26 | ], 27 | ) -> Array -------------------------------------------------------------------------------- /tests/snapshots/format_signatures_test/test_format_signatures/py_function_astext.txt: -------------------------------------------------------------------------------- 1 | some_module.method_name( 2 | some_parameter_with_a_long_name: collections.abc.MutableMapping[ 3 | tuple[str, float, numbers.Real], 4 | dict[int, tuple[list[frozenset[int]]]], 5 | ], 6 | ) -> collections.abc.MutableMapping[ 7 | tuple[str, float, numbers.Real], 8 | dict[int, tuple[list[frozenset[int]]]], 9 | ] -------------------------------------------------------------------------------- /tests/snapshots/nav_adapt_test/test_include_rubrics_in_toc/False/index.yml: -------------------------------------------------------------------------------- 1 | global_toc: [] 2 | integrated_local_toc: [] 3 | local_toc: 4 | - active: false 5 | aria_label: Overall title 6 | caption_only: false 7 | children: 8 | - active: false 9 | aria_label: Foo 10 | caption_only: false 11 | children: [] 12 | current: false 13 | icon_html: C 15 | meta: {} 16 | title: "Foo" 17 | url: '#Foo' 18 | current: false 19 | meta: {} 20 | title: Overall title 21 | url: '#' 22 | -------------------------------------------------------------------------------- /tests/snapshots/nav_adapt_test/test_include_rubrics_in_toc/True/index.yml: -------------------------------------------------------------------------------- 1 | global_toc: [] 2 | integrated_local_toc: [] 3 | local_toc: 4 | - active: false 5 | aria_label: Overall title 6 | caption_only: false 7 | children: 8 | - active: false 9 | aria_label: Foo 10 | caption_only: false 11 | children: 12 | - active: false 13 | aria_label: Examples 14 | caption_only: false 15 | children: [] 16 | current: false 17 | meta: {} 18 | title: Examples 19 | url: '#examples' 20 | current: false 21 | icon_html: C 23 | meta: {} 24 | title: "Foo" 25 | url: '#Foo' 26 | current: false 27 | meta: {} 28 | title: Overall title 29 | url: '#' 30 | -------------------------------------------------------------------------------- /tests/snapshots/nav_adapt_test/test_nav/collapse_False-includeonly_False/b.yml: -------------------------------------------------------------------------------- 1 | global_toc: 2 | - active: true 3 | active_or_section_within_active: true 4 | aria_label: A page 5 | caption_only: false 6 | children: 7 | - active: true 8 | active_or_section_within_active: true 9 | aria_label: Section 1 10 | caption_only: false 11 | children: 12 | - active: true 13 | active_or_section_within_active: true 14 | aria_label: B page 15 | caption_only: false 16 | children: [] 17 | current: true 18 | meta: 19 | status: new 20 | title: B page 21 | url: '#' 22 | current: false 23 | meta: {} 24 | title: Section 1 25 | url: a.html#section-1 26 | current: false 27 | meta: 28 | icon: material/test-tube 29 | subtitle: A subtitle 30 | title: A page 31 | url: a.html 32 | - active: false 33 | active_or_section_within_active: false 34 | aria_label: TOC caption 35 | caption_only: true 36 | children: 37 | - active: false 38 | active_or_section_within_active: false 39 | aria_label: C page 40 | caption_only: false 41 | children: [] 42 | current: false 43 | meta: {} 44 | title: C page 45 | url: c.html 46 | current: false 47 | meta: {} 48 | title: TOC caption 49 | url: c.html 50 | integrated_local_toc: [] 51 | local_toc: [] 52 | -------------------------------------------------------------------------------- /tests/snapshots/nav_adapt_test/test_nav/collapse_False-includeonly_False/c.yml: -------------------------------------------------------------------------------- 1 | global_toc: 2 | - active: false 3 | active_or_section_within_active: false 4 | aria_label: A page 5 | caption_only: false 6 | children: 7 | - active: false 8 | active_or_section_within_active: false 9 | aria_label: Section 1 10 | caption_only: false 11 | children: 12 | - active: false 13 | active_or_section_within_active: false 14 | aria_label: B page 15 | caption_only: false 16 | children: [] 17 | current: false 18 | meta: 19 | status: new 20 | title: B page 21 | url: b.html 22 | current: false 23 | meta: {} 24 | title: Section 1 25 | url: a.html#section-1 26 | current: false 27 | meta: 28 | icon: material/test-tube 29 | subtitle: A subtitle 30 | title: A page 31 | url: a.html 32 | - active: true 33 | active_or_section_within_active: true 34 | aria_label: TOC caption 35 | caption_only: true 36 | children: 37 | - active: true 38 | active_or_section_within_active: true 39 | aria_label: C page 40 | caption_only: false 41 | children: [] 42 | current: true 43 | meta: {} 44 | title: C page 45 | url: '#' 46 | current: false 47 | meta: {} 48 | title: TOC caption 49 | url: '#' 50 | integrated_local_toc: [] 51 | local_toc: [] 52 | -------------------------------------------------------------------------------- /tests/snapshots/nav_adapt_test/test_nav/collapse_False-includeonly_False/index.yml: -------------------------------------------------------------------------------- 1 | global_toc: 2 | - active: false 3 | active_or_section_within_active: false 4 | aria_label: A page 5 | caption_only: false 6 | children: 7 | - active: false 8 | active_or_section_within_active: false 9 | aria_label: Section 1 10 | caption_only: false 11 | children: 12 | - active: false 13 | active_or_section_within_active: false 14 | aria_label: B page 15 | caption_only: false 16 | children: [] 17 | current: false 18 | meta: 19 | status: new 20 | title: B page 21 | url: b.html 22 | current: false 23 | meta: {} 24 | title: Section 1 25 | url: a.html#section-1 26 | current: false 27 | meta: 28 | icon: material/test-tube 29 | subtitle: A subtitle 30 | title: A page 31 | url: a.html 32 | - active: false 33 | active_or_section_within_active: false 34 | aria_label: TOC caption 35 | caption_only: true 36 | children: 37 | - active: false 38 | active_or_section_within_active: false 39 | aria_label: C page 40 | caption_only: false 41 | children: [] 42 | current: false 43 | meta: {} 44 | title: C page 45 | url: c.html 46 | current: false 47 | meta: {} 48 | title: TOC caption 49 | url: c.html 50 | integrated_local_toc: [] 51 | local_toc: 52 | - active: false 53 | aria_label: Overall title 54 | caption_only: false 55 | children: 56 | - active: false 57 | aria_label: Getting started 58 | caption_only: false 59 | children: [] 60 | current: false 61 | meta: {} 62 | title: Getting started 63 | url: '#getting-started' 64 | - active: false 65 | aria_label: Another section 66 | caption_only: false 67 | children: [] 68 | current: false 69 | meta: {} 70 | title: Another section 71 | url: '#another-section' 72 | current: false 73 | meta: {} 74 | title: Overall title 75 | url: '#' 76 | -------------------------------------------------------------------------------- /tests/snapshots/nav_adapt_test/test_nav/collapse_False-includeonly_True/b.yml: -------------------------------------------------------------------------------- 1 | global_toc: 2 | - active: true 3 | active_or_section_within_active: true 4 | aria_label: A page 5 | caption_only: false 6 | children: 7 | - active: true 8 | active_or_section_within_active: true 9 | aria_label: Section 1 10 | caption_only: false 11 | children: 12 | - active: true 13 | active_or_section_within_active: true 14 | aria_label: B page 15 | caption_only: false 16 | children: [] 17 | current: true 18 | meta: 19 | status: new 20 | title: B page 21 | url: '#' 22 | current: false 23 | meta: {} 24 | title: Section 1 25 | url: a.html#section-1 26 | current: false 27 | meta: 28 | icon: material/test-tube 29 | subtitle: A subtitle 30 | title: A page 31 | url: a.html 32 | - active: false 33 | active_or_section_within_active: false 34 | aria_label: TOC caption 35 | caption_only: true 36 | children: 37 | - active: false 38 | active_or_section_within_active: false 39 | aria_label: C page 40 | caption_only: false 41 | children: [] 42 | current: false 43 | meta: {} 44 | title: C page 45 | url: c.html 46 | current: false 47 | meta: {} 48 | title: TOC caption 49 | url: c.html 50 | integrated_local_toc: [] 51 | local_toc: [] 52 | -------------------------------------------------------------------------------- /tests/snapshots/nav_adapt_test/test_nav/collapse_False-includeonly_True/c.yml: -------------------------------------------------------------------------------- 1 | global_toc: 2 | - active: false 3 | active_or_section_within_active: false 4 | aria_label: A page 5 | caption_only: false 6 | children: 7 | - active: false 8 | active_or_section_within_active: false 9 | aria_label: Section 1 10 | caption_only: false 11 | children: 12 | - active: false 13 | active_or_section_within_active: false 14 | aria_label: B page 15 | caption_only: false 16 | children: [] 17 | current: false 18 | meta: 19 | status: new 20 | title: B page 21 | url: b.html 22 | current: false 23 | meta: {} 24 | title: Section 1 25 | url: a.html#section-1 26 | current: false 27 | meta: 28 | icon: material/test-tube 29 | subtitle: A subtitle 30 | title: A page 31 | url: a.html 32 | - active: true 33 | active_or_section_within_active: true 34 | aria_label: TOC caption 35 | caption_only: true 36 | children: 37 | - active: true 38 | active_or_section_within_active: true 39 | aria_label: C page 40 | caption_only: false 41 | children: [] 42 | current: true 43 | meta: {} 44 | title: C page 45 | url: '#' 46 | current: false 47 | meta: {} 48 | title: TOC caption 49 | url: '#' 50 | integrated_local_toc: [] 51 | local_toc: [] 52 | -------------------------------------------------------------------------------- /tests/snapshots/nav_adapt_test/test_nav/collapse_True-includeonly_False/b.yml: -------------------------------------------------------------------------------- 1 | global_toc: 2 | - active: true 3 | active_or_section_within_active: true 4 | aria_label: A page 5 | caption_only: false 6 | children: 7 | - active: true 8 | active_or_section_within_active: true 9 | aria_label: Section 1 10 | caption_only: false 11 | children: 12 | - active: true 13 | active_or_section_within_active: true 14 | aria_label: B page 15 | caption_only: false 16 | children: [] 17 | current: true 18 | meta: 19 | status: new 20 | title: B page 21 | url: '#' 22 | current: false 23 | meta: {} 24 | title: Section 1 25 | url: a.html#section-1 26 | current: false 27 | meta: 28 | icon: material/test-tube 29 | subtitle: A subtitle 30 | title: A page 31 | url: a.html 32 | - active: false 33 | active_or_section_within_active: false 34 | aria_label: TOC caption 35 | caption_only: true 36 | children: 37 | - active: false 38 | active_or_section_within_active: false 39 | aria_label: C page 40 | caption_only: false 41 | children: [] 42 | current: false 43 | meta: {} 44 | title: C page 45 | url: c.html 46 | current: false 47 | meta: {} 48 | title: TOC caption 49 | url: c.html 50 | integrated_local_toc: [] 51 | local_toc: [] 52 | -------------------------------------------------------------------------------- /tests/snapshots/nav_adapt_test/test_nav/collapse_True-includeonly_False/c.yml: -------------------------------------------------------------------------------- 1 | global_toc: 2 | - active: false 3 | active_or_section_within_active: false 4 | aria_label: A page 5 | caption_only: false 6 | children: [] 7 | current: false 8 | meta: 9 | icon: material/test-tube 10 | subtitle: A subtitle 11 | title: A page 12 | url: a.html 13 | - active: true 14 | active_or_section_within_active: true 15 | aria_label: TOC caption 16 | caption_only: true 17 | children: 18 | - active: true 19 | active_or_section_within_active: true 20 | aria_label: C page 21 | caption_only: false 22 | children: [] 23 | current: true 24 | meta: {} 25 | title: C page 26 | url: '#' 27 | current: false 28 | meta: {} 29 | title: TOC caption 30 | url: '#' 31 | integrated_local_toc: [] 32 | local_toc: [] 33 | -------------------------------------------------------------------------------- /tests/snapshots/nav_adapt_test/test_nav/collapse_True-includeonly_False/index.yml: -------------------------------------------------------------------------------- 1 | global_toc: 2 | - active: false 3 | active_or_section_within_active: false 4 | aria_label: A page 5 | caption_only: false 6 | children: [] 7 | current: false 8 | meta: 9 | icon: material/test-tube 10 | subtitle: A subtitle 11 | title: A page 12 | url: a.html 13 | - active: false 14 | active_or_section_within_active: false 15 | aria_label: TOC caption 16 | caption_only: true 17 | children: 18 | - active: false 19 | active_or_section_within_active: false 20 | aria_label: C page 21 | caption_only: false 22 | children: [] 23 | current: false 24 | meta: {} 25 | title: C page 26 | url: c.html 27 | current: false 28 | meta: {} 29 | title: TOC caption 30 | url: c.html 31 | integrated_local_toc: [] 32 | local_toc: 33 | - active: false 34 | aria_label: Overall title 35 | caption_only: false 36 | children: 37 | - active: false 38 | aria_label: Getting started 39 | caption_only: false 40 | children: [] 41 | current: false 42 | meta: {} 43 | title: Getting started 44 | url: '#getting-started' 45 | - active: false 46 | aria_label: Another section 47 | caption_only: false 48 | children: [] 49 | current: false 50 | meta: {} 51 | title: Another section 52 | url: '#another-section' 53 | current: false 54 | meta: {} 55 | title: Overall title 56 | url: '#' 57 | -------------------------------------------------------------------------------- /tests/snapshots/nav_adapt_test/test_nav/collapse_True-includeonly_True/b.yml: -------------------------------------------------------------------------------- 1 | global_toc: 2 | - active: true 3 | active_or_section_within_active: true 4 | aria_label: A page 5 | caption_only: false 6 | children: 7 | - active: true 8 | active_or_section_within_active: true 9 | aria_label: Section 1 10 | caption_only: false 11 | children: 12 | - active: true 13 | active_or_section_within_active: true 14 | aria_label: B page 15 | caption_only: false 16 | children: [] 17 | current: true 18 | meta: 19 | status: new 20 | title: B page 21 | url: '#' 22 | current: false 23 | meta: {} 24 | title: Section 1 25 | url: a.html#section-1 26 | current: false 27 | meta: 28 | icon: material/test-tube 29 | subtitle: A subtitle 30 | title: A page 31 | url: a.html 32 | - active: false 33 | active_or_section_within_active: false 34 | aria_label: TOC caption 35 | caption_only: true 36 | children: 37 | - active: false 38 | active_or_section_within_active: false 39 | aria_label: C page 40 | caption_only: false 41 | children: [] 42 | current: false 43 | meta: {} 44 | title: C page 45 | url: c.html 46 | current: false 47 | meta: {} 48 | title: TOC caption 49 | url: c.html 50 | integrated_local_toc: [] 51 | local_toc: [] 52 | -------------------------------------------------------------------------------- /tests/snapshots/nav_adapt_test/test_nav/collapse_True-includeonly_True/c.yml: -------------------------------------------------------------------------------- 1 | global_toc: 2 | - active: false 3 | active_or_section_within_active: false 4 | aria_label: A page 5 | caption_only: false 6 | children: [] 7 | current: false 8 | meta: 9 | icon: material/test-tube 10 | subtitle: A subtitle 11 | title: A page 12 | url: a.html 13 | - active: true 14 | active_or_section_within_active: true 15 | aria_label: TOC caption 16 | caption_only: true 17 | children: 18 | - active: true 19 | active_or_section_within_active: true 20 | aria_label: C page 21 | caption_only: false 22 | children: [] 23 | current: true 24 | meta: {} 25 | title: C page 26 | url: '#' 27 | current: false 28 | meta: {} 29 | title: TOC caption 30 | url: '#' 31 | integrated_local_toc: [] 32 | local_toc: [] 33 | -------------------------------------------------------------------------------- /tests/snapshots/nav_adapt_test/test_nav/collapse_True-includeonly_True/index.yml: -------------------------------------------------------------------------------- 1 | global_toc: 2 | - active: false 3 | active_or_section_within_active: false 4 | aria_label: A page 5 | caption_only: false 6 | children: [] 7 | current: false 8 | meta: 9 | icon: material/test-tube 10 | subtitle: A subtitle 11 | title: A page 12 | url: a.html 13 | - active: false 14 | active_or_section_within_active: false 15 | aria_label: TOC caption 16 | caption_only: true 17 | children: 18 | - active: false 19 | active_or_section_within_active: false 20 | aria_label: C page 21 | caption_only: false 22 | children: [] 23 | current: false 24 | meta: {} 25 | title: C page 26 | url: c.html 27 | current: false 28 | meta: {} 29 | title: TOC caption 30 | url: c.html 31 | integrated_local_toc: [] 32 | local_toc: 33 | - active: false 34 | aria_label: Overall title 35 | caption_only: false 36 | children: 37 | - active: false 38 | aria_label: Getting started 39 | caption_only: false 40 | children: 41 | - active: false 42 | aria_label: Foo 43 | caption_only: false 44 | children: [] 45 | current: false 46 | icon_html: C 48 | meta: {} 49 | title: Foo 50 | url: '#Foo' 51 | current: false 52 | meta: {} 53 | title: Getting started 54 | url: '#getting-started' 55 | - active: false 56 | aria_label: Another section 57 | caption_only: false 58 | children: [] 59 | current: false 60 | meta: {} 61 | title: Another section 62 | url: '#another-section' 63 | current: false 64 | meta: {} 65 | title: Overall title 66 | url: '#' 67 | -------------------------------------------------------------------------------- /tests/snapshots/python_apigen_test/test_pybind11_overloaded_function/Example.bar_bool.json: -------------------------------------------------------------------------------- 1 | { 2 | "signatures": [ 3 | "(self: sphinx_immaterial_pybind11_issue_134.Example, arg0: bool) -> int" 4 | ], 5 | "primary_entity": false, 6 | "siblings": null 7 | } -------------------------------------------------------------------------------- /tests/snapshots/python_apigen_test/test_pybind11_overloaded_function/Example.bar_int.json: -------------------------------------------------------------------------------- 1 | { 2 | "signatures": [ 3 | "(self: sphinx_immaterial_pybind11_issue_134.Example, arg0: int) -> int" 4 | ], 5 | "primary_entity": false, 6 | "siblings": null 7 | } -------------------------------------------------------------------------------- /tests/snapshots/python_apigen_test/test_pybind11_overloaded_function/Example.foo_bool.json: -------------------------------------------------------------------------------- 1 | { 2 | "signatures": [ 3 | "(self: sphinx_immaterial_pybind11_issue_134.Example, arg0: bool) -> int" 4 | ], 5 | "primary_entity": true, 6 | "siblings": { 7 | "sphinx_immaterial_pybind11_issue_134.Example.bar(bool)": true 8 | } 9 | } -------------------------------------------------------------------------------- /tests/snapshots/python_apigen_test/test_pybind11_overloaded_function/Example.foo_int.json: -------------------------------------------------------------------------------- 1 | { 2 | "signatures": [ 3 | "(self: sphinx_immaterial_pybind11_issue_134.Example, arg0: int) -> int" 4 | ], 5 | "primary_entity": true, 6 | "siblings": { 7 | "sphinx_immaterial_pybind11_issue_134.Example.bar(int)": true 8 | } 9 | } -------------------------------------------------------------------------------- /tests/snapshots/python_synopsis_test/test_python_class_synopsis/reftitle.txt: -------------------------------------------------------------------------------- 1 | Bar (Python class) — Synopsis goes here. -------------------------------------------------------------------------------- /tests/system_fonts_test.py: -------------------------------------------------------------------------------- 1 | """Tests related to theme's patched graphviz ext.""" 2 | 3 | from sphinx.testing.util import SphinxTestApp 4 | 5 | 6 | def test_system_font(immaterial_make_app): 7 | """generate a graph and some regular/mono text with system font as fallback.""" 8 | app: SphinxTestApp = immaterial_make_app( 9 | extra_conf="\n".join( 10 | [ 11 | 'extensions.append("sphinx_immaterial.graphviz")', 12 | # tests also run on Windows in CI 13 | "graphviz_ignore_incorrect_font_metrics = True", 14 | "html_theme_options = dict(font=False)", 15 | ] 16 | ), 17 | files={ 18 | "index.rst": """ 19 | The Test 20 | ======== 21 | 22 | Some normal text and:: 23 | 24 | Some monospace text 25 | 26 | A graph 27 | ------- 28 | 29 | .. graphviz:: 30 | 31 | digraph { A -> B } 32 | """, 33 | }, 34 | ) 35 | 36 | app.build() 37 | assert not app._warning.getvalue() # type: ignore[attr-defined] 38 | -------------------------------------------------------------------------------- /tests/task_list_test.py: -------------------------------------------------------------------------------- 1 | """Tests related to theme's task list extension.""" 2 | 3 | from sphinx.testing.util import SphinxTestApp 4 | 5 | index_rst = """ 6 | The Test 7 | ======== 8 | 9 | .. task-list:: 10 | :name: task_list_example 11 | :custom: 12 | 13 | 1. [x] Task A 14 | 2. [ ] Task B 15 | 16 | .. task-list:: 17 | :clickable: 18 | 19 | * [x] Task B1 20 | * [x] Task B2 21 | * [] Task B3 22 | 23 | A rogue paragraph with a reference to 24 | the `parent task_list `. 25 | 26 | - A list item without a checkbox. 27 | - [ ] Another bullet point. 28 | 29 | 3. [ ] Task C 30 | """ 31 | 32 | 33 | def test_task_list(immaterial_make_app): 34 | app: SphinxTestApp = immaterial_make_app( 35 | extra_conf="extensions.append('sphinx_immaterial.task_lists')", 36 | files={"index.rst": index_rst}, 37 | ) 38 | 39 | app.build() 40 | assert not app._warning.getvalue() # type: ignore[attr-defined] 41 | -------------------------------------------------------------------------------- /tests/test_serializable_build.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import TYPE_CHECKING 4 | 5 | import pytest 6 | 7 | if TYPE_CHECKING: 8 | from typing import Callable 9 | 10 | from sphinx.testing.util import SphinxTestApp 11 | 12 | index_rst = """ 13 | The Test 14 | ======== 15 | 16 | .. toctree:: 17 | page 18 | """ 19 | 20 | page_rst = """ 21 | Page 22 | ==== 23 | """ 24 | 25 | 26 | @pytest.mark.parametrize("builder", ["json", "pickle"]) 27 | def test_serializable_build( 28 | builder: str, immaterial_make_app: Callable[..., SphinxTestApp] 29 | ): 30 | app: SphinxTestApp = immaterial_make_app( 31 | files={"index.rst": index_rst, "page.rst": page_rst}, 32 | buildername=builder, 33 | ) 34 | 35 | app.build() 36 | assert not app._warning.getvalue() # type: ignore[attr-defined] 37 | -------------------------------------------------------------------------------- /tests/theme_result_test.py: -------------------------------------------------------------------------------- 1 | """Tests related to theme's theme_result extension.""" 2 | 3 | from sphinx.testing.util import SphinxTestApp 4 | 5 | index_rst = """ 6 | The Test 7 | ======== 8 | 9 | .. rst-example:: 10 | 11 | The directive content to showcase. 12 | 13 | .. rst-example:: A caption 14 | 15 | The directive content to showcase. 16 | 17 | .. rst-example:: 18 | :output-prefix: 19 | 20 | The directive content to showcase. 21 | 22 | .. rst-example:: 23 | :output-prefix: The above code renders the following result: 24 | 25 | The directive content to showcase. 26 | """ 27 | 28 | 29 | def test_theme_result(immaterial_make_app): 30 | app: SphinxTestApp = immaterial_make_app( 31 | extra_conf="extensions.append('sphinx_immaterial.theme_result')", 32 | files={"index.rst": index_rst}, 33 | ) 34 | 35 | app.build() 36 | assert not app._warning.getvalue() # type: ignore[attr-defined] 37 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "alwaysStrict": true, 4 | "baseUrl": "src", 5 | "esModuleInterop": true, 6 | "jsx": "react", 7 | "jsxFactory": "h", 8 | "lib": [ 9 | "dom", 10 | "esnext", 11 | ], 12 | "module": "commonjs", 13 | "moduleResolution": "node", 14 | "noFallthroughCasesInSwitch": true, 15 | "noImplicitAny": true, 16 | "noImplicitReturns": true, 17 | "noImplicitThis": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "paths": { 21 | "~/*": ["./templates/assets/javascripts/*"], 22 | }, 23 | "removeComments": false, 24 | "sourceMap": true, 25 | "skipLibCheck": true, 26 | "strictBindCallApply": true, 27 | "strictFunctionTypes": true, 28 | "strictNullChecks": true, 29 | "strictPropertyInitialization": true, 30 | "stripInternal": true, 31 | "target": "es2018" 32 | }, 33 | "include": [ 34 | "src/templates/assets/javascripts", 35 | "tools", 36 | "typings", 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /typings/google-fonts/index.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | /* ---------------------------------------------------------------------------- 24 | * Global types 25 | * ------------------------------------------------------------------------- */ 26 | 27 | declare module "google-fonts-complete" { 28 | const fonts: Record 29 | export default fonts 30 | } 31 | -------------------------------------------------------------------------------- /typings/mermaid/index.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2025 Martin Donath 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | /* ---------------------------------------------------------------------------- 24 | * Global types 25 | * ------------------------------------------------------------------------- */ 26 | 27 | declare const mermaid: any 28 | 29 | -------------------------------------------------------------------------------- /typings_py/pymdownx/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbms/sphinx-immaterial/f8f746fe2bbc74f6077083074b86aa3a70d877a2/typings_py/pymdownx/__init__.pyi -------------------------------------------------------------------------------- /typings_py/pymdownx/keymap_db.pyi: -------------------------------------------------------------------------------- 1 | """ 2 | This type stub file was generated by pyright. 3 | """ 4 | 5 | from typing import Dict 6 | 7 | keymap: Dict[str, str] = ... 8 | aliases: Dict[str, str] = ... 9 | --------------------------------------------------------------------------------