' + + '' + + _("Hide Search Matches") + + "
" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(SphinxHighlight.highlightSearchWords); +_ready(SphinxHighlight.initEscapeListener); diff --git a/docs/amaranth-soc/v0.1a/conf.py b/docs/amaranth-soc/v0.1a/conf.py new file mode 100644 index 00000000..5e6ef450 --- /dev/null +++ b/docs/amaranth-soc/v0.1a/conf.py @@ -0,0 +1,50 @@ +import os, sys +sys.path.insert(0, os.path.abspath(".")) + +import time +import amaranth_soc + +project = "System on Chip toolkit for Amaranth HDL" +version = amaranth_soc.__version__.replace(".editable", "") +release = version.split("+")[0] +copyright = time.strftime("2020—%Y, Amaranth project contributors") + +extensions = [ + "sphinx.ext.intersphinx", + "sphinx.ext.doctest", + "sphinx.ext.todo", + "sphinx.ext.autodoc", + "sphinx.ext.napoleon", + "sphinx_rtd_theme", +] + +with open(".gitignore") as f: + exclude_patterns = [line.strip() for line in f.readlines()] + +root_doc = "cover" + +intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} + +todo_include_todos = True + +autodoc_member_order = "bysource" +autodoc_default_options = { + "members": True +} +autodoc_preserve_defaults = True + +napoleon_google_docstring = False +napoleon_numpy_docstring = True +napoleon_use_ivar = True +napoleon_include_init_with_doc = True +napoleon_include_special_with_doc = True + +html_theme = "sphinx_rtd_theme" +html_static_path = ["_static"] +html_css_files = ["custom.css"] +html_logo = "_static/logo.png" + +rst_prolog = """ +.. role:: pc(code) + :language: python +""" diff --git a/docs/amaranth-soc/v0.1a/cover.html b/docs/amaranth-soc/v0.1a/cover.html new file mode 100644 index 00000000..64259fff --- /dev/null +++ b/docs/amaranth-soc/v0.1a/cover.html @@ -0,0 +1,120 @@ + + + + + + +Warning
+This manual is a work in progress and is seriously incomplete!
+