mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-07 11:46:51 +08:00
Miscellaneous formatting improvements to website (#1754)
* remove required tag from kwargs * placeholder for missing docstrings * fix alignment issues in reload guide * added documentation * added doc to column Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
This commit is contained in:
parent
8212c462ae
commit
a44f8f7780
@ -162,6 +162,11 @@ class BlockContext(Block):
|
||||
render: bool = True,
|
||||
**kwargs,
|
||||
):
|
||||
"""
|
||||
Parameters:
|
||||
visible: If False, this will be hidden but included in the Blocks config file (its visibility can later be updated).
|
||||
render: If False, this will not be included in the Blocks config file at all.
|
||||
"""
|
||||
self.children = []
|
||||
super().__init__(visible=visible, render=render, **kwargs)
|
||||
|
||||
|
@ -74,6 +74,8 @@ def document_fn(fn):
|
||||
if type(default) == str:
|
||||
default = '"' + default + '"'
|
||||
parameter_doc["default"] = default
|
||||
elif parameter_doc["doc"] is not None and "kwargs" in parameter_doc["doc"]:
|
||||
parameter_doc["kwargs"] = True
|
||||
parameter_docs.append(parameter_doc)
|
||||
assert (
|
||||
len(parameters) == 0
|
||||
|
@ -85,7 +85,9 @@ class Column(BlockContext):
|
||||
variant: str = "default",
|
||||
):
|
||||
"""
|
||||
variant: column type, 'default' (no background) or 'panel' (gray background color and rounded corners)
|
||||
Parameters:
|
||||
visible: If False, column will be hidden but included in the Blocks config file (its visibility can later be updated).
|
||||
variant: column type, 'default' (no background) or 'panel' (gray background color and rounded corners)
|
||||
"""
|
||||
self.variant = variant
|
||||
super().__init__(visible=visible)
|
||||
|
@ -40,7 +40,7 @@ In the terminal, run `gradio app.py`. That's it!
|
||||
|
||||
Now, you'll see that after you'll see something like this:
|
||||
|
||||
```
|
||||
```bash
|
||||
Launching in *reload mode* on: http://127.0.0.1:7860 (Press CTRL+C to quit)
|
||||
|
||||
Watching...
|
||||
|
@ -72,7 +72,7 @@
|
||||
<p class="text-gray-500 italic">{{ param["annotation"] }}</p>
|
||||
{% if "default" in param %}
|
||||
<p class="text-gray-500 font-semibold">default: {{ param["default"] }}</p>
|
||||
{% else %}
|
||||
{% elif "kwargs" not in param %}
|
||||
<p class="text-orange-600 font-semibold italic">required</p>
|
||||
{% endif %}
|
||||
</td>
|
||||
|
Loading…
Reference in New Issue
Block a user