Update app.py
Browse files
app.py
CHANGED
@@ -257,14 +257,16 @@ def update_output(n_clicks, git_provider, repo_url, guide_type, exclude_folders)
|
|
257 |
guide_text, docx_path, md_path = generate_guide(git_provider, repo_url, guide_type, exclude_folders)
|
258 |
return guide_text
|
259 |
|
260 |
-
guide_text = None
|
261 |
thread = threading.Thread(target=generate_guide_thread)
|
262 |
thread.start()
|
263 |
-
thread.join()
|
|
|
|
|
|
|
264 |
|
265 |
# Convert the guide_text to a format that can be displayed in the Dash app
|
266 |
if guide_text:
|
267 |
-
preview_content =
|
268 |
else:
|
269 |
preview_content = "No content generated."
|
270 |
|
|
|
257 |
guide_text, docx_path, md_path = generate_guide(git_provider, repo_url, guide_type, exclude_folders)
|
258 |
return guide_text
|
259 |
|
|
|
260 |
thread = threading.Thread(target=generate_guide_thread)
|
261 |
thread.start()
|
262 |
+
thread.join() # Wait for the thread to complete
|
263 |
+
|
264 |
+
# Retrieve the generated guide text
|
265 |
+
guide_text = thread.result if hasattr(thread, 'result') else None
|
266 |
|
267 |
# Convert the guide_text to a format that can be displayed in the Dash app
|
268 |
if guide_text:
|
269 |
+
preview_content = dcc.Markdown(guide_text, style={"whiteSpace": "pre-wrap", "wordBreak": "break-word"})
|
270 |
else:
|
271 |
preview_content = "No content generated."
|
272 |
|