htmlSanityCheck
htmlSanityCheck copied to clipboard
create image badge with result percentage or text block
over at docToolchain a user asked if there is something resulting fomr an htmlSanityCheck which could be included in the docs.
https://github.com/docToolchain/docToolchain/issues/456
A badge could be the easiest solution to be included in docs, but I guess not easy to create.
A text snippet which reports the percentage of green text could help to create a status like the one proposed in the ticket mentioned above:
last updated 2020-08-06 08:17:52 htmlSanitycheck reports an status of <97%>
I want to work on this issue, please assign this to me.
Thanks a lot, @pujakarakoti07, I am happy that you apply to implement this new feature.
Did you already check the mentioned docToolchain/docToolchain#456 issue of @arcusbude? It should be a starting point to implement this. If you look into the HSC HTML report, the output could be extended to generate at least an HTML document/fragment to the report directory with the mentioned status line. This HTML could later be integrated (e.g., iframe) with the docToolchain generated HTML (this is up to that project).
If you have more ideas they are welcome. A graphical badge like the ones provided by https://img.shields.io/ would be great.
Are you on (the Hacktoberfest) Discord? You can reach out to me (gerdaschemann) so we could have a chat if you run into problems (or if you need any other support).
As stated on the docToolchain issue, we have a two step process:
- build html by executing generateHTML or generateSite in docToolchain
- check the generated HTML through htmlSanityCheck
The question is, what is the best way to integrate the result into the already generated HTML?
Here are several ideas:
HSC could generate a button which will be included in the HTML. The AsciiDoc source could reference a dummy image which gets replaced later. This way, the image would not generate a warning by HSC
We could also setup an iFrame in AsciiDoc with a pass-through block. This could then later show the HSC results. This would not work for PDF generation
Another approach could be to create a marker or placeholder in the document (something like %%HSC-RESULTS%%) which can be replaced later with the HSC report
What do you think could be the best approach? Do you need help to setup a test environment? Do not hesitate to ask questions over here or via email (see my profile)
I would hope that we will see the final solution in HSC as well 😊.
The generate-pages script in HSC will create the full documentation microsite (based on docToolchain). It can be viewed locally in public/index.html afterwards. Hence, we do have a test bed already. We should embed the generated banner there.
and it would also be great if we also use it over at docToolchain