Initial commit for Greenlens

This commit is contained in:
Timo Knuth
2026-03-16 21:31:46 +01:00
parent 307135671f
commit 05d4f6e78b
573 changed files with 54233 additions and 1891 deletions

23
format_md.js Normal file
View File

@@ -0,0 +1,23 @@
const fs = require('fs');
function formatPlants(plants) {
let md = '# Alle Pflanzen in der Datenbank\n\n';
md += '| Name | Botanischer Name | Kategorie | Gießintervall (Tage) | Licht | Temperatur |\n';
md += '| :--- | :--- | :--- | :--- | :--- | :--- |\n';
for (const plant of plants) {
const categories = plant.categories.join(', ');
const water = plant.careInfo.waterIntervalDays || '-';
const light = plant.careInfo.light || '-';
const temp = plant.careInfo.temp || '-';
md += `| ${plant.name} | *${plant.botanicalName}* | ${categories} | ${water} | ${light} | ${temp} |\n`;
}
return md;
}
const plants = JSON.parse(fs.readFileSync('plants_dump_utf8.json', 'utf8'));
const markdown = formatPlants(plants);
fs.writeFileSync('ALLE_PFLANZEN.md', markdown);
console.log('ALLE_PFLANZEN.md created.');