From c9814f7cdc3d64faa30b19e11be5126cc2ef2bbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Tue, 26 Nov 2024 11:38:17 +0100 Subject: [PATCH] updates Readme and docs --- README.md | 3 +- .../interaction/Auto-generated Frontend.md | 31 ++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aa028ab..27bed64 100644 --- a/README.md +++ b/README.md @@ -219,7 +219,8 @@ For more information, see [Configuring pydase](https://pydase.readthedocs.io/en/ `pydase` allows you to enhance the user experience by customizing the web interface's appearance through 1. a custom CSS file, and -2. tailoring the frontend component layout and display style. +2. a custom favicon image, and +3. tailoring the frontend component layout and display style. You can also provide a custom frontend source if you need even more flexibility. diff --git a/docs/user-guide/interaction/Auto-generated Frontend.md b/docs/user-guide/interaction/Auto-generated Frontend.md index 358b90a..5b79fe6 100644 --- a/docs/user-guide/interaction/Auto-generated Frontend.md +++ b/docs/user-guide/interaction/Auto-generated Frontend.md @@ -21,7 +21,8 @@ The frontend uses a component-based approach, representing various data types an `pydase` allows you to enhance the user experience by customizing the web interface's appearance through 1. a custom CSS file, and -2. tailoring the frontend component layout and display style. +2. a custom favicon image, and +3. tailoring the frontend component layout and display style. For more advanced customization, you can provide a completely custom frontend source. @@ -51,6 +52,34 @@ This will apply the styles defined in `custom.css` to the web interface, allowin Please ensure that the CSS file path is accessible from the server's running location. Relative or absolute paths can be used depending on your setup. + +### Custom favicon image + +You can customize the favicon displayed in the browser tab by providing your own favicon image file during the server initialization. + +Here's how you can use this feature: + +1. Prepare your custom favicon image (e.g. a `.png` file). +2. Pass the path to your favicon file as the `favicon_path` argument when initializing the `Server` class. + +Here’s an example: + +```python +import pydase + + +class MyService(pydase.DataService): + # ... your service definition ... + + +if __name__ == "__main__": + service = MyService() + pydase.Server(service, favicon_path="./my/local/my-favicon.png").run() +``` + +This will serve the specified image instead of the default `pydase` logo. + + ### Tailoring Frontend Component Layout You can customize the display names, visibility, and order of components via the `web_settings.json` file.