From 9fdbb57ccc1b8613f080b77be6846275113d5662 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Fri, 26 Mar 2021 10:33:04 +0100 Subject: [PATCH] Add guidelines data to NPM package and documenation (#5342) --- README.md | 4 ++++ scripts/build-package.js | 1 + scripts/templates/icon-object.js | 1 + 3 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 4a1fe8e2..63f1c303 100644 --- a/README.md +++ b/README.md @@ -66,12 +66,14 @@ console.log(icon); source: 'https://simpleicons.org/', svg: '...', path: 'M12 12v-1.5c-2.484 ...', + guidelines: 'https://simpleicons.org/styleguide', license: { type: '...', url: 'https://example.com/' } } +NOTE: the `guidelines` entry will be `undefined` if we do not yet have guidelines data for the icon. NOTE: the `license` entry will be `undefined` if we do not yet have license data for the icon. */ ``` @@ -96,12 +98,14 @@ console.log(icon); source: 'https://simpleicons.org/', svg: '...', path: 'M12 12v-1.5c-2.484 ...', + guidelines: 'https://simpleicons.org/styleguide', license: { type: '...', url: 'https://example.com/' } } +NOTE: the `guidelines` entry will be `undefined` if we do not yet have guidelines data for the icon. NOTE: the license may be `undefined` if there is no license data for the icon. */ ``` diff --git a/scripts/build-package.js b/scripts/build-package.js index 664f7047..afbea706 100644 --- a/scripts/build-package.js +++ b/scripts/build-package.js @@ -56,6 +56,7 @@ function iconToObject(icon) { escape(icon.svg), escape(icon.source), escape(icon.hex), + icon.guidelines ? `'${escape(icon.guidelines)}'` : undefined, licenseToObject(icon.license), ); } diff --git a/scripts/templates/icon-object.js b/scripts/templates/icon-object.js index 9b2e1dc6..183da6ae 100644 --- a/scripts/templates/icon-object.js +++ b/scripts/templates/icon-object.js @@ -7,5 +7,6 @@ }, source: '%s', hex: '%s', + guidelines: %s, license: %s, }