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:
Ali Abdalla 2022-07-19 06:33:21 +02:00 committed by GitHub
parent 8212c462ae
commit a44f8f7780
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 3 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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...

View File

@ -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>