refactor: update markdown handling in search page UI
This commit is contained in:
@@ -138,7 +138,7 @@ def search_page() -> None: # build UI
|
||||
except Exception as e:
|
||||
status.set_text(status.text + f' Copy failed: {e}')
|
||||
|
||||
md.set_markdown(format_result_md(results))
|
||||
md.set_content(format_result_md(results))
|
||||
|
||||
ui.button('Run search', on_click=lambda: asyncio.create_task(run_search_handler()))
|
||||
|
||||
@@ -201,7 +201,7 @@ def search_page() -> None: # build UI
|
||||
dtm_log = ui.markdown('')
|
||||
|
||||
async def run_dtm_handler():
|
||||
run_conv_button.set_disabled(True)
|
||||
run_conv_button.set_enabled(False)
|
||||
dtm_status.set_text('Starting conversion...')
|
||||
|
||||
argv = []
|
||||
@@ -252,12 +252,12 @@ def search_page() -> None: # build UI
|
||||
try:
|
||||
code = await anyio.to_thread.run_sync(run_main)
|
||||
dtm_status.set_text(f'document_to_markdown finished with exit code {code}')
|
||||
dtm_log.set_markdown(f'Last run exit code: {code}\n\nArgs used: `{json.dumps(argv)}`')
|
||||
dtm_log.set_content(f'Last run exit code: {code}\n\nArgs used: `{json.dumps(argv)}`')
|
||||
except Exception as e:
|
||||
dtm_status.set_text(f'Conversion failed: {e}')
|
||||
dtm_log.set_markdown(f'Conversion failed: {e}')
|
||||
dtm_log.set_content(f'Conversion failed: {e}')
|
||||
finally:
|
||||
run_conv_button.set_disabled(False)
|
||||
run_conv_button.set_enabled(True)
|
||||
|
||||
run_conv_button = ui.button('Run conversion', on_click=lambda: asyncio.create_task(run_dtm_handler()), color='primary')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user