inspec/lib/plugins/inspec-reporter-html2
Vasundhara Jagdale 17bd3115b2
Reduce version pinning (#6873)
* Remove pinning of version for dependencies in test environment

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Remove version pinning of minitest and html-proofer

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* html-proofer still breaks the 3.0 ruby verify pipeline so reverting the removal of version pinning for html-proofer

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Revert "Remove version pinning of minitest and html-proofer"

This reverts commit f816289f39.

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Remove the dependency on html-proofer gem as it's only used in single test.

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

---------

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>
2023-12-13 15:07:57 +05:30
..
lib Apply chefstyle -a, and manually remove duplicate requires 2020-12-21 13:25:04 -05:00
templates Fix in html reporter to create unique id for control HTML divisions using profile id as prefix (#6645) 2023-10-19 12:51:40 +05:30
test Reduce version pinning (#6873) 2023-12-13 15:07:57 +05:30
inspec-reporter-html2.gemspec Added gemspec file to core plugins to be used in plugin listing for description 2022-03-18 17:27:11 +05:30
README.md Sync up the default branch as main (#6239) 2022-08-25 09:33:17 -04:00

inspec-reporter-html2 Plugin

An "improved" HTML output reporter specifically for Chef InSpec. Unlike the default html reporter, which is RSpec-based, this reporter knows about Chef InSpec structures like Controls and Profiles, and includes full metadata such as control tags, etc.

To Install This Plugin

This plugin ships with Chef InSpec and requires no installation.

It should appear when you run:

you@machine $ inspec plugin list

How to use this plugin

To generate an HTML report using this plugin and save the output to a file named report.html, run:

you@machine $ inspec exec some_profile --reporter html2:report.html

Note the 2 in the reporter name. If you omit it and run --reporter html instead, you will run the legacy RSpec HTML reporter.

Configuring the Plugin

The html2 reporter requires no configuration to function. However, two options--alternate_css_file and alternate_js_file--are available for customization. The options are set in the JSON-formatted configuration file that Chef InSpec consumes. For details, see our configuration file documentation.

For example:

{
  "version": "1.2",
  "plugins": {
    "inspec-reporter-html2": {
      "alternate_js_file":"/var/www/js/my-javascript.js",
      "alternate_css_file":"/var/www/css/my-style.css"
    }
  }
}

alternate_css_file

Specifies the full path to the location of a CSS file that will be read and inlined into the HTML report. The default CSS will not be included.

alternate_js_file

Specifies the full path to the location of a JavaScript file that will be read and inlined into the HTML report. The default JavaScript will not be included. The JavaScript file should implement at least a pageLoaded() function, which will be called by the onload event of the HTML body element.

Developing This Plugin

This plugin is part of the Chef InSpec source code. While it has its own tests, the general contribution policy is dictated by the Chef InSpec project at https://github.com/inspec/inspec/blob/main/CONTRIBUTING.md