Skip to content

Conversation

@enryH
Copy link
Collaborator

@enryH enryH commented Jul 17, 2025

- update tests once the relative imports are updated
@enryH enryH self-assigned this Jul 17, 2025
@enryH enryH linked an issue Jul 17, 2025 that may be closed by this pull request
3 tasks
@enryH enryH changed the title :bugL update formatting to support again multi-line descriptions 🐛 update formatting to support again multi-line descriptions Jul 17, 2025
@enryH
Copy link
Collaborator Author

enryH commented Jul 18, 2025

@sayalaruano What was the rationale behind indenting the description? The first line is omitted.

def _read_description_file(self, folder_path: Path) -> str:
"""
Reads the content of a description.md file if it exists in the given folder.
Parameters
----------
folder_path : Path
Path to the folder where description.md might be located.
Returns
-------
str
Content of the description.md file if found, otherwise an empty string.
"""
description_file = folder_path / "description.md"
if description_file.exists():
ret = description_file.read_text().strip().replace("\n", "\n ")
return f"{ret}\n"
return ""

So the basic example description is

A general description of the report.

It should test all major components which are available
to be integrated into VueGen.

Check our tests folder for examples of report files used to generate actual reports.

and will be translated to by that function (to be added to the .qmd file:

A general description of the report.
  
  It should test all major components which are available
  to be integrated into VueGen.
  
  Check our tests folder for examples of report files used to generate actual reports.

I will remove the replace("\n", "\n ") in line 214.

- less confusing handling of files.
@enryH enryH marked this pull request as ready for review July 18, 2025 14:08
@enryH enryH requested review from Copilot and sayalaruano July 18, 2025 15:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes formatting issues to properly support multi-line descriptions in HTML output. The changes update the string concatenation and formatting logic to preserve multi-line text content across both Streamlit and Quarto report formats.

  • Updates HTML string formatting from concatenated strings to triple-quoted strings with proper indentation
  • Removes line break replacement logic that was preventing multi-line descriptions from rendering correctly
  • Adds multi-line content to test data to validate the formatting fix

Reviewed Changes

Copilot reviewed 31 out of 32 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/vuegen/streamlit_reportview.py Updates _format_text method to use triple-quoted strings and proper indentation for multi-line HTML content
src/vuegen/quarto_reportview.py Removes unnecessary f-string formatting for report descriptions
src/vuegen/config_manager.py Removes line break replacement logic in _read_description_file method
docs/example_data/Basic_example_vuegen_demo_notebook/description.md Adds multi-line test content
Multiple test files Updates generated test files to reflect the new formatting approach

@enryH enryH merged commit 07d0ac4 into main Jul 19, 2025
28 of 38 checks passed
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.

Multiline description

3 participants