Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d28af1d
:construction: start to explore adding subsections to homesection
enryH Jun 16, 2025
4c88031
Merge branch 'main' into fix_empty_report_w_one_section
enryH Jun 17, 2025
5f98172
:sparkles: revert to homepage layout as before, add new section
enryH Jun 17, 2025
d0d480b
:bug: fix syntax error (two closing parantheses)
enryH Jun 17, 2025
5be4e38
Merge branch 'main' into fix_empty_report_w_one_section
enryH Jun 19, 2025
74554f3
🐛 Make excel df paths relative insetad of absolute
sayalaruano Jun 20, 2025
8d91896
Merge branch 'fix_empty_report_w_one_section' of https://github.com/M…
sayalaruano Jun 20, 2025
f8b5148
Merge branch 'main' into fix_empty_report_w_one_section
enryH Jun 21, 2025
9697346
Merge branch 'main' into fix_empty_report_w_one_section
enryH Jun 23, 2025
4855919
Merge branch 'main' into fix_empty_report_w_one_section
enryH Jun 24, 2025
7db4664
🚧 add current state of qmd notebooks
enryH Jun 24, 2025
7e13c9e
:bug: ignore description.md and empty sections
enryH Jun 24, 2025
5dcc6e6
:bug: resolve file path first
enryH Jun 24, 2025
2a7057b
:bug: fix issue with non-directory generated config files, add test
enryH Jun 24, 2025
dc06173
:bug: fix path to tests/report_examples
enryH Jun 24, 2025
2ff06f8
:bug: add correct file ending..
enryH Jun 24, 2025
596e6c0
✅ test all report types based on quarto (update static path setting)
enryH Jun 24, 2025
1da57eb
:bug: bash for loop needs to be close using done
enryH Jun 24, 2025
e52d8f3
:bug: get rid of absolute path (missed in #136)
enryH Jun 24, 2025
0286b07
:art: clean-up comments/prints and improve logic
enryH Jun 25, 2025
84e2d61
Merge branch 'fix_empty_report_w_one_section' of https://github.com/M…
sayalaruano Jun 25, 2025
e3f0510
📝 Update example config files for basic and EMP case studies and upda…
sayalaruano Jun 25, 2025
df2ea1e
💚 Correct paths relative to the docs folder to pass CI tests
sayalaruano Jun 25, 2025
f414b80
📝 Update README with details about running vuegen using the cofig exm…
sayalaruano Jun 25, 2025
31884cf
:bug: commit change to test from svg to png logo
enryH Jun 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/vuegen/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ def create_yamlconfig_fromdir(
# Generate the YAML config
yaml_config = {
"report": {
# This will be used for the home section of a report
"title": self._create_title_fromdir(base_dir_path.name),
"description": self._read_description_file(base_dir_path),
"graphical_abstract": "",
Expand All @@ -328,10 +329,11 @@ def create_yamlconfig_fromdir(
sorted_sections = self._sort_paths_by_numprefix(list(base_dir_path.iterdir()))

main_section_config = {
"title": "",
"description": "Components added to homepage.",
"title": self._create_title_fromdir(base_dir_path.name),
"description": "Components added to main report folder.",
"components": [],
}
# treat it as any other section.
yaml_config["sections"].append(main_section_config)

# Generate sections and subsections config
Expand Down
26 changes: 6 additions & 20 deletions src/vuegen/streamlit_reportview.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,11 @@ def generate_report(self, output_dir: str = SECTIONS_DIR) -> None:
self._generate_home_section(
output_dir=output_dir,
report_manag_content=report_manag_content,
home_section=self.report.sections[0],
)
# ! move this into the _generate_home_section method
subsection_page_vars = []

for section in self.report.sections[1:]: # skip home section components
for section in self.report.sections: # skip home section components
# Create a folder for each section
subsection_page_vars = []
section_name_var = make_valid_identifier(
Expand Down Expand Up @@ -348,7 +349,6 @@ def _generate_home_section(
self,
output_dir: str,
report_manag_content: list,
home_section: r.Section,
) -> None:
"""
Generates the homepage for the report and updates the report manager content.
Expand All @@ -361,13 +361,6 @@ def _generate_home_section(
A list to store the content that will be written to the report manager file.
"""
self.report.logger.debug("Processing home section.")
all_components = []
subsection_imports = []
if home_section.components:
# some assert on title?
all_components, subsection_imports, _ = self._combine_components(
home_section.components
)

try:
# Create folder for the home page
Expand All @@ -382,8 +375,6 @@ def _generate_home_section(
# Create the home page content
home_content = []
home_content.append("import streamlit as st")
if subsection_imports:
home_content.extend(subsection_imports)
if self.report.description:
home_content.append(
self._format_text(text=self.report.description, type="paragraph")
Expand All @@ -394,8 +385,6 @@ def _generate_home_section(
)

# add components content to page (if any)
if all_components:
home_content.extend(all_components)

# Define the footer variable and add it to the home page content
home_content.append("footer = '''" + generate_footer() + "'''\n")
Expand Down Expand Up @@ -427,13 +416,11 @@ def _generate_sections(self, output_dir: str) -> None:
The folder where section files will be saved.
"""
self.report.logger.info("Starting to generate sections for the report.")

try:
for section in self.report.sections[1:]:
for section in self.report.sections:
self.report.logger.debug(
f"Processing section '{section.id}': '{section.title}' - {len(section.subsections)} subsection(s)"
)

if section.components:
# add an section overview page
section_content, section_imports, _ = self._combine_components(
Expand All @@ -449,9 +436,8 @@ def _generate_sections(self, output_dir: str) -> None:
)

if not section.subsections:
self.report.logger.warning(
f"No subsections found in section: '{section.title}'. "
"To show content in the report, add subsections to the section."
self.report.logger.debug(
f"No subsections found in section: '{section.title}'."
)
continue

Expand Down