From dd1bc788aa1e1368f4af7ba8431d2cac31faead6 Mon Sep 17 00:00:00 2001 From: Sambhav Gupta Date: Tue, 17 Oct 2023 12:41:32 +0530 Subject: [PATCH 01/13] chore(docs): initialising docs in website github actions --- .github/workflows/update-docs-in-website.yml | 50 ++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/update-docs-in-website.yml diff --git a/.github/workflows/update-docs-in-website.yml b/.github/workflows/update-docs-in-website.yml new file mode 100644 index 0000000..85ffc1b --- /dev/null +++ b/.github/workflows/update-docs-in-website.yml @@ -0,0 +1,50 @@ +name: Update latest Extensions documentation in the website + +on: + push: + branches: + - 'master' + paths: + - 'docs/*.md' + +jobs: + Make-PR: + name: Make PR on website repository with updated latest Extensions documentation + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + steps: + - name: Checkout Current repository + uses: actions/checkout@v3 + with: + path: extensions + - name: Checkout Another repository + uses: actions/checkout@v3 + with: + repository: asyncapi/website + path: website + token: ${{ env.GITHUB_TOKEN }} + - name: Config git + run: | + git config --global user.name asyncapi-bot + git config --global user.email info@asyncapi.io + - name: Create branch + working-directory: ./website + run: | + git checkout -b update-extensions-docs-${{ github.sha }} + - name: Copy extensions folder from Current Repo to Another + working-directory: ./website + run: | + mkdir -p ./pages/docs/reference/extensions + printf "%s\ntitle: Extensions\nweight: 10\n%s" "---" "---"> ../extensions-catalog/extensions/_section.md + mv ../extensions-catalog/extensions/*.md ./pages/docs/reference/extensions + - name: Commit and push + working-directory: ./website + run: | + git add . + git commit -m "docs(extension): update latest extensions docs" + git push https://${{ env.GITHUB_TOKEN }}@github.com/asyncapi/website + - name: Create PR + working-directory: ./website + run: | + gh pr create --title "docs(extensions): update latest extensions documentation" --body "Updated extensions documentation is available and this PR introduces update to extensions folder on the website" --head "update-extensions-docs-${{ github.sha }}" \ No newline at end of file From f2849b1ed24f7586047e5aff19cceeb1ebaae52e Mon Sep 17 00:00:00 2001 From: Sambhav Gupta Date: Thu, 9 Nov 2023 01:04:48 +0530 Subject: [PATCH 02/13] added script to change config file --- .github/workflows/update-docs-in-website.yml | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/update-docs-in-website.yml b/.github/workflows/update-docs-in-website.yml index 85ffc1b..2cbf8f4 100644 --- a/.github/workflows/update-docs-in-website.yml +++ b/.github/workflows/update-docs-in-website.yml @@ -38,6 +38,33 @@ jobs: mkdir -p ./pages/docs/reference/extensions printf "%s\ntitle: Extensions\nweight: 10\n%s" "---" "---"> ../extensions-catalog/extensions/_section.md mv ../extensions-catalog/extensions/*.md ./pages/docs/reference/extensions + - name: + working-directory: ./website + run: + - uses: actions/github-script@v4 + with: + script: | + const { writeFile } = require('fs'); + var slug = { + "value": "reference/extensions/", + "href": "https://github.com/asyncapi/extensions-catalog/tree/master/extensions" + }; + const data = require('./config/edit-page-config.json'); + const checkSlug="reference/extensions/" + flag=0; + data.map(function (item){ + if(item.value==checkSlug) flag=1; + }) + if(flag==0){ + data.push(slug); + const path = './config/edit-page-config.json'; + writeFile(path, JSON.stringify(data,null,2), (error) => { + if (error) { + console.log('An error has occurred ', error); + return; + } + }) + } - name: Commit and push working-directory: ./website run: | From 0184a3ed4a91cb2ae407492c9d859d8bfad2e69a Mon Sep 17 00:00:00 2001 From: Sambhav Gupta Date: Thu, 9 Nov 2023 10:46:25 +0530 Subject: [PATCH 03/13] feat: added script to edit title and weight --- .github/workflows/update-docs-in-website.yml | 29 ++++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-docs-in-website.yml b/.github/workflows/update-docs-in-website.yml index 2cbf8f4..f3ed68b 100644 --- a/.github/workflows/update-docs-in-website.yml +++ b/.github/workflows/update-docs-in-website.yml @@ -38,10 +38,9 @@ jobs: mkdir -p ./pages/docs/reference/extensions printf "%s\ntitle: Extensions\nweight: 10\n%s" "---" "---"> ../extensions-catalog/extensions/_section.md mv ../extensions-catalog/extensions/*.md ./pages/docs/reference/extensions - - name: + - name: Update edit-page-config.json + uses: actions/github-script@v4 working-directory: ./website - run: - - uses: actions/github-script@v4 with: script: | const { writeFile } = require('fs'); @@ -65,6 +64,30 @@ jobs: } }) } + - name: Update title and weight + uses: actions/github-script@v4 + working-directory: ./website + with: + script: | + const fs = require('fs'); + const path = require('path'); + const filePath = 'pages/docs/reference/extensions/twitter.md'; + const baseName=path.basename(filePath,'.md') + console.log(baseName) + const newData = `---\ntitle: '${baseName}' \nweight: 10\n---\n\n`; + + fs.readFile(filePath, 'utf8', (err, data) => { + if (err) { + console.error(err); + } else { + const updatedContent = newData + data; + fs.writeFile(filePath, updatedContent, (err) => { + if (err) { + console.error(err); + } + }); + } + }); - name: Commit and push working-directory: ./website run: | From 6b98bdb2b03aa532c1f3380d05779b063879dba7 Mon Sep 17 00:00:00 2001 From: Sambhav Gupta Date: Thu, 9 Nov 2023 11:33:38 +0530 Subject: [PATCH 04/13] feat: updated the script --- .github/workflows/update-docs-in-website.yml | 39 +++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/.github/workflows/update-docs-in-website.yml b/.github/workflows/update-docs-in-website.yml index f3ed68b..205ce26 100644 --- a/.github/workflows/update-docs-in-website.yml +++ b/.github/workflows/update-docs-in-website.yml @@ -40,8 +40,8 @@ jobs: mv ../extensions-catalog/extensions/*.md ./pages/docs/reference/extensions - name: Update edit-page-config.json uses: actions/github-script@v4 - working-directory: ./website with: + working-directory: ./website script: | const { writeFile } = require('fs'); var slug = { @@ -66,28 +66,39 @@ jobs: } - name: Update title and weight uses: actions/github-script@v4 - working-directory: ./website with: script: | const fs = require('fs'); const path = require('path'); - const filePath = 'pages/docs/reference/extensions/twitter.md'; - const baseName=path.basename(filePath,'.md') - console.log(baseName) - const newData = `---\ntitle: '${baseName}' \nweight: 10\n---\n\n`; - - fs.readFile(filePath, 'utf8', (err, data) => { + const folderPath = 'extensions'; + fs.readdir(folderPath, (err, files) => { if (err) { - console.error(err); + console.error('Error reading the folder:', err); } else { - const updatedContent = newData + data; - fs.writeFile(filePath, updatedContent, (err) => { - if (err) { + files.forEach((file,ind=10) => { + + const filePath = path.join(folderPath, file); + const baseName=path.basename(filePath,'.md') + + console.log(baseName) + const newData = `---\ntitle: '${baseName}' \nweight: ${ind+11}\n---\n\n`; + + fs.readFile(filePath, 'utf8', (err, data) => { + if (err) { + console.error(err); + } else { + const updatedContent = newData + data; + fs.writeFile(filePath, updatedContent, (err) => { + if (err) { console.error(err); - } + } + }); + } + }); + }); } - }); + }); - name: Commit and push working-directory: ./website run: | From 9fbd4984c0f79a1535389fe3d5120d70dcd7c0e4 Mon Sep 17 00:00:00 2001 From: Sambhav Gupta Date: Sat, 11 Nov 2023 15:26:18 +0530 Subject: [PATCH 05/13] feat: added the script for edititng title and weight of the markdown files --- .github/workflows/update-docs-in-website.yml | 94 ++++++++------------ 1 file changed, 36 insertions(+), 58 deletions(-) diff --git a/.github/workflows/update-docs-in-website.yml b/.github/workflows/update-docs-in-website.yml index 205ce26..ad5585f 100644 --- a/.github/workflows/update-docs-in-website.yml +++ b/.github/workflows/update-docs-in-website.yml @@ -3,9 +3,9 @@ name: Update latest Extensions documentation in the website on: push: branches: - - 'master' + - "master" paths: - - 'docs/*.md' + - "docs/*.md" jobs: Make-PR: @@ -17,7 +17,7 @@ jobs: - name: Checkout Current repository uses: actions/checkout@v3 with: - path: extensions + path: extensions-catalog - name: Checkout Another repository uses: actions/checkout@v3 with: @@ -32,73 +32,51 @@ jobs: working-directory: ./website run: | git checkout -b update-extensions-docs-${{ github.sha }} - - name: Copy extensions folder from Current Repo to Another - working-directory: ./website - run: | - mkdir -p ./pages/docs/reference/extensions - printf "%s\ntitle: Extensions\nweight: 10\n%s" "---" "---"> ../extensions-catalog/extensions/_section.md - mv ../extensions-catalog/extensions/*.md ./pages/docs/reference/extensions - name: Update edit-page-config.json uses: actions/github-script@v4 with: - working-directory: ./website script: | - const { writeFile } = require('fs'); - var slug = { - "value": "reference/extensions/", + const { writeFile } = require('fs').promises; + const configPath = './website/config/edit-page-config.json'; + const checkSlug = 'reference/extensions/'; + const slug = { + "value": checkSlug, "href": "https://github.com/asyncapi/extensions-catalog/tree/master/extensions" }; - const data = require('./config/edit-page-config.json'); - const checkSlug="reference/extensions/" - flag=0; - data.map(function (item){ - if(item.value==checkSlug) flag=1; - }) - if(flag==0){ - data.push(slug); - const path = './config/edit-page-config.json'; - writeFile(path, JSON.stringify(data,null,2), (error) => { - if (error) { - console.log('An error has occurred ', error); - return; - } - }) - } - - name: Update title and weight + + const configData = require(configPath); + const entryExists = configData.some(entry => entry.value === checkSlug); + if (!entryExists) { + configData.push(slug); + await writeFile(configPath, JSON.stringify(configData, null, 2)) + } + - name: Update title and weight of the markdown files uses: actions/github-script@v4 with: script: | const fs = require('fs'); const path = require('path'); - const folderPath = 'extensions'; - fs.readdir(folderPath, (err, files) => { - if (err) { - console.error('Error reading the folder:', err); - } else { - files.forEach((file,ind=10) => { - - const filePath = path.join(folderPath, file); - const baseName=path.basename(filePath,'.md') - - console.log(baseName) - const newData = `---\ntitle: '${baseName}' \nweight: ${ind+11}\n---\n\n`; - - fs.readFile(filePath, 'utf8', (err, data) => { - if (err) { - console.error(err); - } else { - const updatedContent = newData + data; - fs.writeFile(filePath, updatedContent, (err) => { - if (err) { - console.error(err); - } - }); - } - }); - + const folderPath = 'extensions'; + await fs.readdir(folderPath, (err, files) => { + files.forEach((file, ind = 10) => { + const filePath = path.join(folderPath, file); + const baseName = path.basename(filePath, '.md') + + const newData = `---\ntitle: '${baseName}' \nweight: ${ind + 11}\n---\n\n`; + + fs.readFile(filePath, 'utf8', (err, data) => { + const updatedContent = newData + data; + fs.writeFile(filePath, updatedContent, () => { + }); }); - } + }); }); + - name: Copy extensions folder from Current Repo to Another + working-directory: ./website + run: | + mkdir -p ./pages/docs/reference/extensions + printf "%s\ntitle: Extensions\nweight: 10\n%s" "---" "---"> ../extensions-catalog/extensions/_section.md + mv ../extensions-catalog/extensions/*.md ./pages/docs/reference/extensions - name: Commit and push working-directory: ./website run: | @@ -108,4 +86,4 @@ jobs: - name: Create PR working-directory: ./website run: | - gh pr create --title "docs(extensions): update latest extensions documentation" --body "Updated extensions documentation is available and this PR introduces update to extensions folder on the website" --head "update-extensions-docs-${{ github.sha }}" \ No newline at end of file + gh pr create --title "docs(extensions): update latest extensions documentation" --body "Updated extensions documentation is available and this PR introduces update to extensions folder on the website" --head "update-extensions-docs-${{ github.sha }}" From 9b1b5a3d09959033af796bc8256b7816efb483ba Mon Sep 17 00:00:00 2001 From: Sambhav Gupta <81870866+sambhavgupta0705@users.noreply.github.com> Date: Sat, 11 Nov 2023 15:28:45 +0530 Subject: [PATCH 06/13] feat: added the script to edit the title and weight of the markdown files --- .github/workflows/update-docs-in-website.yml | 94 ++++++++------------ 1 file changed, 36 insertions(+), 58 deletions(-) diff --git a/.github/workflows/update-docs-in-website.yml b/.github/workflows/update-docs-in-website.yml index 205ce26..ad5585f 100644 --- a/.github/workflows/update-docs-in-website.yml +++ b/.github/workflows/update-docs-in-website.yml @@ -3,9 +3,9 @@ name: Update latest Extensions documentation in the website on: push: branches: - - 'master' + - "master" paths: - - 'docs/*.md' + - "docs/*.md" jobs: Make-PR: @@ -17,7 +17,7 @@ jobs: - name: Checkout Current repository uses: actions/checkout@v3 with: - path: extensions + path: extensions-catalog - name: Checkout Another repository uses: actions/checkout@v3 with: @@ -32,73 +32,51 @@ jobs: working-directory: ./website run: | git checkout -b update-extensions-docs-${{ github.sha }} - - name: Copy extensions folder from Current Repo to Another - working-directory: ./website - run: | - mkdir -p ./pages/docs/reference/extensions - printf "%s\ntitle: Extensions\nweight: 10\n%s" "---" "---"> ../extensions-catalog/extensions/_section.md - mv ../extensions-catalog/extensions/*.md ./pages/docs/reference/extensions - name: Update edit-page-config.json uses: actions/github-script@v4 with: - working-directory: ./website script: | - const { writeFile } = require('fs'); - var slug = { - "value": "reference/extensions/", + const { writeFile } = require('fs').promises; + const configPath = './website/config/edit-page-config.json'; + const checkSlug = 'reference/extensions/'; + const slug = { + "value": checkSlug, "href": "https://github.com/asyncapi/extensions-catalog/tree/master/extensions" }; - const data = require('./config/edit-page-config.json'); - const checkSlug="reference/extensions/" - flag=0; - data.map(function (item){ - if(item.value==checkSlug) flag=1; - }) - if(flag==0){ - data.push(slug); - const path = './config/edit-page-config.json'; - writeFile(path, JSON.stringify(data,null,2), (error) => { - if (error) { - console.log('An error has occurred ', error); - return; - } - }) - } - - name: Update title and weight + + const configData = require(configPath); + const entryExists = configData.some(entry => entry.value === checkSlug); + if (!entryExists) { + configData.push(slug); + await writeFile(configPath, JSON.stringify(configData, null, 2)) + } + - name: Update title and weight of the markdown files uses: actions/github-script@v4 with: script: | const fs = require('fs'); const path = require('path'); - const folderPath = 'extensions'; - fs.readdir(folderPath, (err, files) => { - if (err) { - console.error('Error reading the folder:', err); - } else { - files.forEach((file,ind=10) => { - - const filePath = path.join(folderPath, file); - const baseName=path.basename(filePath,'.md') - - console.log(baseName) - const newData = `---\ntitle: '${baseName}' \nweight: ${ind+11}\n---\n\n`; - - fs.readFile(filePath, 'utf8', (err, data) => { - if (err) { - console.error(err); - } else { - const updatedContent = newData + data; - fs.writeFile(filePath, updatedContent, (err) => { - if (err) { - console.error(err); - } - }); - } - }); - + const folderPath = 'extensions'; + await fs.readdir(folderPath, (err, files) => { + files.forEach((file, ind = 10) => { + const filePath = path.join(folderPath, file); + const baseName = path.basename(filePath, '.md') + + const newData = `---\ntitle: '${baseName}' \nweight: ${ind + 11}\n---\n\n`; + + fs.readFile(filePath, 'utf8', (err, data) => { + const updatedContent = newData + data; + fs.writeFile(filePath, updatedContent, () => { + }); }); - } + }); }); + - name: Copy extensions folder from Current Repo to Another + working-directory: ./website + run: | + mkdir -p ./pages/docs/reference/extensions + printf "%s\ntitle: Extensions\nweight: 10\n%s" "---" "---"> ../extensions-catalog/extensions/_section.md + mv ../extensions-catalog/extensions/*.md ./pages/docs/reference/extensions - name: Commit and push working-directory: ./website run: | @@ -108,4 +86,4 @@ jobs: - name: Create PR working-directory: ./website run: | - gh pr create --title "docs(extensions): update latest extensions documentation" --body "Updated extensions documentation is available and this PR introduces update to extensions folder on the website" --head "update-extensions-docs-${{ github.sha }}" \ No newline at end of file + gh pr create --title "docs(extensions): update latest extensions documentation" --body "Updated extensions documentation is available and this PR introduces update to extensions folder on the website" --head "update-extensions-docs-${{ github.sha }}" From 2fc4e3816ac480eda81b60a7505df5295867b260 Mon Sep 17 00:00:00 2001 From: Sambhav Gupta Date: Tue, 14 Nov 2023 17:16:33 +0530 Subject: [PATCH 07/13] feat: github actions to introduce extensions in the website --- .github/workflows/update-docs-in-website.yml | 23 ++++++++------------ 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/update-docs-in-website.yml b/.github/workflows/update-docs-in-website.yml index ad5585f..8f89c8b 100644 --- a/.github/workflows/update-docs-in-website.yml +++ b/.github/workflows/update-docs-in-website.yml @@ -54,22 +54,17 @@ jobs: uses: actions/github-script@v4 with: script: | - const fs = require('fs'); + const fs = require('fs').promises; const path = require('path'); const folderPath = 'extensions'; - await fs.readdir(folderPath, (err, files) => { - files.forEach((file, ind = 10) => { - const filePath = path.join(folderPath, file); - const baseName = path.basename(filePath, '.md') - - const newData = `---\ntitle: '${baseName}' \nweight: ${ind + 11}\n---\n\n`; - - fs.readFile(filePath, 'utf8', (err, data) => { - const updatedContent = newData + data; - fs.writeFile(filePath, updatedContent, () => { - }); - }); - }); + const files = await fs.readdir(folderPath); + files.forEach(async (file, ind = 10) => { + const filePath = path.join(folderPath, file); + const baseName = path.basename(filePath, '.md'); + const newData = `---\ntitle: '${baseName}' \nweight: ${ind + 11}\n---\n\n`; + const existingFileData = await fs.readFile(filePath, 'utf8'); + const updatedContent = newData + existingFileData; + await fs.writeFile(filePath, updatedContent); }); - name: Copy extensions folder from Current Repo to Another working-directory: ./website From e8e724a37a56a474910048e1c2caa4e7a0347513 Mon Sep 17 00:00:00 2001 From: Sambhav Gupta Date: Tue, 14 Nov 2023 17:17:53 +0530 Subject: [PATCH 08/13] feat: GH action to introduce extensions Signed-off-by: Sambhav Gupta --- .github/workflows/update-docs-in-website.yml | 4 +- extensions/asd.md | 30 ++++++++++ extensions/kndasnc.md | 60 ++++++++++++++++++++ extensions/twitter.md | 43 ++++++-------- test.js | 17 ++++++ 5 files changed, 126 insertions(+), 28 deletions(-) create mode 100644 extensions/asd.md create mode 100644 extensions/kndasnc.md create mode 100644 test.js diff --git a/.github/workflows/update-docs-in-website.yml b/.github/workflows/update-docs-in-website.yml index 8f89c8b..600e943 100644 --- a/.github/workflows/update-docs-in-website.yml +++ b/.github/workflows/update-docs-in-website.yml @@ -5,7 +5,7 @@ on: branches: - "master" paths: - - "docs/*.md" + - "extensions/*.md" jobs: Make-PR: @@ -56,7 +56,7 @@ jobs: script: | const fs = require('fs').promises; const path = require('path'); - const folderPath = 'extensions'; + const folderPath = './extensions-catalog/extensions'; const files = await fs.readdir(folderPath); files.forEach(async (file, ind = 10) => { const filePath = path.join(folderPath, file); diff --git a/extensions/asd.md b/extensions/asd.md new file mode 100644 index 0000000..474ab5a --- /dev/null +++ b/extensions/asd.md @@ -0,0 +1,30 @@ +--- +title: 'asd' +weight: 11 +--- + +--- +title: 'asd' +weight: 11 +--- + +--- +title: 'asd' +weight: 11 +--- + +--- +title: 'asd' +weight: 11 +--- + +--- +title: 'asd' +weight: 11 +--- + +--- +title: 'asd' +weight: 11 +--- + diff --git a/extensions/kndasnc.md b/extensions/kndasnc.md new file mode 100644 index 0000000..7b2ff61 --- /dev/null +++ b/extensions/kndasnc.md @@ -0,0 +1,60 @@ +--- +title: 'kndasnc' +weight: 12 +--- + +--- +title: 'kndasnc' +weight: 12 +--- + +--- +title: 'kndasnc' +weight: 12 +--- + +--- +title: 'kndasnc' +weight: 12 +--- + +--- +title: 'kndasnc' +weight: 12 +--- + +--- +title: 'kndasnc' +weight: 12 +--- + +--- +title: 'kndasnc' +weight: 12 +--- + +--- +title: 'kndasnc' +weight: 12 +--- + +--- +title: 'kndasnc' +weight: 12 +--- + +--- +title: 'kndasnc' +weight: 12 +--- + +null--- +title: 'kndasnc' +weight: 12 +--- + +--- +title: 'kndasnc' +weight: 12 +--- + diff --git a/extensions/twitter.md b/extensions/twitter.md index 48c0d03..18b3ff3 100644 --- a/extensions/twitter.md +++ b/extensions/twitter.md @@ -1,26 +1,17 @@ -# Twitter Extension -This document defines how to use `twitter` extension in AsyncAPI documents. - -## Overview -This extension allows you to provide the Twitter username of the account representing the team/company of the API. - -## Extension Definition - -### Type: String - -Name of the Twitter username. - -## Extension Location - -This extension can be used in the following locations: -- [Info Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#infoObject) - -## Example - -```yaml -asyncapi: '2.6.0' -info - title: Strretlights Kafka API - version: '1.0.0' - x-twitter: StreetLightData -``` +--- +title: 'twitter' +weight: 13 +--- + +--- +title: 'twitter' +weight: 13 +--- + +--- +title: 'twitter' +weight: 13 +--- + +sdffhskfglnvsdf +gsdghdf \ No newline at end of file diff --git a/test.js b/test.js new file mode 100644 index 0000000..d5e4adf --- /dev/null +++ b/test.js @@ -0,0 +1,17 @@ + +const fs = require('fs').promises; +const path = require('path'); + +async function dummy() { + const folderPath = 'extensions'; + const files = await fs.readdir(folderPath); + files.forEach(async (file, ind = 10) => { + const filePath = path.join(folderPath, file); + const baseName = path.basename(filePath, '.md'); + const newData = `---\ntitle: '${baseName}' \nweight: ${ind + 11}\n---\n\n`; + const existingFileData = await fs.readFile(filePath, 'utf8'); + const updatedContent = newData + existingFileData; + await fs.writeFile(filePath, updatedContent); + }); +} +dummy(); \ No newline at end of file From de774c2e8a9cbb2e6ed198423e5afa4027a8ffdc Mon Sep 17 00:00:00 2001 From: Sambhav Gupta <81870866+sambhavgupta0705@users.noreply.github.com> Date: Tue, 14 Nov 2023 17:27:20 +0530 Subject: [PATCH 09/13] Delete test.js --- test.js | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 test.js diff --git a/test.js b/test.js deleted file mode 100644 index d5e4adf..0000000 --- a/test.js +++ /dev/null @@ -1,17 +0,0 @@ - -const fs = require('fs').promises; -const path = require('path'); - -async function dummy() { - const folderPath = 'extensions'; - const files = await fs.readdir(folderPath); - files.forEach(async (file, ind = 10) => { - const filePath = path.join(folderPath, file); - const baseName = path.basename(filePath, '.md'); - const newData = `---\ntitle: '${baseName}' \nweight: ${ind + 11}\n---\n\n`; - const existingFileData = await fs.readFile(filePath, 'utf8'); - const updatedContent = newData + existingFileData; - await fs.writeFile(filePath, updatedContent); - }); -} -dummy(); \ No newline at end of file From e4a9949e11958c080d712761fc1ef2e2a1c49da1 Mon Sep 17 00:00:00 2001 From: Sambhav Gupta <81870866+sambhavgupta0705@users.noreply.github.com> Date: Tue, 14 Nov 2023 17:27:52 +0530 Subject: [PATCH 10/13] Delete extensions/kndasnc.md --- extensions/kndasnc.md | 60 ------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 extensions/kndasnc.md diff --git a/extensions/kndasnc.md b/extensions/kndasnc.md deleted file mode 100644 index 7b2ff61..0000000 --- a/extensions/kndasnc.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: 'kndasnc' -weight: 12 ---- - ---- -title: 'kndasnc' -weight: 12 ---- - ---- -title: 'kndasnc' -weight: 12 ---- - ---- -title: 'kndasnc' -weight: 12 ---- - ---- -title: 'kndasnc' -weight: 12 ---- - ---- -title: 'kndasnc' -weight: 12 ---- - ---- -title: 'kndasnc' -weight: 12 ---- - ---- -title: 'kndasnc' -weight: 12 ---- - ---- -title: 'kndasnc' -weight: 12 ---- - ---- -title: 'kndasnc' -weight: 12 ---- - -null--- -title: 'kndasnc' -weight: 12 ---- - ---- -title: 'kndasnc' -weight: 12 ---- - From e56da4ede2c6dc198ac64f085206a6d122351515 Mon Sep 17 00:00:00 2001 From: Sambhav Gupta <81870866+sambhavgupta0705@users.noreply.github.com> Date: Tue, 14 Nov 2023 17:28:05 +0530 Subject: [PATCH 11/13] Delete extensions/asd.md --- extensions/asd.md | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 extensions/asd.md diff --git a/extensions/asd.md b/extensions/asd.md deleted file mode 100644 index 474ab5a..0000000 --- a/extensions/asd.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: 'asd' -weight: 11 ---- - ---- -title: 'asd' -weight: 11 ---- - ---- -title: 'asd' -weight: 11 ---- - ---- -title: 'asd' -weight: 11 ---- - ---- -title: 'asd' -weight: 11 ---- - ---- -title: 'asd' -weight: 11 ---- - From 0c9ea63646ad84d633f7bd5f67ccb56e29a4c60f Mon Sep 17 00:00:00 2001 From: Sambhav Gupta <81870866+sambhavgupta0705@users.noreply.github.com> Date: Tue, 14 Nov 2023 17:28:54 +0530 Subject: [PATCH 12/13] Update twitter.md --- extensions/twitter.md | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/extensions/twitter.md b/extensions/twitter.md index 18b3ff3..48c0d03 100644 --- a/extensions/twitter.md +++ b/extensions/twitter.md @@ -1,17 +1,26 @@ ---- -title: 'twitter' -weight: 13 ---- - ---- -title: 'twitter' -weight: 13 ---- - ---- -title: 'twitter' -weight: 13 ---- - -sdffhskfglnvsdf -gsdghdf \ No newline at end of file +# Twitter Extension +This document defines how to use `twitter` extension in AsyncAPI documents. + +## Overview +This extension allows you to provide the Twitter username of the account representing the team/company of the API. + +## Extension Definition + +### Type: String + +Name of the Twitter username. + +## Extension Location + +This extension can be used in the following locations: +- [Info Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#infoObject) + +## Example + +```yaml +asyncapi: '2.6.0' +info + title: Strretlights Kafka API + version: '1.0.0' + x-twitter: StreetLightData +``` From efc5c5f9acf72dbe7fbe84e5ffa5e6238f30ab39 Mon Sep 17 00:00:00 2001 From: Sambhav Gupta Date: Tue, 14 Nov 2023 17:30:59 +0530 Subject: [PATCH 13/13] renaming the action --- ...pdate-docs-in-website.yml => update-extensions-in-website.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{update-docs-in-website.yml => update-extensions-in-website.yml} (100%) diff --git a/.github/workflows/update-docs-in-website.yml b/.github/workflows/update-extensions-in-website.yml similarity index 100% rename from .github/workflows/update-docs-in-website.yml rename to .github/workflows/update-extensions-in-website.yml