Skip to content
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

Stop creating HTML content programatically #236

Open
jan-cerny opened this issue Jun 19, 2024 · 1 comment
Open

Stop creating HTML content programatically #236

jan-cerny opened this issue Jun 19, 2024 · 1 comment

Comments

@jan-cerny
Copy link
Member

Is your feature request related to a problem? Please describe.
Some parts of the HTML content are created by the JavaScript code. Namely, the tables and other HTML content in the "Show test details" section are created by instating elements and attributes by calling JavaScript functions.

Please see openscap_report/report_generators/html_templates/js/oval_graph_generation_script.js, for example

function generate_OVAL_state(test_info, oval_state, div, off_heading=false) {


This approach is tedious, laborious, hard to orient in and difficult to maintain. Moreover, it mixes a definition of the presentation layout with data processing.

Describe the solution you'd like
It would be great to employ Jinja 2 templates here or some other "templating" technology.

Describe alternatives you've considered
I haven't considered any alternatives yet. But I'm open to any proposals or suggestions.

Additional context
None

@Honny1
Copy link
Member

Honny1 commented Jun 19, 2024

@jan-cerny Javascript generates the OVAL graph because web browsers have problems with HTML files with many HTML tags. The OVAL graph is generated on demand by the user using the show_rule_detail function. Unfortunately, details of the OVAL test and state are included in the OVAL graph.

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

No branches or pull requests

2 participants