Update app.py
Browse files
app.py
CHANGED
@@ -389,6 +389,7 @@ def process_gemini_output(output):
|
|
389 |
- Removes ``` at the top and bottom of the output.
|
390 |
- Removes all pairs of **.
|
391 |
- Replaces ` used as a quote with '.
|
|
|
392 |
|
393 |
Args:
|
394 |
output (str): The raw Gemini output.
|
@@ -406,7 +407,18 @@ def process_gemini_output(output):
|
|
406 |
# Replace ` with '
|
407 |
output = output.replace("`", "'")
|
408 |
|
409 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
|
411 |
def generate_documentation_page():
|
412 |
st.subheader(f"Generate Documentation for {st.session_state.current_project}")
|
|
|
389 |
- Removes ``` at the top and bottom of the output.
|
390 |
- Removes all pairs of **.
|
391 |
- Replaces ` used as a quote with '.
|
392 |
+
- Replaces leading '*' with '-' for lists.
|
393 |
|
394 |
Args:
|
395 |
output (str): The raw Gemini output.
|
|
|
407 |
# Replace ` with '
|
408 |
output = output.replace("`", "'")
|
409 |
|
410 |
+
# Replace leading '*' with '-' for list items
|
411 |
+
lines = output.splitlines()
|
412 |
+
processed_lines = []
|
413 |
+
for line in lines:
|
414 |
+
stripped_line = line.strip()
|
415 |
+
if stripped_line.startswith("*"):
|
416 |
+
# Only replace if the '*' is at the start or followed by whitespace
|
417 |
+
processed_lines.append(line.replace("*", "-", 1))
|
418 |
+
else:
|
419 |
+
processed_lines.append(line)
|
420 |
+
|
421 |
+
return "\n".join(processed_lines)
|
422 |
|
423 |
def generate_documentation_page():
|
424 |
st.subheader(f"Generate Documentation for {st.session_state.current_project}")
|