From 475e30ba4557e5a7a6cd87510955a317bb0170c0 Mon Sep 17 00:00:00 2001 From: David Bruant Date: Mon, 14 Apr 2025 14:34:51 +0200 Subject: [PATCH] Update readme and package.json following repo change --- package.json | 5 ++- readme.md | 2 +- tools/create-odt-file-from-template.js | 46 ++++++++++++++++++++++++-- 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a6b4e7e..1592399 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "ods-xlsx", + "name": "@odfjs/odfjs", "version": "0.13.0", "type": "module", "main": "./scripts/node.js", @@ -11,6 +11,9 @@ "start": "http-server -c-1 .", "test": "ava" }, + "repository": { + "url": "https://github.com/odfjs/odfjs.git" + }, "devDependencies": { "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-node-resolve": "^15.2.3", diff --git a/readme.md b/readme.md index 18bc5bd..7d86f59 100644 --- a/readme.md +++ b/readme.md @@ -18,7 +18,7 @@ Small lib to parse/understand .ods and .xsls files in the browser and node.js ### Install ```sh -npm i https://github.com/DavidBruant/ods-xlsx.git#v0.13.0 +npm i https://github.com/odfjs/odfjs.git#v0.13.0 ``` diff --git a/tools/create-odt-file-from-template.js b/tools/create-odt-file-from-template.js index 2bbb0f7..321c3f8 100644 --- a/tools/create-odt-file-from-template.js +++ b/tools/create-odt-file-from-template.js @@ -39,8 +39,47 @@ const data = { ] }*/ - /* +const templatePath = join(import.meta.dirname, '../tests/data/légumes-de-saison.odt') +const data = { + légumesSaison : [ + { + saison: 'Printemps', + légumes: [ + 'Asperge', + 'Betterave', + 'Blette' + ] + }, + { + saison: 'Été', + légumes: [ + 'Courgette', + 'Poivron', + 'Laitue' + ] + }, + { + saison: 'Automne', + légumes: [ + 'Poireau', + 'Potiron', + 'Brocoli' + ] + }, + { + saison: 'Hiver', + légumes: [ + 'Radis', + 'Chou de Bruxelles', + 'Frisée' + ] + } + ] +} +*/ + + const templatePath = join(import.meta.dirname, '../tests/data/tableau-simple.odt') const data = { annéeConsos : [ @@ -52,13 +91,16 @@ const data = { { année: 2020, conso: 37859.246}, ] } -*/ + + +/* const templatePath = join(import.meta.dirname, '../tests/data/template-avec-image.odt') const data = { commentaire : `J'adooooooore 🤩 West covinaaaaaaaaaaa 🎶` } +*/ const odtTemplate = await getOdtTemplate(templatePath) const odtResult = await fillOdtTemplate(odtTemplate, data)