const path = require('path'); const fs = require("fs"); const fsp = fs.promises; const JSON5 = require('json5'); function toCode(files, data){ let code = ""; { let urls = data.map(e => e.url); let unhandled = []; for(let file of files){ let isHandled = false; for(let url of urls){ if(file.indexOf(url) !== -1){ isHandled = true; } } if(!isHandled){ unhandled.push(file); } } unhandled = unhandled .filter(file => file.indexOf(".html") > 0) .filter(file => file !== "page.html"); // for(let file of unhandled){ // unhandledCode += ` // ${file} // `; // } } const rows = []; let row = []; for(let example of data){ row.push(example); if(row.length >= 6){ rows.push(row); row = []; } }; rows.push(row); for(const row of rows){ let thumbnails = ""; let labels = ""; for(let example of row){ let url = example.url.startsWith("http") ? example.url : `http://potree.org/potree/examples/${example.url}`; thumbnails += `