lab-website-template icon indicating copy to clipboard operation
lab-website-template copied to clipboard

Make testbed

Open vincerubinetti opened this issue 4 years ago • 2 comments
trafficstars

Make thorough testbed file for testing components.

Make sure there are fallbacks for all parameters, including providing empty lists. Make sure components work in all orders, on all screen sizes, etc

vincerubinetti avatar Dec 22 '20 06:12 vincerubinetti

Also use this test bed as an opportunity to automatically generate screenshots of all the components to put in the documentation.

vincerubinetti avatar Mar 30 '21 23:03 vincerubinetti

Maybe find a way to have Netlify build a special testbed.md that is hosted in a separate hidden place so the file doesn't clutter up the repo.

vincerubinetti avatar Apr 14 '21 23:04 vincerubinetti

Deleted. See comment edit history for posterity.

vincerubinetti avatar Oct 18 '22 16:10 vincerubinetti

Above is where I will keep/track the testbed code. I wrote this tool to convert and escape the above text into a single-line bash command that writes it to a testbed.md file:

https://jsfiddle.net/k0dqngrt/3/show

For posterity (in case the jsfiddle link goes away), the critical part is this
output.value =
  "printf -- '" +
  input.value
  .replaceAll("\\", "\\\\")
  .replaceAll("'", "'\\''")
  .replaceAll("%", "%%")
  .replaceAll("\n", "\\n")
  .replaceAll("\r", "\\r")
  .replaceAll("\t", "\\t") +
  "' >> testbed.md";

Open the fiddle, paste the testbed code from the comment above, copy the generated command, and run that command before the jekyll build command on netlify. Retrigger the latest deploy on the Netlify production site. Then, a /testbed url should exist only on greenelab/lab-website-template, and only on Netlify (not gh-pages), which is the only place we need this.

Live Testbed Page

https://lab-website-template.netlify.app/testbed

Links to sections on this page are now incorporated into the wiki docs.

vincerubinetti avatar Oct 18 '22 16:10 vincerubinetti

Instead of this crazy sed nonsense, I'm just going to include the testbed.md right in the repo, and remove the file with Actions when the user clones the repo. See #142 .

vincerubinetti avatar Nov 28 '22 16:11 vincerubinetti