{"id":22423392,"url":"https://github.com/prantlf/grunt-html-html-report-converter","last_synced_at":"2026-03-19T22:49:42.571Z","repository":{"id":26957281,"uuid":"112017192","full_name":"prantlf/grunt-html-html-report-converter","owner":"prantlf","description":"Converts the JSON report of the grunt-html task to HTML.","archived":false,"fork":false,"pushed_at":"2022-05-27T09:54:08.000Z","size":224,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T09:15:30.978Z","etag":null,"topics":["grunt-htmlhint","grunt-task","html","reporter"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prantlf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-25T16:14:55.000Z","updated_at":"2022-05-27T09:42:23.000Z","dependencies_parsed_at":"2022-09-20T08:31:18.166Z","dependency_job_id":null,"html_url":"https://github.com/prantlf/grunt-html-html-report-converter","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fgrunt-html-html-report-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fgrunt-html-html-report-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fgrunt-html-html-report-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fgrunt-html-html-report-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prantlf","download_url":"https://codeload.github.com/prantlf/grunt-html-html-report-converter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245791899,"owners_count":20672668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grunt-htmlhint","grunt-task","html","reporter"],"created_at":"2024-12-05T18:11:06.231Z","updated_at":"2026-01-06T13:55:06.411Z","avatar_url":"https://github.com/prantlf.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-html-html-report-converter\n\n[![Latest version](https://img.shields.io/npm/v/grunt-html-html-report-converter)\n ![Dependency status](https://img.shields.io/librariesio/release/npm/grunt-html-html-report-converter)\n](https://www.npmjs.com/package/grunt-html-html-report-converter)\n[![Coverage](https://codecov.io/gh/prantlf/grunt-html-html-report-converter/branch/master/graph/badge.svg)](https://codecov.io/gh/prantlf/grunt-html-html-report-converter)\n\nThis module provides a grunt multi-task for converts the JSON report generated by the [grunt-html] task to the HTML format. It uses [grunt-html-html-reporter] to format the validation results.\n\n## Installation\n\nYou need [node \u003e= 4][node], and [grunt \u003e= 0.4.5][Grunt] installed\nand your project build managed by a [Gruntfile] with the necessary modules\nlisted in [package.json]; including [grunt-html]. If you haven't used Grunt before, be sure to check out the [Getting Started] guide, as it\nexplains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with you favourite package manager:\n\n```shell\nnpm i -D grunt-html-html-report-converter\npnpm i -D grunt-html-html-report-converter\nyarn add -D grunt-html-html-report-converter\n```\n\n## Configuration\n\nAdd the `htmllint-html-report-converter` entry with the task configuration to the options of the `grunt.initConfig` method:\n\n```js\ngrunt.initConfig({\n  'htmllint-html-report-converter': {\n    all: {\n      src: 'results/report.json',\n      dest: 'results/report.html'\n    }\n  }\n});\n```\n\nDefault options support the most usual usage scenario:\n\n```js\n'html-html-report-converter': {\n  options: {\n    targetExtension: '.html',\n    ignoreMissing: false,\n    showFileNameOnly: false,\n    showCommonPathOnly: true,\n    force: false\n  },\n  all: {\n    src: 'results/report.json',\n    dest: 'results/report.html'\n  }\n}\n```\n\n### Task Options\n\n#### force\nType: `Boolean`\nDefault value: false\n\nIf set to `true`, it suppresses failures, which happened during the report conversion. Instead of making the Grunt fail, the errors will be written only to the console.\n\n#### ignoreMissing\nType: `Boolean`\nDefault: `false`\n\nIf the `src` property does not point to any files, or if it is missing,\nthe task will make the Grunt run fail. If you set the `ignoreMissing`\noption to `true`, Grunt will continue executing other tasks.\n\n#### includeUnreported\nType: `Boolean`\nDefault: `false`\n\nIf the `src` property does not point to any files, or if it is missing,\nthe task will assume, that no messages existed for the input files, which\nwhich were above the configured severity. It will create the report\nnevertheless and include all input files there.\n\n#### targetExtension\nType: `String`\nDefault: \".html:\n\nIf the `dest` property specified only the target directory, the converted report file will be stored there with the file extension replaced to \".html\" or to the extesion specified by this property.\n\n#### showFileNameOnly\nType: `Boolean`\nDefault value: `false`\n\nCuts the directory from tested HTML files, when creating page titles from in the report. If you use unique names for files alone, you will not get too long page titles, if you flip this flag tp `true`.\n\n### Task Data\n\nThe configuration consists of `src` and `dest` property pairs. The `src`\nproperty has to point to an existing source path. The `dest` property has\nto point to the path, where the converted report should be written.\n\nIf you do not end the `dest` path by the path separator (slash, for example), the `dest` path will be considered as if it includes the converted report file name too.\n\nIf you end the `dest` path by a path separator (slash, for example), the\nconverted report will be created using the source report name with the HTML expension.\n\nIf you specify more source files or directories, or use wildcards, the target path should be a directory - ended by the path separator (slash, for example).\n\nIf you set `includeUnreported` to true and you expect all input files reported with zero messages, include the `input` property. Set it to the files, which were input of the `htmllint` task. For example:\n\n```js\n'html-html-report-converter': {\n  options: {\n    includeUnreported: true\n  },\n  all: {\n    input: 'snapshots/*.html',\n    src: 'results/report.json',\n    dest: 'results/report.html'\n  }\n}\n```\n\n#### src\nType: `String` or `Array`\n\nPath to the file with the JSON report generated by the `htmllint` task, or a path pattern identifying these file, or an array of these.\n\n#### dest\nType: `String`\n\nPath to the file, which will be the HTML report written to. Or only the path to the directory, where it should be written, if the source report name with the HTML expension shoudl be used.\n\n#### input\nType: `String|Array|Object`\n\nFiles, which were input of the `htmllint` task. The format is the same as for the `src` parameter - the Grunt source file specification.\n\n### Loading\n\nLoad the plugin in `Gruntfile.js`:\n\n```javascript\ngrunt.loadNpmTasks('grunt-html-html-report-converter');\n```\n\n## Build\n\nCall the `htmllint-html-report-converter` task:\n\n```shell\n$ grunt htmllint-html-report-converter\n```\n\nor integrate it to your build sequence in `Gruntfile.js`:\n\n```js\ngrunt.registerTask('default', ['htmllint-html-report-converter', ...]);\n```\n\n## Notes\n\nThis task will be usually executed right after the `htmllint` task. For example:\n\n```js\ngrunt.initConfig({\n  htmllint: {\n    options: {\n      errorlevels: ['error', 'warning', 'info'],\n      reporter: 'json',\n      reporterOutput: 'output/report.json',\n    },\n    all: {\n      src: ['input/*.html']\n    }\n  },\n\n  'htmllint-html-report-converter': {\n    all: {\n      src: 'output/report.json',\n      dest: 'output/'\n    }\n  }\n});\n\ngrunt.loadNpmTasks('grunt-html');\ngrunt.loadNpmTasks('grunt-html-html-report-converter');\n\ngrunt.registerTask('default', [\n  'htmllint', 'html-html-report-converter']);\n```\n\nThe installation of the necessary Grunt tasks, again, one of the package managers:\n\n```bash\nnpm i -D grunt-html grunt-html-html-report-converter\npnpm i -D grunt-html grunt-html-html-report-converter\nyarn add -D grunt-html grunt-html-html-report-converter\n```\n\n## Contributing\n\nIn lieu of a formal styleguide, take care to maintain the existing coding\nstyle. Add unit tests for any new or changed functionality. Lint and test\nyour code using Grunt.\n\n## License\n\nCopyright (c) 2017-2022 Ferdinand Prantl\n\nLicensed under the MIT license.\n\n[node]: https://nodejs.org\n[package.json]: https://docs.npmjs.com/files/package.json\n[Grunt]: https://gruntjs.com\n[Gruntfile]: https://gruntjs.com/sample-gruntfile\n[Getting Gtarted]: https://github.com/gruntjs/grunt/wiki/Getting-started\n[grunt-html]: https://github.com/jzaefferer/grunt-html\n[grunt-html-html-reporter]: https://github.com/prantlf/grunt-html-html-reporter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantlf%2Fgrunt-html-html-report-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprantlf%2Fgrunt-html-html-report-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantlf%2Fgrunt-html-html-report-converter/lists"}