1
0
Эх сурвалжийг харах

Merge branch 'main' of github.com:zauberzeug/nicegui

Rodja Trappe 3 жил өмнө
parent
commit
fce8af465a
2 өөрчлөгдсөн 8 нэмэгдсэн , 7 устгасан
  1. 5 3
      README.md
  2. 3 4
      main.py

+ 5 - 3
README.md

@@ -1,13 +1,15 @@
-<img src="https://raw.githubusercontent.com/zauberzeug/nicegui/main/sceenshots/ui-elements.png" width="300" align=right>
+<img src="https://raw.githubusercontent.com/zauberzeug/nicegui/main/sceenshots/ui-elements.png" width="300" align="right">
 
 
 # NiceGUI
 # NiceGUI
 
 
 NiceGUI is an easy-to-use, Python-based UI framework, which renders to the web browser.
 NiceGUI is an easy-to-use, Python-based UI framework, which renders to the web browser.
 You can create buttons, dialogs, markdown, 3D scenes, plots and much more.
 You can create buttons, dialogs, markdown, 3D scenes, plots and much more.
 
 
-It's great for micro web apps, dashboards, robotics projects, smart home solutions and similar use cases.
+It is great for micro web apps, dashboards, robotics projects, smart home solutions and similar use cases.
 You can also use it in development, for example when tweaking/configuring a machine learning algorithm or tuning motor controllers.
 You can also use it in development, for example when tweaking/configuring a machine learning algorithm or tuning motor controllers.
 
 
+NiceGUI is available as [PyPI package](https://pypi.org/project/nicegui/), [Docker image](https://hub.docker.com/r/zauberzeug/nicegui) and on [GitHub](https://github.com/zauberzeug/nicegui).
+
 [![PyPI version](https://badge.fury.io/py/nicegui.svg)](https://pypi.org/project/nicegui/)
 [![PyPI version](https://badge.fury.io/py/nicegui.svg)](https://pypi.org/project/nicegui/)
 [![PyPI - Downloads](https://img.shields.io/pypi/dm/nicegui)](https://pypi.org/project/nicegui/)
 [![PyPI - Downloads](https://img.shields.io/pypi/dm/nicegui)](https://pypi.org/project/nicegui/)
 [![Docker Pulls](https://img.shields.io/docker/pulls/zauberzeug/nicegui)](https://hub.docker.com/r/zauberzeug/nicegui)<br />
 [![Docker Pulls](https://img.shields.io/docker/pulls/zauberzeug/nicegui)](https://hub.docker.com/r/zauberzeug/nicegui)<br />
@@ -69,7 +71,7 @@ Full documentation can be found at [https://nicegui.io](https://nicegui.io).
 
 
 ## Configuration
 ## Configuration
 
 
-You can call `ui.run()` with optional arguments for some high-level configuration:
+You can call `ui.run()` with optional arguments:
 
 
 - `host` (default: `'0.0.0.0'`)
 - `host` (default: `'0.0.0.0'`)
 - `port` (default: `8080`)
 - `port` (default: `8080`)

+ 3 - 4
main.py

@@ -2,7 +2,6 @@
 import asyncio
 import asyncio
 import inspect
 import inspect
 import re
 import re
-import sys
 from contextlib import contextmanager
 from contextlib import contextmanager
 from typing import Callable, Union
 from typing import Callable, Union
 
 
@@ -16,6 +15,9 @@ from nicegui.globals import page_stack
 # add docutils css to webpage
 # add docutils css to webpage
 page_stack[0].head_html += docutils.core.publish_parts('', writer_name='html')['stylesheet']
 page_stack[0].head_html += docutils.core.publish_parts('', writer_name='html')['stylesheet']
 
 
+# avoid display:block for PyPI/Docker/GitHub badges
+page_stack[0].head_html += '<style>p a img {display: inline}</style>'
+
 
 
 @contextmanager
 @contextmanager
 def example(content: Union[Callable, type, str]):
 def example(content: Union[Callable, type, str]):
@@ -329,7 +331,6 @@ with example(async_dialog):
 
 
     ui.button('Await a dialog', on_click=show)
     ui.button('Await a dialog', on_click=show)
 
 
-
 tooltip = '''### Tooltips
 tooltip = '''### Tooltips
 Simply call the `tooltip(text:str)` method on UI elements to provide a tooltip.
 Simply call the `tooltip(text:str)` method on UI elements to provide a tooltip.
 '''
 '''
@@ -430,7 +431,6 @@ with example(binding):
         ui.toggle({1: 'a', 2: 'b', 3: 'c'}).bind_value(demo, 'number')
         ui.toggle({1: 'a', 2: 'b', 3: 'c'}).bind_value(demo, 'number')
         ui.number().bind_value(demo, 'number')
         ui.number().bind_value(demo, 'number')
 
 
-
 with example(ui.timer):
 with example(ui.timer):
     from datetime import datetime
     from datetime import datetime
 
 
@@ -482,7 +482,6 @@ with example(ui.page):
     ui.link('Visit other page', '/other_page')
     ui.link('Visit other page', '/other_page')
     ui.link('Visit dark page', '/dark_page')
     ui.link('Visit dark page', '/dark_page')
 
 
-
 with example(ui.open):
 with example(ui.open):
     with ui.page('/yet_another_page') as other:
     with ui.page('/yet_another_page') as other:
         ui.label('Welcome to yet another page')
         ui.label('Welcome to yet another page')