Skip to content

Conversation

@enryH
Copy link
Collaborator

@enryH enryH commented Apr 23, 2025

  • allow components in all folders currently in examples

  • streamlit

    • main folder
    • section folder
    • subsection folder
  • quarto reports

    • main folder
    • section folder
    • subsection folder

enryH added 11 commits April 23, 2025 12:26
- writing of imports + component code (write python file)
- component - fct map for generation
- building list of components
- first section is home section recording it's compents
- needs to be treated separately
- add overview page for each section showing components in main section folder
- Section could be used everywhere, Subsection is not really necessary. If a Section has subsections, the logic changes. Else nothing changes.
- set based on report type, and this is set on init
- avoid to pass on variable to all functions.
- same as for streamlit_report to prepare refactoring
  of components parsing.
- very similar to _combine_components in streamlit_report
- imports has to be a list of list -> figure this out
- added debug message for skipping components in
  static reports-> should maybe be a warining?
@enryH enryH marked this pull request as ready for review April 28, 2025 09:05
@enryH enryH requested a review from sayalaruano April 28, 2025 09:05
@enryH
Copy link
Collaborator Author

enryH commented Apr 28, 2025

Next would be to go even deeper and collect subfolder components to the subsection reports. This should be possible only in config_manager.py and be independent of the specific report. Or maybe even better to generate additional subsections which are just appended. To be decided in a separate PR.

@enryH enryH linked an issue Apr 28, 2025 that may be closed by this pull request
Copy link
Collaborator

@sayalaruano sayalaruano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, it works as expected, but there are some unintended behaviours:

  • In a streamlit report, if there is a description.md file for the report and there are components in the main folder, the description is shown twice.
  • In the streamlit report, instead of putting all the components from the main folder in the Home page, would not be better to create an ´Overview´ section, and keep the home section just for the title, description, and a graphical abstract if available?
  • The revelajs' report structure is broken, I attached screenshots with the stable version and the one from this branch. Each subsection should be a tab in the section.

Stable version
flexible_folder_str_version

Flexible folder str version
stable_version

section.file_path = subsection_file_path
# Create a Page object for each subsection and add it to the home page content
report_manag_content.append(
f"{section_name_var}_overview = st.Page('{subsection_file_path}', title='Overview {section.title}')"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the title can be just Overview to avoid repetition bc it's always under the section.title

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the title='Overview {section.title}' is even ignored. The subsection need unique names. So you cannot have just overview anywhere. I think the title is set based on the variable name.

@enryH
Copy link
Collaborator Author

enryH commented Apr 29, 2025

Did you create your own example for revealjs? I think we are also still missing to update the basic example or just have a copy of the basic example with more complicated folder structure somewhere for testing.

@enryH
Copy link
Collaborator Author

enryH commented Apr 29, 2025

I think I will need to add panel-tabset at some places. This lets me wonder: should we have more than qmd file as output? the qmd files change slightly depending on the output report, so maybe having only one qmd might be misleading one to think (like me) that all are alike.

@sayalaruano
Copy link
Collaborator

I used the basic case study folder and created my own example; in both cases, the revealjs structure was not good. So, what would be the alternative to create just one qmd file?

enryH added 2 commits April 29, 2025 16:56
- I removed an empty f-string and this lead to doubled curely brackets...
@enryH
Copy link
Collaborator Author

enryH commented Apr 29, 2025

Ok. It was a string interpolation issue. I removed a f-string which removed one level of the curly brackets before... Should be working now. I added tabs to the overview sections.

enryH added 2 commits April 29, 2025 16:58
⚠️ duplicated code

- description files are parsed by configuration_manager
- skipped for section content. So a section can have content, which is not used - a single description.md file
@enryH
Copy link
Collaborator Author

enryH commented Apr 30, 2025

Before we add this, I would still adapt the basic example to include some components on the section folders and maybe even root of the example. But for the root, we maybe should have an even simpler example

root
|-- folder
|-  | - description.md
|--description.md

@enryH
Copy link
Collaborator Author

enryH commented May 2, 2025

I noted done the additional testing requirments for a future PR in #116

@enryH enryH merged commit 16dac66 into main May 2, 2025
16 checks passed
@enryH enryH deleted the more_flexible_folder_structure branch May 2, 2025 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subsubdirectories are required

3 participants