From fa1daac93899bfb82d7230ccf6ae4c9eeb7343df Mon Sep 17 00:00:00 2001 From: Zac Zhang Date: Sun, 5 Nov 2023 21:17:17 +0100 Subject: [PATCH 1/8] publish --- docs/_static/compas_icon_white.png | Bin 0 -> 5093 bytes docs/_static/custom.css | 4 ++ docs/conf.py | 94 ++++++++++++++++++----------- 3 files changed, 63 insertions(+), 35 deletions(-) create mode 100644 docs/_static/compas_icon_white.png create mode 100644 docs/_static/custom.css diff --git a/docs/_static/compas_icon_white.png b/docs/_static/compas_icon_white.png new file mode 100644 index 0000000000000000000000000000000000000000..2c905bff94efbe31e531480ac97d9f437b5fe780 GIT binary patch literal 5093 zcmV|JeWme(0RzJ69|lErE_Yr5E2x0w2!%nUBMKYp7`z#kgxS`}Oxi82CQX`E>ui!*tF!8!>+wAD`sO+J z`FOt0`*FiVGH{7&zX1Y)-6`3R@HSP?fj_bN1bz2@MD9<$BaA282@+1 zIi{Us2*#Lbp{M!7uhV?+rZ&R?0dU|l=6F~9;6kHp$ILEF$X64h)(ajlTx&#VyFaQYc z&hho2pH;v5ws+aIy3GAqws--nUAav7`pKDVY-0AR`|sgTK4-JnZa6a#mHggsm=H9O^j^OwO?33!k$Q2Q2va z&my(8y!0n)+U%5>3!g69?>z8X|s4>z!T<0`hJcBOSd z5ZN(@IeHy{9RJ{wj^=1}fYDQQpx~~eO_de)Jif|x5&3G+9lgWn+5S^gs_cP$M@tee zC3aA7cEBi*W*nQ>uVni+Js7%BOwyn~_P;Zw3XU1BHM$EH6sqh1X6Q&iR8U|D2#&*? zHKq#&6gswuUxi>ZCiI=?B{`S7T`ecLt=ZQb|;a7f`^*jRNeuZ#;(SPV|Nvx z?XH0dcckXp{M0=5SYM) zGhE2q2?`k?+8Wll7n)Qy@>g$;8@&%ef*?)8nrm0GqdV(dcN-TlQgHwR7X-v7p&zoN z42*hHd-biU#LgY8dVJ?b*X_muj8q(efQkp=leE8`yA>`ruaaSRm&*P2SC8~Y+S|W1$cjYO+~&jMw|1T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4>P2XE;lCM;&J7B`AV|1BRqeZsG^q zSE7v{EK=(L1@1=GyqRB&+MNL$Dtc?X2N2ZbPV@s5UsK#=hc z8+Ag_fx-tQ$e7}&=0E|nYzX0_ArLY0hrFLj=ML literal 0 HcmV?d00001 diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 000000000..6a4307952 --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,4 @@ +/* This will apply to the main content area */ +.bd-content { + min-width: 800px; +} diff --git a/docs/conf.py b/docs/conf.py index ed9e876fe..7fd563b0f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,7 +13,7 @@ import sphinx_compas_theme from sphinx.ext.napoleon.docstring import NumpyDocstring -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../src')) +sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../src")) # -- General configuration ------------------------------------------------ @@ -24,14 +24,16 @@ version = ".".join(release.split(".")[0:2]) master_doc = "index" -source_suffix = [".rst", ] +source_suffix = [ + ".rst", +] templates_path = sphinx_compas_theme.get_autosummary_templates_path() exclude_patterns = [] -pygments_style = "sphinx" -show_authors = True +pygments_style = "sphinx" +show_authors = True add_module_names = True -language = 'en' +language = "en" # -- Extension configuration ------------------------------------------------ @@ -68,14 +70,17 @@ autoclass_content = "class" + def skip(app, what, name, obj, would_skip, options): - if name.startswith('_'): + if name.startswith("_"): return True return would_skip + def setup(app): app.connect("autodoc-skip-member", skip) + # autosummary options autosummary_generate = True @@ -101,15 +106,19 @@ def setup(app): # docstring sections + def parse_attributes_section(self, section): return self._format_fields("Attributes", self._consume_fields()) + NumpyDocstring._parse_attributes_section = parse_attributes_section + def patched_parse(self): self._sections["attributes"] = self._parse_attributes_section self._unpatched_parse() + NumpyDocstring._unpatched_parse = NumpyDocstring._parse NumpyDocstring._parse = patched_parse @@ -122,31 +131,32 @@ def patched_parse(self): # linkcode + def linkcode_resolve(domain, info): - if domain != 'py': + if domain != "py": return None - if not info['module']: + if not info["module"]: return None - if not info['fullname']: + if not info["fullname"]: return None - package = info['module'].split('.')[0] - if not package.startswith('compas_view2'): + package = info["module"].split(".")[0] + if not package.startswith("compas_view2"): return None - module = importlib.import_module(info['module']) - parts = info['fullname'].split('.') + module = importlib.import_module(info["module"]) + parts = info["fullname"].split(".") if len(parts) == 1: - obj = getattr(module, info['fullname']) - filename = inspect.getmodule(obj).__name__.replace('.', '/') + obj = getattr(module, info["fullname"]) + filename = inspect.getmodule(obj).__name__.replace(".", "/") lineno = inspect.getsourcelines(obj)[1] elif len(parts) == 2: obj_name, attr_name = parts obj = getattr(module, obj_name) attr = getattr(obj, attr_name) if inspect.isfunction(attr): - filename = inspect.getmodule(obj).__name__.replace('.', '/') + filename = inspect.getmodule(obj).__name__.replace(".", "/") lineno = inspect.getsourcelines(attr)[1] else: return None @@ -155,32 +165,46 @@ def linkcode_resolve(domain, info): return f"https://github.com/compas-dev/compas_view2/blob/master/src/{filename}.py#L{lineno}" + # extlinks extlinks = {} # -- Options for HTML output ---------------------------------------------- -html_theme = "compaspkg" -html_theme_path = sphinx_compas_theme.get_html_theme_path() +html_theme = "sphinx_book_theme" +# html_theme_path = sphinx_compas_theme.get_html_theme_path() html_theme_options = { - "package_name" : "compas_view2", - "package_title" : project, - "package_version" : release, - "package_author" : "compas-dev", - "package_docs" : "https://compas.dev/compas_view2/", - "package_repo" : "https://github.com/compas-dev/compas_view2", - "package_old_versions_txt": "https://compas.dev/compas_view2/doc_versions.txt" + "repository_url": "https://github.com/compas-dev/compas_view2", + # "package_name": "compas_view2", + # "package_title": project, + # "package_version": release, + # "package_author": "compas-dev", + # "package_docs": "https://compas.dev/compas_view2/", + # "package_repo": "https://github.com/compas-dev/compas_view2", + # "package_old_versions_txt": "https://compas.dev/compas_view2/doc_versions.txt", + "use_repository_button": True, + "logo": { + "image_light": "compas_icon_white.png", # relative to parent of conf.py + "image_dark": "compas_icon_white.png", # relative to parent of conf.py + "text": "COMPAS VIEW2 docs", + }, } -html_context = {} -html_static_path = sphinx_compas_theme.get_html_static_path() -html_extra_path = [] -html_last_updated_fmt = "" -html_copy_source = False -html_show_sourcelink = False -html_permalinks = False -html_permalinks_icon = "" -html_experimental_html5_writer = False -html_compact_lists = True +# html_context = {} +# html_static_path = sphinx_compas_theme.get_html_static_path() +# html_extra_path = [] +# html_last_updated_fmt = "" +# html_copy_source = False +# html_show_sourcelink = False +# html_permalinks = False +# html_permalinks_icon = "" +# html_experimental_html5_writer = False +# html_compact_lists = True + +html_static_path = ["_static"] + +html_css_files = [ + "custom.css", +] From 51e4c8d459b152a80ad00fbfbb2903c2ccbed72a Mon Sep 17 00:00:00 2001 From: Zac Zhang Date: Sun, 5 Nov 2023 21:27:48 +0100 Subject: [PATCH 2/8] update --- CHANGELOG.md | 2 +- docs/api/compas_view2.forms.rst | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba7c68dbd..a9453df29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * All the examples are categorized into different folders. ### Changed - +* Using `Sphinx Book Theme` for documentation generation. * Changed the language settings in the `config.py` file for better `invoke docs` generation. * Remove `modindex` in the index page of the documentation as the file no longer exists. * Changed `sphinx` requirement for the development environment. Otherwise, there will be a bug similar to [this](https://github.com/compas-dev/sphinx_compas_theme/issues/20). diff --git a/docs/api/compas_view2.forms.rst b/docs/api/compas_view2.forms.rst index 1664157af..487151a11 100644 --- a/docs/api/compas_view2.forms.rst +++ b/docs/api/compas_view2.forms.rst @@ -12,10 +12,6 @@ Classes :nosignatures: Form - EditForm + PropertyForm AddForm - PointForm - LineForm - SphereForm - TorusForm - PointEditForm + From 9c6febc2b2ef126847572fb04d52572fe4bb7a11 Mon Sep 17 00:00:00 2001 From: Zac Zhang Date: Sat, 16 Dec 2023 17:14:23 +0100 Subject: [PATCH 3/8] Update Sphinx configuration and requirements --- docs/conf.py | 242 +++++++++++++++++-------------------------- requirements-dev.txt | 14 +-- 2 files changed, 97 insertions(+), 159 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index c55c92a6e..d83a672fd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,126 +1,79 @@ # flake8: noqa # -*- coding: utf-8 -*- -# If your documentation needs a minimal Sphinx version, state it here. -# -# needs_sphinx = "1.0" - -import sys -import os -import inspect -import importlib - -import sphinx_compas_theme -from sphinx.ext.napoleon.docstring import NumpyDocstring - -sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../src")) +import sphinx_compas2_theme +from sphinx.writers import html +from sphinx.writers import html5 # -- General configuration ------------------------------------------------ project = "COMPAS View2" -copyright = "Block Research Group - ETH Zurich" +copyright = "COMPAS Association" author = "tom van mele" -release = "0.10.1" -version = ".".join(release.split(".")[0:2]) +organization = "compas-dev" +package = "compas_view2" master_doc = "index" -source_suffix = [ - ".rst", -] -templates_path = sphinx_compas_theme.get_autosummary_templates_path() -exclude_patterns = [] - -pygments_style = "sphinx" -show_authors = True -add_module_names = True +source_suffix = {".rst": "restructuredtext", ".md": "markdown"} +templates_path = sphinx_compas2_theme.get_autosummary_templates_path() +exclude_patterns = sphinx_compas2_theme.default_exclude_patterns +add_module_names = False language = "en" +latest_version = sphinx_compas2_theme.get_latest_version() + +if latest_version == "Unreleased": + release = "Unreleased" + version = "latest" +else: + release = latest_version + version = ".".join(release.split(".")[0:2]) # type: ignore # -- Extension configuration ------------------------------------------------ -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.doctest", - "sphinx.ext.coverage", - "sphinx.ext.linkcode", - "sphinx.ext.extlinks", - "sphinx.ext.intersphinx", - "sphinx.ext.mathjax", - "sphinx.ext.napoleon", - "sphinx.ext.githubpages", - "matplotlib.sphinxext.plot_directive", -] +extensions = sphinx_compas2_theme.default_extensions + +# numpydoc options + +numpydoc_show_class_members = False +numpydoc_class_members_toctree = False +numpydoc_attributes_as_param_list = True + +# bibtex options # autodoc options autodoc_type_aliases = {} - -# this does not work properly yet -autodoc_typehints = "none" -autodoc_typehints_format = "short" autodoc_typehints_description_target = "documented" - +autodoc_mock_imports = sphinx_compas2_theme.default_mock_imports autodoc_default_options = { "undoc-members": True, "show-inheritance": True, } - -autodoc_member_order = "alphabetical" +autodoc_member_order = "groupwise" +autodoc_typehints = "description" +autodoc_class_signature = "separated" autoclass_content = "class" -def skip(app, what, name, obj, would_skip, options): - if name.startswith("_"): - return True - return would_skip - - def setup(app): - app.connect("autodoc-skip-member", skip) + app.connect("autodoc-skip-member", sphinx_compas2_theme.skip) # autosummary options autosummary_generate = True +autosummary_mock_imports = sphinx_compas2_theme.default_mock_imports -# napoleon options - -napoleon_google_docstring = False -napoleon_numpy_docstring = True -napoleon_include_init_with_doc = False -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = False -napoleon_use_rtype = False +# graph options # plot options +plot_include_source = False plot_html_show_source_link = False plot_html_show_formats = False - -# docstring sections - - -def parse_attributes_section(self, section): - return self._format_fields("Attributes", self._consume_fields()) - - -NumpyDocstring._parse_attributes_section = parse_attributes_section - - -def patched_parse(self): - self._sections["attributes"] = self._parse_attributes_section - self._unpatched_parse() - - -NumpyDocstring._unpatched_parse = NumpyDocstring._parse -NumpyDocstring._parse = patched_parse +plot_formats = ["png"] # intersphinx options @@ -131,80 +84,75 @@ def patched_parse(self): # linkcode - -def linkcode_resolve(domain, info): - if domain != "py": - return None - if not info["module"]: - return None - if not info["fullname"]: - return None - - package = info["module"].split(".")[0] - if not package.startswith("compas_view2"): - return None - - module = importlib.import_module(info["module"]) - parts = info["fullname"].split(".") - - if len(parts) == 1: - obj = getattr(module, info["fullname"]) - filename = inspect.getmodule(obj).__name__.replace(".", "/") - lineno = inspect.getsourcelines(obj)[1] - elif len(parts) == 2: - obj_name, attr_name = parts - obj = getattr(module, obj_name) - attr = getattr(obj, attr_name) - if inspect.isfunction(attr): - filename = inspect.getmodule(obj).__name__.replace(".", "/") - lineno = inspect.getsourcelines(attr)[1] - else: - return None - else: - return None - - return f"https://github.com/compas-dev/compas_view2/blob/master/src/{filename}.py#L{lineno}" - +linkcode_resolve = sphinx_compas2_theme.get_linkcode_resolve(organization, package) # extlinks extlinks = {} +# from pytorch + +sphinx_compas2_theme.replace(html.HTMLTranslator) +sphinx_compas2_theme.replace(html5.HTML5Translator) + # -- Options for HTML output ---------------------------------------------- -html_theme = "sphinx_book_theme" -# html_theme_path = sphinx_compas_theme.get_html_theme_path() +html_theme = "sidebaronly" +html_title = project + +favicons = [ + { + "rel": "icon", + "href": "compas.ico", # relative to the static path + } +] html_theme_options = { - "repository_url": "https://github.com/compas-dev/compas_view2", - # "package_name": "compas_view2", - # "package_title": project, - # "package_version": release, - # "package_author": "compas-dev", - # "package_docs": "https://compas.dev/compas_view2/", - # "package_repo": "https://github.com/compas-dev/compas_view2", - # "package_old_versions_txt": "https://compas.dev/compas_view2/doc_versions.txt", - "use_repository_button": True, + "icon_links": [ + { + "name": "GitHub", + "url": f"https://github.com/{organization}/{package}", + "icon": "fa-brands fa-github", + "type": "fontawesome", + }, + { + "name": "Discourse", + "url": "http://forum.compas-framework.org/", + "icon": "fa-brands fa-discourse", + "type": "fontawesome", + }, + { + "name": "PyPI", + "url": f"https://pypi.org/project/{package}/", + "icon": "fa-brands fa-python", + "type": "fontawesome", + }, + ], + "switcher": { + "json_url": f"https://raw.githubusercontent.com/{organization}/{package}/gh-pages/versions.json", + "version_match": version, + }, "logo": { - "image_light": "compas_icon_white.png", # relative to parent of conf.py - "image_dark": "compas_icon_white.png", # relative to parent of conf.py - "text": "COMPAS VIEW2 docs", + "image_light": "_static/compas_icon_white.png", # relative to parent of conf.py + "image_dark": "_static/compas_icon_white.png", # relative to parent of conf.py + "text": project, }, } -# html_context = {} -# html_static_path = sphinx_compas_theme.get_html_static_path() -# html_extra_path = [] -# html_last_updated_fmt = "" -# html_copy_source = False -# html_show_sourcelink = False -# html_permalinks = False -# html_permalinks_icon = "" -# html_experimental_html5_writer = False -# html_compact_lists = True - -html_static_path = ["_static"] - -html_css_files = [ - "custom.css", -] +html_context = { + "github_url": "https://github.com", + "github_user": organization, + "github_repo": package, + "github_version": "main", + "doc_path": "docs", +} + +html_static_path = sphinx_compas2_theme.get_html_static_path() + ["_static"] +html_css_files = [] +html_extra_path = [] +html_last_updated_fmt = "" +html_copy_source = False +html_show_sourcelink = True +html_permalinks = False +html_permalinks_icon = "" +html_compact_lists = True diff --git a/requirements-dev.txt b/requirements-dev.txt index fb68440e6..164431b69 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,23 +1,13 @@ attrs >=17.4 -black +black ==22.12.0 bump2version >=1.0.1 check-manifest >=0.36 compas_invocations doc8 flake8 -graphviz -importlib_metadata <5.0 invoke >=0.14 -ipykernel -ipython >=5.8 isort -jinja2 >= 3.0 -m2r2 -nbsphinx -pydocstyle -pytest -sphinx == 7.1.2 -sphinx_compas_theme >=0.15.18 +sphinx_compas2_theme twine wheel -e . From 11fbbc1c0f4b8aeb0bf1c5a7966cbbb1f7a6ce02 Mon Sep 17 00:00:00 2001 From: Zac Zhang Date: Sat, 16 Dec 2023 18:25:09 +0100 Subject: [PATCH 4/8] Fix the title lines --- docs/examples/control/example_custom_keys.rst | 4 ++-- docs/tutorials/tutorial_basics.rst | 2 +- docs/tutorials/tutorial_configuration.rst | 6 +++--- docs/tutorials/tutorial_software_concepts.rst | 6 +++--- src/compas_view2/app/controller.py | 12 ++++++------ 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/examples/control/example_custom_keys.rst b/docs/examples/control/example_custom_keys.rst index bd323d801..d3563402d 100644 --- a/docs/examples/control/example_custom_keys.rst +++ b/docs/examples/control/example_custom_keys.rst @@ -7,7 +7,7 @@ Custom Keys :nosignatures: Default Keys -=========== +============= By default, the keys are like: @@ -18,7 +18,7 @@ By default, the keys are like: Custom Keys -=========== +============= You can customize the keys by modifying the ``keys`` parameter of the configuration. diff --git a/docs/tutorials/tutorial_basics.rst b/docs/tutorials/tutorial_basics.rst index 7e5ac390d..184a0e995 100644 --- a/docs/tutorials/tutorial_basics.rst +++ b/docs/tutorials/tutorial_basics.rst @@ -189,7 +189,7 @@ use the "on" decorator (:meth:`compas_view2.app.App.on`) on a callback function. Zoom, Pan, Rotate, and Select -================= +=========================== After launching the viewer, the view can be transformed by zooming, panning, and rotating. Object selection is also possible. diff --git a/docs/tutorials/tutorial_configuration.rst b/docs/tutorials/tutorial_configuration.rst index 3326b5f56..0fca4f3e3 100644 --- a/docs/tutorials/tutorial_configuration.rst +++ b/docs/tutorials/tutorial_configuration.rst @@ -25,7 +25,7 @@ Thinking of the ``options`` in :mod:`Rhino` , the ``preferences..`` in :mod:`Ble Customize Your Viewer -=================== +===================== There are two ways to customize your viewer: @@ -65,7 +65,7 @@ This is a quick way to customize your viewer. It is suitable for task-specific c Configuration Structure -==================== +======================================== The default configuration file can be downloaded here: :download:`Link `, or can be printed by the following code: @@ -78,7 +78,7 @@ or can be printed by the following code: It it the template for creating your own settings, keyboard preferences, etc. Supported Keys -=============== +=================== In the `controller -> keys`, you can add you preferred keys. Currently, :mod:`compas_view2` supports below keys: .. figure:: /_images/keyboard.png diff --git a/docs/tutorials/tutorial_software_concepts.rst b/docs/tutorials/tutorial_software_concepts.rst index f85341b24..8e8c89000 100644 --- a/docs/tutorials/tutorial_software_concepts.rst +++ b/docs/tutorials/tutorial_software_concepts.rst @@ -25,7 +25,7 @@ to help you better the design concepts behind it. Software Architecture -=========== +====================== .. figure:: /_images/software_concept.png :figclass: figure @@ -33,13 +33,13 @@ Software Architecture UI Components -=========== +=============== .. figure:: /_images/UI.PNG :figclass: figure :class: figure-img img-fluid Configuration Structure -=========== +=========================== .. figure:: /_images/config_structure.png :figclass: figure :class: figure-img img-fluid diff --git a/src/compas_view2/app/controller.py b/src/compas_view2/app/controller.py index ac847ce5a..5b5fa6f63 100644 --- a/src/compas_view2/app/controller.py +++ b/src/compas_view2/app/controller.py @@ -123,13 +123,13 @@ def mouse_key_check(self, event, key_status: Dict, mouse_key: Dict): The dictionary that is like `"mouse_key": { "mouse": "right", "key": "shift" }`. Returns - ---------- + ------- bool: If the mouse key is happening. Notes - ---------- + ----- This function is designed to check mouse_key combine interactions. The interactions are: "box_selection", "selection", "multi_selection", "deselect", "pan", "rotate", for now. """ @@ -166,7 +166,7 @@ def mouse_check(self, event, button_name: str): The name of the button. It should be exist in the list of `supported buttons`. Returns - ---------- + ------- bool: If the button is pressed. """ @@ -197,7 +197,7 @@ def key_check(self, event, key_status: Dict, key_name: str): The name of the key. It should be exist in the list of `supported keys`. Returns - ---------- + ------- bool: If the key is pressed. """ @@ -224,7 +224,7 @@ def keys_pressed_check(self, action, event): event : QKeyEvent Returns - ---------- + ------- bool: If all the keys are pressed. """ @@ -247,7 +247,7 @@ def keys_released_check(self, action, event): event : QKeyEvent Returns - ---------- + ------- bool: If all the keys are released. """ From 46db8337db38e02fd7d09a79838a1a558f12f222 Mon Sep 17 00:00:00 2001 From: Zac Zhang Date: Sat, 16 Dec 2023 18:29:22 +0100 Subject: [PATCH 5/8] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d03cd931d..7df90f9dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +* Doc building using `sphinx_compas2_theme `. +* Fix the documentation: title lines, comments. * Fix a bug when camera is looking straight up or down. ### Removed From 722b81dd0b055ee0f3d7a994c449824dfb581484 Mon Sep 17 00:00:00 2001 From: Zac Zhang Date: Sat, 16 Dec 2023 18:35:22 +0100 Subject: [PATCH 6/8] patch --- docs/tutorials/tutorial_basics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorials/tutorial_basics.rst b/docs/tutorials/tutorial_basics.rst index 184a0e995..640321906 100644 --- a/docs/tutorials/tutorial_basics.rst +++ b/docs/tutorials/tutorial_basics.rst @@ -189,7 +189,7 @@ use the "on" decorator (:meth:`compas_view2.app.App.on`) on a callback function. Zoom, Pan, Rotate, and Select -=========================== +=============================== After launching the viewer, the view can be transformed by zooming, panning, and rotating. Object selection is also possible. From fa167768ca3a7653f21fb293a9e7c557e66cf6be Mon Sep 17 00:00:00 2001 From: Zac Zhang Date: Sun, 17 Dec 2023 10:57:35 +0100 Subject: [PATCH 7/8] custom.css and `: after bool` --- docs/_static/custom.css | 4 ---- src/compas_view2/app/controller.py | 10 +++++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/_static/custom.css b/docs/_static/custom.css index 6a4307952..e69de29bb 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -1,4 +0,0 @@ -/* This will apply to the main content area */ -.bd-content { - min-width: 800px; -} diff --git a/src/compas_view2/app/controller.py b/src/compas_view2/app/controller.py index 5b5fa6f63..7203d4984 100644 --- a/src/compas_view2/app/controller.py +++ b/src/compas_view2/app/controller.py @@ -124,7 +124,7 @@ def mouse_key_check(self, event, key_status: Dict, mouse_key: Dict): Returns ------- - bool: + bool If the mouse key is happening. @@ -167,7 +167,7 @@ def mouse_check(self, event, button_name: str): Returns ------- - bool: + bool If the button is pressed. """ supported_buttons = { @@ -198,7 +198,7 @@ def key_check(self, event, key_status: Dict, key_name: str): Returns ------- - bool: + bool If the key is pressed. """ @@ -225,7 +225,7 @@ def keys_pressed_check(self, action, event): Returns ------- - bool: + bool If all the keys are pressed. """ for key in self.keys[action]: @@ -248,7 +248,7 @@ def keys_released_check(self, action, event): Returns ------- - bool: + bool If all the keys are released. """ for key in self.keys[action]: From 9a1673c842c6f65b87f00efb896dd7ca764b62ac Mon Sep 17 00:00:00 2001 From: Zac Zhang Date: Sun, 17 Dec 2023 11:07:19 +0100 Subject: [PATCH 8/8] Delete unused image and CSS file --- docs/_static/compas_icon_white.png | Bin 5093 -> 0 bytes docs/_static/custom.css | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 docs/_static/compas_icon_white.png delete mode 100644 docs/_static/custom.css diff --git a/docs/_static/compas_icon_white.png b/docs/_static/compas_icon_white.png deleted file mode 100644 index 2c905bff94efbe31e531480ac97d9f437b5fe780..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5093 zcmV|JeWme(0RzJ69|lErE_Yr5E2x0w2!%nUBMKYp7`z#kgxS`}Oxi82CQX`E>ui!*tF!8!>+wAD`sO+J z`FOt0`*FiVGH{7&zX1Y)-6`3R@HSP?fj_bN1bz2@MD9<$BaA282@+1 zIi{Us2*#Lbp{M!7uhV?+rZ&R?0dU|l=6F~9;6kHp$ILEF$X64h)(ajlTx&#VyFaQYc z&hho2pH;v5ws+aIy3GAqws--nUAav7`pKDVY-0AR`|sgTK4-JnZa6a#mHggsm=H9O^j^OwO?33!k$Q2Q2va z&my(8y!0n)+U%5>3!g69?>z8X|s4>z!T<0`hJcBOSd z5ZN(@IeHy{9RJ{wj^=1}fYDQQpx~~eO_de)Jif|x5&3G+9lgWn+5S^gs_cP$M@tee zC3aA7cEBi*W*nQ>uVni+Js7%BOwyn~_P;Zw3XU1BHM$EH6sqh1X6Q&iR8U|D2#&*? zHKq#&6gswuUxi>ZCiI=?B{`S7T`ecLt=ZQb|;a7f`^*jRNeuZ#;(SPV|Nvx z?XH0dcckXp{M0=5SYM) zGhE2q2?`k?+8Wll7n)Qy@>g$;8@&%ef*?)8nrm0GqdV(dcN-TlQgHwR7X-v7p&zoN z42*hHd-biU#LgY8dVJ?b*X_muj8q(efQkp=leE8`yA>`ruaaSRm&*P2SC8~Y+S|W1$cjYO+~&jMw|1Tn&M;%VJ)Mh;UVh) z;n`EG&Da8I@0T}MTkA@Q5Ml!r(<%AoA$->qTu4CrF#V_&seW9;Ad zh$xRy&IfRGpx`>fcRmC%l}Y9yRO~OK7nw;`|KvxrR$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