From 40a5b6d21c3dca3710c855f9174ea81c824e24c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gro=C3=9Fe?= Date: Fri, 1 Dec 2023 15:13:01 +0100 Subject: [PATCH] doc: enhance readme --- README.MD | 23 ++++++++++++----------- docSrc/buildDoc.js | 2 ++ docSrc/mainFile.tpl | 2 ++ docSrc/sections/footer.tpl | 12 ++++++++++++ docSrc/sections/index.js | 14 ++++++++++++++ docSrc/sections/license.tpl | 2 +- docSrc/sections/usage.tpl | 2 ++ docs/API.MD | 1 - package.json | 2 +- 9 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 docSrc/sections/footer.tpl diff --git a/README.MD b/README.MD index f24637e..c7c6027 100644 --- a/README.MD +++ b/README.MD @@ -186,16 +186,17 @@ Copyright 2017-2023 Staffbase GmbH. Licensed under the Apache License, Version 2.0: https://www.apache.org/licenses/LICENSE-2.0 + - - - - -
- Staffbase GmbH - - Staffbase GmbH -
Staffbase is an internal communications platform built to revolutionize the way you work and unite your company. Staffbase is hiring: jobs.staffbase.com -
GitHub | Website | Jobs -
+ + + Staffbase GmbH + + + Staffbase GmbH +
Staffbase is an internal communications platform built to revolutionize the way you work and unite your company. Staffbase is hiring: jobs.staffbase.com +
GitHub | Website | Jobs + + + diff --git a/docSrc/buildDoc.js b/docSrc/buildDoc.js index 16b2005..af10cba 100644 --- a/docSrc/buildDoc.js +++ b/docSrc/buildDoc.js @@ -30,6 +30,7 @@ jsdoc2md.render({ const contributionText = retArr[4]; const testText = retArr[5]; const licenseText = retArr[6]; + const footerText = retArr[7]; return new Promise( (resolve, reject) => { fs.readFile(path.join(__dirname, './mainFile.tpl'), (err, mainTpl) => { @@ -45,6 +46,7 @@ jsdoc2md.render({ contribution: contributionText, tests: testText, license: licenseText, + footer: footerText, }); // Copy generated markdown file to root folder fs.writeFile(path.join(__dirname, '../README.MD'), rendered, (err, done) => { diff --git a/docSrc/mainFile.tpl b/docSrc/mainFile.tpl index d72b0b6..28b75dd 100644 --- a/docSrc/mainFile.tpl +++ b/docSrc/mainFile.tpl @@ -27,3 +27,5 @@ ## License {{{license}}} + +{{{footer}}} diff --git a/docSrc/sections/footer.tpl b/docSrc/sections/footer.tpl new file mode 100644 index 0000000..2c77323 --- /dev/null +++ b/docSrc/sections/footer.tpl @@ -0,0 +1,12 @@ + + + + + +
+ Staffbase GmbH + + Staffbase GmbH +
Staffbase is an internal communications platform built to revolutionize the way you work and unite your company. Staffbase is hiring: jobs.staffbase.com +
GitHub | Website | Jobs +
diff --git a/docSrc/sections/index.js b/docSrc/sections/index.js index b65e65e..91df5c4 100644 --- a/docSrc/sections/index.js +++ b/docSrc/sections/index.js @@ -104,6 +104,19 @@ module.exports = { } }); }); + const footerPromise = new Promise( (resolve, reject) => { + fs.readFile(path.join(__dirname, 'footer.tpl'), (err, footerTpl) => { + if (err) { + reject(err); + } else { + const tpl = handlebars.compile(footerTpl.toString()); + const rendered = tpl({ + + }); + resolve(rendered); + } + }); + }); return Promise.all([ overviewPromise, installationPromise, @@ -112,6 +125,7 @@ module.exports = { contributionPromise, testPromise, licensePromise, + footerPromise, ]); }, }; diff --git a/docSrc/sections/license.tpl b/docSrc/sections/license.tpl index a39c063..1367504 100644 --- a/docSrc/sections/license.tpl +++ b/docSrc/sections/license.tpl @@ -1,3 +1,3 @@ -Copyright 2017-2021 Staffbase GmbH. +Copyright 2017-2023 Staffbase GmbH. Licensed under the Apache License, Version 2.0: https://www.apache.org/licenses/LICENSE-2.0 diff --git a/docSrc/sections/usage.tpl b/docSrc/sections/usage.tpl index baf692c..ab75065 100644 --- a/docSrc/sections/usage.tpl +++ b/docSrc/sections/usage.tpl @@ -54,6 +54,8 @@ The following data can be retrieved from the token: |Helper Name|Token Key| Fetch Function| Description| | --- | --- | --- | --- | +|CLAIM_BRANCH_ID|branch_id|getBranchId()|Get the branch ID for which the token was issued.| +|CLAIM_BRANCH_SLUG|branch_slug|getBranchSlug()|Get the branch slug for which the token was issued.| |CLAIM_AUDIENCE|aud|getAudience()|Get targeted audience of the token.| |CLAIM_EXPIRE_AT|exp|getExpireAtTime()|Get the time when the token expires.| |CLAIM_NOT_BEFORE|nbf|getNotBeforeTime()|Get the time when the token starts to be valid.| diff --git a/docs/API.MD b/docs/API.MD index fd4408d..2ec3ce2 100644 --- a/docs/API.MD +++ b/docs/API.MD @@ -112,7 +112,6 @@ Internally used to get value against the client param string. | --- | --- | --- | | claimName | String | The claim name as defined in the tokenDataConsts | -**Kind**: instance method of [SSOTokenData](#markdown-header-new-ssotokendatatokenvals) ### ssoTokenData.getBranchId() ⇒ null ⎮ string Get the branch ID for which the token was issued. diff --git a/package.json b/package.json index 0e29ce9..bf0bd75 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@staffbase/staffbase-plugin-sdk", - "version": "1.3.0", + "version": "1.3.1", "description": "Staffbase Plugin SDK for Javascript / Node.js", "main": "./dist/index.js", "scripts": {