Skip to content

chore: properly render html and text templates#1519

Closed
mdelapenya wants to merge 10 commits intotestcontainers:mainfrom
mdelapenya:fix-html-templates
Closed

chore: properly render html and text templates#1519
mdelapenya wants to merge 10 commits intotestcontainers:mainfrom
mdelapenya:fix-html-templates

Conversation

@mdelapenya
Copy link
Copy Markdown
Member

@mdelapenya mdelapenya commented Aug 24, 2023

What does this PR do?

This PR uses two different template engines for different template files: text-based and HTML-based ones.

The code is basically the same for both, but simplifying the logic for the target template file: only the markdown file for the new module will use the HTML template engine, as it needs to render HTML tags. The rest just needs the text engine.

At the same time, we are adding comments in the generated files explaining they are generated by the module generator tool.

Finally, the mkdocs file has a corner case with some entries that are not properly rendered: we are forcing the generation properly now.

Why is it important?

When generating text files, the quotes and double quotes were interpolated to their HTML representations, which was incorrect.

@mdelapenya mdelapenya requested a review from a team as a code owner August 24, 2023 10:29
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Aug 24, 2023
@mdelapenya mdelapenya self-assigned this Aug 24, 2023
@netlify
Copy link
Copy Markdown

netlify bot commented Aug 24, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 31a7541
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/64e73393801de900081d4f96
😎 Deploy Preview https://deploy-preview-1519--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mdelapenya
Copy link
Copy Markdown
Member Author

@mmorel-35 could you take a look at this PR? It's very related to your work on the code generation tool 🙏

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mmorel-35
Copy link
Copy Markdown
Contributor

mmorel-35 commented Aug 24, 2023

Would you mind keeping this as a draft? I can integrate it with the further PR of the refactoring of the modulegen.
In the meanwhile you can provide the header of the files with the comment header.

@mdelapenya
Copy link
Copy Markdown
Member Author

Would you mind keeping this as a draft?

Sure, although I'm worried that anybody using the code generator could send a PR including wrong text values.

@mdelapenya mdelapenya marked this pull request as draft August 24, 2023 15:05
@mmorel-35
Copy link
Copy Markdown
Contributor

@mdelapenya ,
I created two PR that shall cover this one.
Please have look.
Notice that several other will come to cover the rest of the templates.

@mdelapenya
Copy link
Copy Markdown
Member Author

@mdelapenya , I created two PR that shall cover this one. Please have look. Notice that several other will come to cover the rest of the templates.

Could you create an issue and add checkboxes with all the tasks you are planning? That would help me be prepared for new changes, not implementing things as duplicates, also making available for the community what you're working on. Something like:

  • Extract mkdocs module
  • Extract GH action module
  • Sonarqube

Does it sound good to you?

@mmorel-35
Copy link
Copy Markdown
Contributor

Ok! I’m taking care of this today

@mdelapenya mdelapenya deleted the fix-html-templates branch August 30, 2023 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Changes that do not impact the existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants