Skip to content

Commit 7481839

Browse files
committed
🚸 Style(quarto_reportview.py and streamlit_reportview.py): Show warning message to include subsections when they do not exist
1 parent db45bf9 commit 7481839

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

‎vuegen/quarto_reportview.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ def generate_report(self, output_dir: str = BASE_DIR, static_dir: str = STATIC_F
8181
# Generate content for the subsection
8282
subsection_content, subsection_imports = self._generate_subsection(subsection, is_report_static, is_report_revealjs)
8383
qmd_content.extend(subsection_content)
84-
report_imports.extend(subsection_imports)
84+
report_imports.extend(subsection_imports)
85+
else:
86+
self.report.logger.warning(f"No subsections found in section: '{section.title}'. To show content in the report, add subsections to the section.")
8587

8688
# Flatten the subsection_imports into a single list
8789
flattened_report_imports = [imp for sublist in report_imports for imp in sublist]

‎vuegen/streamlit_reportview.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ def _generate_sections(self, output_dir: str) -> None:
256256
f"Error processing subsection '{subsection.id}' '{subsection.title}' in section '{section.id}' '{section.title}': {str(subsection_error)}"
257257
)
258258
raise
259+
else:
260+
self.report.logger.warning(f"No subsections found in section: '{section.title}'. To show content in the report, add subsections to the section.")
259261
except Exception as e:
260262
self.report.logger.error(f"Error generating sections: {str(e)}")
261263
raise

0 commit comments

Comments
 (0)