-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML Report Customization #47
Comments
Hi Carl, proc Report2Html {ReportFile} {
variable ResultsFile
variable ReportBuildName
set ReportFileRoot [file rootname $ReportFile]
set ReportBuildName [file tail $ReportFileRoot]
set FileName ${ReportFileRoot}.html
set Report2HtmlDict [::yaml::yaml2dict -file ${ReportFile}]
set ReportHeaderHtmlFile [file join ${::osvvm::OsvvmScriptDirectory} summary_header_report.html]
file copy -force ${ReportHeaderHtmlFile} ${FileName}
set ResultsFile [open ${FileName} a] I am open to either collaborating or pull requests to add features such as this. We should hash through them here and perhaps prototype them (using manual edits to files) so we agree on the result. I have not used a template engine before. Open to using one if it gets us something better than what we currently have. What is currently there is based on figuring out what I could do in the time that I had. I would need help with that. I am on travel until July 7, so my response may be slow during this time. Cheers, |
OK - I put together a very limited proof of concept here: https://github.com/callendorph/OSVVM-Scripts/tree/issues/47_HTML_templating With
Keep in mind that:
<body>
<p> The answer is:
=================================
*** Error in macro at line 6, column 23:
*** [var_error msg]
--> invalid command name "var_error"
=================================
</p>
<H1> List Example </H1> But there are other options. How would this work for a OSS project ?I imagine it being something like this:
Final Thoughts
|
I think maybe the less ambitious feature would be:
|
Hi Carl, I have been on a 3 week business trip. I will be able to test out the code you pushed to your repository when I get back to the office on Monday. Cheers, |
Hi Carl,
The default ones are in the OsvvmLibraries/Scripts directory. You can put replacement ones in your simulation directory. A prefix of the following form can be added to the above files to make them specific to a particular item: In the requirements header, Best Regards, |
I checked the code of livejs. It doesn't support auto reload of local files ( |
The 2024.0XDev (dev branch) updates this again. The files buil/d_report_header.html, simulation_header.html, and requirements_header.html have been replaced by CssOsvvmStyle.css. In addition a user may add a file. Currently the name of the file is in Custom-Style.css, however, this is a work in progress. |
Hi,
First - this whole project is great. It took some time to get up to speed but super impressive what you have put together.
I would like to customize the output HTML report. Things I would like to do are:
head
section.With the current implementation of
Report2Html.tcl
- I don't see a clear way to do that without modifying it and adding a bunch of code. Maybe I missed something ?In my ideal world - I would be to keep these project specific customizations in the Parent project that is leveraging this repo as a submodule or library.
Have you considered using a template engine for generating the HTML? Coming from Python, there are several template engines for generating HTML content formats (for example, Jinja). They do a really nice job of separating out the presentation layer from the data.
I'm not an expert in TCL but google seems to indicate there are a couple of TCL-based template engine options:
tcllib
(I've checked it is present intcllib
v1.20 package on ubuntu 22.04)Thoughts? Is this a reasonable path or have you tried this already and hic sunt dracones?
The text was updated successfully, but these errors were encountered: