From 5fe76b80ca8f3fed40dd750c4232af5a7f687dfa Mon Sep 17 00:00:00 2001 From: amitnGiniApps <155542316+amitnGiniApps@users.noreply.github.com> Date: Sun, 27 Apr 2025 15:20:12 +0300 Subject: [PATCH] update sphinx theme (#855) * clean up Sphinx UI by removing header and sidebar * add param description & hide footer --- cli/marketplace/_static/css/custom.css | 12 ++++++++++++ cli/marketplace/build.py | 6 ++++-- cli/marketplace/conf.template | 6 ++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 cli/marketplace/_static/css/custom.css diff --git a/cli/marketplace/_static/css/custom.css b/cli/marketplace/_static/css/custom.css new file mode 100644 index 000000000..a0e9ad337 --- /dev/null +++ b/cli/marketplace/_static/css/custom.css @@ -0,0 +1,12 @@ +.bd-sidebar { + display: none; +} + +.header-article { + height: 0; + background-color: transparent; +} + +.footer-content { + display: none; +} diff --git a/cli/marketplace/build.py b/cli/marketplace/build.py index 3f954c1d8..d6e9cf68b 100644 --- a/cli/marketplace/build.py +++ b/cli/marketplace/build.py @@ -151,7 +151,7 @@ def build_marketplace( sphinx_quickstart(temp_docs, requirements) build_temp_project(source_dir, temp_root) - build_temp_docs(temp_root, temp_docs) + build_temp_docs(temp_root, temp_docs, source_dir) patch_temp_docs(source_dir, temp_docs) if _verbose: @@ -668,7 +668,7 @@ def sphinx_quickstart( click.echo("[Sphinx] Done quickstart") -def build_temp_docs(temp_root, temp_docs): +def build_temp_docs(temp_root, temp_docs, source_dir): """ Look recursively in for Python modules and packages and create one reST file with automodule directives per package in the . The @@ -678,6 +678,7 @@ def build_temp_docs(temp_root, temp_docs): :param temp_root: The project's temporary functions root. :param temp_docs: The project's temporary docs root. + :param source_dir: Path to the source directory to build the marketplace from """ click.echo("[Sphinx] Running autodoc...") @@ -686,6 +687,7 @@ def build_temp_docs(temp_root, temp_docs): sphinx_apidoc_cmd(cmd.split(" ")) + shutil.copytree(source_dir / "cli" / "marketplace" / "_static" / "css", temp_docs / '_static/css') click.echo("[Sphinx] Done autodoc") diff --git a/cli/marketplace/conf.template b/cli/marketplace/conf.template index f78fde1e6..b35bef65e 100644 --- a/cli/marketplace/conf.template +++ b/cli/marketplace/conf.template @@ -84,16 +84,22 @@ html_theme = "sphinx_book_theme" # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] +html_css_files = ["css/custom.css"] html_theme_options = { "repository_url": "{{repository_url}}", "use_repository_button": True, "use_issues_button": True, "use_edit_page_button": True, + "use_repository_button": False, + "use_issues_button": False, + "use_edit_page_button": False, "path_to_docs": "docs", "repository_branch": "{{repository_branch}}", "single_page": True, "navigation_with_keys": False, + "use_download_button": False, + "use_fullscreen_button": False, } html_title = "{{html_title}}"