Closed Hemant-Mulchandani closed 1 year ago
Hey! it's been a while, can anyone please update the status about the same..!!
Thanks!
Hi @Hemant-Mulchandani! Thanks so much for the PR. Unfortunately, we generate this HTML file automatically in our build process. Editing it will be overwritten next time we build.
We also want to fix the links in our Markdown and Docx files too.
I've updated our CONTRIBUTING.md file to explain this a bit more. But also the exact line of code we want to change is actually in where we generate our markdown, (which comes before the HTML).
It is this line of code: https://github.com/Chartability/POUR-CAF/blob/f25671026d7c548b4d9eb41f0f75966495f4d35b/scripts/generate_markdown.js#L25
I took a look at this a bit further, just to remind myself of the problem. It looks like there is a bug, as well as some lazy code!
I think that the next line has the bug:
if (d["Tools or Testing Method"].length === 1) {
The value for d["Tools or Testing Method"]
is a string of a url a string that contains multiple links, separated by a comma.
This means that the if-statement never runs that line, because there is never just a single-length string supplied.
But I bet we could just convert that string into an array and then generate the correct markdown from it or even just use some fancy replacement on the string itself!
so changing:
if (d["Tools or Testing Method"]) {
if (d["Tools or Testing Method"].length === 1) {
p.push({"p": `__Example tool or testing method__: [${d["Tools or Testing Method"]}](${d["Tools or Testing Method"]})`})
} else {
p.push({"p": `__Example tools or testing method__: ${d["Tools or Testing Method"]}`})
}
}
to something like:
if (d["Tools or Testing Method"]) {
let stringOfLinks = '';
let i = 0;
// make an array
const toolsArray = d["Tools or Testing Method"].split(', ')
toolsArray.forEach(toolLink => {
i++
// add to the string of links
stringOfLinks += `[${ toolLink }](${ toolLink })${i !== toolsArray.length ? ', ' : ''}`
})
p.push({"p": `__Example tool or testing method__: ${ stringOfLinks }`})
}
And then running yarn build
from the terminal to check if it worked on all three of our files (markdown, html, and docx). (Note: you'll need to have pandoc
installed before you do this!)
Closing this, since it hasn't had action in the last year. I'll likely make an attempt here soon though on this, since we have another issue open.
Tools and testing methods are not links #5
Issue Resolved: There are hyperlinks in the workbook for good examples and standards, but tools are missing hyperlinks and instead are just plain text.