Updated doc generator
This commit is contained in:
@@ -446,10 +446,86 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 19,
|
||||
"id": "d00cf4b7-773d-49cb-8262-9d11d787ee10",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"=== Generated Docstrings ===\n",
|
||||
"- module: module demo\n",
|
||||
" Adds two numbers together.\n",
|
||||
"\n",
|
||||
"This function takes two numeric inputs and returns their sum.\n",
|
||||
"It supports both integers and floats.\n",
|
||||
"\n",
|
||||
"Args:\n",
|
||||
" x: The firs\n",
|
||||
"- function: def add(x, y):\n",
|
||||
" Returns the sum of two numbers.\n",
|
||||
"\n",
|
||||
"This function takes two numerical inputs and returns their sum. \n",
|
||||
"It supports both integers and floats.\n",
|
||||
"\n",
|
||||
"Args:\n",
|
||||
" x: \n",
|
||||
"- class: class Counter:\n",
|
||||
" A simple counter class to track increments.\n",
|
||||
"\n",
|
||||
"This class provides a method to increment a total count. \n",
|
||||
"The total count starts at zero and increases by\n",
|
||||
"- function: def inc(self):\n",
|
||||
" Increments the total attribute by one.\n",
|
||||
"\n",
|
||||
"This method updates the instance's total value, increasing it by one each time it is called.\n",
|
||||
"\n",
|
||||
"=== Updated Source ===\n",
|
||||
"\"\"\"Adds two numbers together.\n",
|
||||
"\n",
|
||||
"\"\"\"Returns the sum of two numbers.\n",
|
||||
"\n",
|
||||
"This function takes two numerical inputs and returns their sum. \n",
|
||||
"\"\"\"A simple counter class to track increments.\n",
|
||||
"\"\"\"Increments the total attribute by one.\n",
|
||||
"\n",
|
||||
"This method updates the instance's total value, increasing it by one each time it is called.\"\"\"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"This class provides a method to increment a total count. \n",
|
||||
"The total count starts at zero and increases by one with each call to the inc() method.\n",
|
||||
"\n",
|
||||
"Methods:\n",
|
||||
" inc: Increments the total count by one.\"\"\"\n",
|
||||
"\n",
|
||||
"It supports both integers and floats.\n",
|
||||
"\n",
|
||||
"Args:\n",
|
||||
" x: The first number to add.\n",
|
||||
" y: The second number to add.\n",
|
||||
"\n",
|
||||
"Returns:\n",
|
||||
" The sum of x and y.\"\"\"\n",
|
||||
"\n",
|
||||
"This function takes two numeric inputs and returns their sum.\n",
|
||||
"It supports both integers and floats.\n",
|
||||
"\n",
|
||||
"Args:\n",
|
||||
" x: The first number to add.\n",
|
||||
" y: The second number to add.\n",
|
||||
"Returns:\n",
|
||||
" The sum of x and y.\"\"\"\n",
|
||||
"\n",
|
||||
"def add(x, y):\n",
|
||||
" return x + y\n",
|
||||
"\n",
|
||||
"class Counter:\n",
|
||||
" def inc(self):\n",
|
||||
" self.total += 1\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"## Quick Test ##\n",
|
||||
"new_code, report = generate_docstrings_for_source(code, style=\"google\", module_name=\"demo\")\n",
|
||||
@@ -464,7 +540,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 20,
|
||||
"id": "b318db41-c05d-48ce-9990-b6f1a0577c68",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -502,7 +578,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 21,
|
||||
"id": "8962cf0e-9255-475e-bbc1-21500be0cd78",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -540,10 +616,39 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 23,
|
||||
"id": "b0b0f852-982f-4918-9b5d-89880cc12003",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"* Running on local URL: http://127.0.0.1:7866\n",
|
||||
"* To create a public link, set `share=True` in `launch()`.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div><iframe src=\"http://127.0.0.1:7866/\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
|
||||
],
|
||||
"text/plain": [
|
||||
"<IPython.core.display.HTML object>"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/plain": []
|
||||
},
|
||||
"execution_count": 23,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# ================================================================\n",
|
||||
"# 🎨 Enhanced Gradio Interface with Model Selector\n",
|
||||
@@ -586,6 +691,14 @@
|
||||
"\n",
|
||||
"doc_ui.launch(share=False)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "5e6d6720-de8e-4cbb-be9f-82bac3dcc71a",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
Reference in New Issue
Block a user