From e7cc559f88f0d285bf25e6e290e18a66f236b61a Mon Sep 17 00:00:00 2001 From: Jean-Marc Couffin Date: Mon, 23 Oct 2023 10:44:38 +0200 Subject: [PATCH] fixed some docs and added some html love to the docs --- docs/styles.css | 13 +++++++++++++ mkdocs.yml | 16 ++++++++++++---- pyrevitlib/pyrevit/forms/__init__.py | 2 +- pyrevitlib/pyrevit/revit/ui.py | 10 ++++------ 4 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 docs/styles.css diff --git a/docs/styles.css b/docs/styles.css new file mode 100644 index 000000000..b26cdd665 --- /dev/null +++ b/docs/styles.css @@ -0,0 +1,13 @@ +h1 { + font-weight: bolder; + font-size: 2rem; +} +h2 { + font-weight: bold; + font-size: 1.5rem; +} + +h3 { + font-weight: bold; + font-size: 1rem; +} diff --git a/mkdocs.yml b/mkdocs.yml index dfe4cde4e..077a869cd 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,15 +11,23 @@ theme: features: - content.code.select - content.code.copy + - toc.follow + - navigation.top + - navigation.path + - navigation.expand + - navigation.tabs + - navigation.tabs.sticky + - navigation.tracking + - navigation.instant + - navigation.instant.prefetch + - navigation.sections palette: - # Palette toggle for light mode - media: "(prefers-color-scheme: light)" scheme: default toggle: icon: material/brightness-7 name: Switch to dark mode - # Palette toggle for dark mode - media: "(prefers-color-scheme: dark)" scheme: slate @@ -28,7 +36,7 @@ theme: name: Switch to light mode extra_css: - - style.css + - docs/style.css watch: - pyrevitlib/pyrevit @@ -70,8 +78,8 @@ markdown_extensions: - pymdownx.superfences - pymdownx.caret - pymdownx.keys + - pymdownx.highlight - admonition - - codehilite - md_in_html - toc diff --git a/pyrevitlib/pyrevit/forms/__init__.py b/pyrevitlib/pyrevit/forms/__init__.py index 8197dac0e..d6ab374c6 100644 --- a/pyrevitlib/pyrevit/forms/__init__.py +++ b/pyrevitlib/pyrevit/forms/__init__.py @@ -2808,7 +2808,7 @@ def select_family_parameters(family_doc, def alert(msg, title=None, sub_msg=None, expanded=None, footer='', ok=True, cancel=False, yes=False, no=False, retry=False, warn_icon=True, options=None, exitscript=False): - """Show a task dialog with given message. + r"""Show a task dialog with given message. Args: msg (str): message to be displayed diff --git a/pyrevitlib/pyrevit/revit/ui.py b/pyrevitlib/pyrevit/revit/ui.py index e015ef509..24e3628eb 100644 --- a/pyrevitlib/pyrevit/revit/ui.py +++ b/pyrevitlib/pyrevit/revit/ui.py @@ -125,17 +125,16 @@ def get_ribbon_roottype(): def get_current_theme(): - """ - Get the current UI theme. + """Get the current UI theme. Returns: UITheme: The current UI theme. """ return UIThemeManager.CurrentTheme + def set_current_theme(theme='Dark'): - """ - Sets the current UI theme to either 'Dark' or 'Light'. + """Sets the current UI theme to either 'Dark' or 'Light'. Args: theme (str, optional): The theme to set. Defaults to 'Dark'. @@ -150,8 +149,7 @@ def set_current_theme(theme='Dark'): def resolve_icon_file(directory, icon_name): - """ - Resolves the icon file path based on the current UI theme. + """Resolves the icon file path based on the current UI theme. Args: directory (str): The directory where the icon file is located.