diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e787663..c5ac1a2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -57,6 +57,7 @@ jobs: run: | find docs/streamlit_report/sections -type f -name "*.py" -exec sed -i 's|/home/runner/work/vuegen/vuegen/docs/||g' {} + - name: Publish Streamlit report to streamlit-example branch + if: startsWith(github.ref, 'refs/tags') uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/conf.py b/docs/conf.py index 61c767d..f0d12b8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -56,6 +56,8 @@ nb_execution_raise_on_error = True # Rendering nb_merge_streams = True +# maximum execution time per cell in seconds +nb_execution_timeout = 120 # https://myst-nb.readthedocs.io/en/latest/authoring/custom-formats.html#write-custom-formats # ! if you use it, then you cannot directly execute the notebook in the browser in colab diff --git a/src/vuegen/quarto_reportview.py b/src/vuegen/quarto_reportview.py index c82f3af..600174d 100644 --- a/src/vuegen/quarto_reportview.py +++ b/src/vuegen/quarto_reportview.py @@ -773,7 +773,7 @@ def _show_dataframe( static_dir, f"{dataframe.title.replace(' ', '_')}.png" ) dataframe_content.append( - f"dfi.export(df, '{os.path.abspath(df_image)}', max_rows=10, max_cols=5)\n```\n" + f"df.dfi.export('{os.path.abspath(df_image)}', max_rows=10, max_cols=5)\n```\n" ) # Use helper method to add centered image content dataframe_content.append(self._generate_image_content(df_image)) diff --git a/src/vuegen/report_generator.py b/src/vuegen/report_generator.py index 8faaf99..db06d10 100644 --- a/src/vuegen/report_generator.py +++ b/src/vuegen/report_generator.py @@ -1,4 +1,5 @@ import logging +import shutil from .config_manager import ConfigManager from .quarto_reportview import QuartoReportView @@ -61,6 +62,14 @@ def get_report( st_report.run_report() else: + # Check if Quarto is installed + if shutil.which("quarto") is None: + logger.error( + "Quarto is not installed. Please install Quarto before generating this report type." + ) + raise RuntimeError( + "Quarto is not installed. Please install Quarto before generating this report type." + ) quarto_report = QuartoReportView(report=report, report_type=report_type) quarto_report.generate_report() quarto_report.run_report()