浏览代码

update documentation

Falko Schindler 2 年之前
父节点
当前提交
dea7a42c7d
共有 2 个文件被更改,包括 19 次插入26 次删除
  1. 16 23
      README.md
  2. 3 3
      nicegui/run.py

+ 16 - 23
README.md

@@ -73,38 +73,30 @@ Full documentation can be found at [https://nicegui.io](https://nicegui.io).
 
 You can call `ui.run()` with optional arguments:
 
-<!-- prettier-ignore-start -->
-<!-- NOTE: to keep explicit underscores `\_` -->
-
 - `host` (default: `'0.0.0.0'`)
 - `port` (default: `8080`)
 - `title` (default: `'NiceGUI'`)
 - `favicon` (default: `'favicon.ico'`)
 - `dark`: whether to use Quasar's dark mode (default: `False`, use `None` for "auto" mode)
-- `reload`: automatically reload the ui on file changes (default: `True`)
+- `main_page_classes`: configure Quasar classes of main page (default: `'q-ma-md column items-start'`)
+- `binding_refresh_interval`: time between binding updates (default: `0.1` seconds, bigger is more cpu friendly)
 - `show`: automatically open the ui in a browser tab (default: `True`)
+- `reload`: automatically reload the ui on file changes (default: `True`)
 - `uvicorn_logging_level`: logging level for uvicorn server (default: `'warning'`)
 - `uvicorn_reload_dirs`: string with comma-separated list for directories to be monitored (default is current working directory only)
 - `uvicorn_reload_includes`: string with comma-separated list of glob-patterns which trigger reload on modification (default: `'.py'`)
 - `uvicorn_reload_excludes`: string with comma-separated list of glob-patterns which should be ignored for reload (default: `'.*, .py[cod], .sw.*, ~*'`)
-- `main_page_classes`: configure Quasar classes of main page (default: `'q-ma-md column items-start'`)
-- `binding_refresh_interval`: time between binding updates (default: `0.1` seconds, bigger is more cpu friendly)
-- `exclude`: comma-separated string to exclude libraries (with corresponding elements) to save bandwidth and/or startup time:
-  - "aggrid" (`ui.table`)
-  - "colors" (`ui.colors`)
-  - "custom\_example" (`ui.custom_example`)
-  - "highcharts" (`ui.chart`)
-  - "interactive\_image" (`ui.interactive_image`)
-  - "keyboard" (`ui.keyboard`)
-  - "log" (`ui.log`)
-  - "matplotlib" (`ui.plot` and `ui.line_plot`)
-  - "nipple" (`ui.joystick`)
-  - "three" (`ui.scene`)
-
-<!-- prettier-ignore-end -->
 
 The environment variables `HOST` and `PORT` can also be used to configure NiceGUI.
 
+To avoid the potentially costly import of Matplotlib, you set the environment variable `MATPLOTLIB=false`.
+This will make `ui.plot` and `ui.line_plot` unavailable.
+
+Note:
+The parameter `exclude` from earlier versions of NiceGUI has been removed.
+Libraries are now automatically served on demand.
+As a small caveat, the page will be reloaded if a new dependency is added dynamically, e.g. when adding a `ui.chart` only after pressing a button.
+
 ## Docker
 
 You can use our [multi-arch Docker image](https://hub.docker.com/repository/docker/zauberzeug/nicegui) for pain-free installation:
@@ -120,12 +112,13 @@ Code modification triggers an automatic reload.
 ## Why?
 
 We like [Streamlit](https://streamlit.io/) but find it does [too much magic when it comes to state handling](https://github.com/zauberzeug/nicegui/issues/1#issuecomment-847413651).
-In search for an alternative nice library to write simple graphical user interfaces in Python we discovered [justpy](https://justpy.io/).
-While too "low-level HTML" for our daily usage it provides a great basis for "NiceGUI".
+In search for an alternative nice library to write simple graphical user interfaces in Python we discovered [JustPy](https://justpy.io/).
+While it is too "low-level HTML" for our daily usage, it provides a great basis for NiceGUI.
 
-## API
+## Documentation and Examples
 
-The API reference is hosted at [https://nicegui.io](https://nicegui.io) and is [implemented with NiceGUI itself](https://github.com/zauberzeug/nicegui/blob/main/main.py).
+The API reference is hosted at [https://nicegui.io](https://nicegui.io).
+It is [implemented with NiceGUI itself](https://github.com/zauberzeug/nicegui/blob/main/main.py).
 You may also have a look at [examples.py](https://github.com/zauberzeug/nicegui/tree/main/examples.py) for more demonstrations of what you can do with NiceGUI.
 
 ## Abstraction

+ 3 - 3
nicegui/run.py

@@ -19,14 +19,14 @@ def run(self, *,
         title: str = 'NiceGUI',
         favicon: str = 'favicon.ico',
         dark: Optional[bool] = False,
-        reload: bool = True,
+        main_page_classes: str = 'q-ma-md column items-start',
+        binding_refresh_interval: float = 0.1,
         show: bool = True,
+        reload: bool = True,
         uvicorn_logging_level: str = 'warning',
         uvicorn_reload_dirs: str = '.',
         uvicorn_reload_includes: str = '*.py',
         uvicorn_reload_excludes: str = '.*, .py[cod], .sw.*, ~*',
-        main_page_classes: str = 'q-ma-md column items-start',
-        binding_refresh_interval: float = 0.1,
         ):
     globals.config = Config(
         host=host,