From 34eb9866e9be34c7c7b32da97a26b0a0771f8e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Bla=C5=BEek?= Date: Thu, 25 Aug 2022 15:38:31 +0200 Subject: [PATCH] feat: refactor and cleanup --- LICENSE | 21 ++++++++++++++++ README.md | 15 +++++++++++- index.js | 67 ++++++++++++++++++++++++++++++++-------------------- package.json | 4 ++-- 4 files changed, 78 insertions(+), 29 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..af58372 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Vituum + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index bde898f..6444f98 100644 --- a/README.md +++ b/README.md @@ -4,26 +4,38 @@ # ⚡️🌱 ViteTwig ```js +import twig from '@vituum/vite-plugin-twig' + export default { plugins: [ twig({ + reload: true, + root: null, filters: {}, functions: {}, extensions: [], namespaces: {}, - data: '*.json', globals: { template: 'path/to/template.twig' }, + data: '*.json', filetypes: { html: /.(json.html|twig.json.html|twig.html)$/, json: /.(json.twig.html)$/ + }, + twig: { + compileOptions: {}, + renderOptions: {} } }) ] } ``` +Read the [docs](https://vituum.dev/config/integrations-options.html#vituum-twig) to learn more about plugin options + +## Basic usage + ```html