Skip to content

Commit

Permalink
Merge pull request #190 from neild3r/tag-table-script
Browse files Browse the repository at this point in the history
Add a script to facilitate adding tags to the README.md
  • Loading branch information
neild3r committed Sep 7, 2021
2 parents 903adc1 + d5e71a4 commit 3ea0a38
Show file tree
Hide file tree
Showing 9 changed files with 328 additions and 270 deletions.
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ out/src/**
!out/src/extension.js.map
test/**
src/**
scripts/**
**/*.map
.travis.yml
.gitignore
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
All notable changes to the "php-docblocker" extension will be documented in this file.

## [Unreleased]

### Operational
- Add auto-merge to release workflow
- Create release using bot token
- Make tests run on push only
- Convert `updateChangelog.js` script to use typescript
- Convert `updateChangelog.js` script to use typescript
- Add script to generate the table of tags for the README.md

## [2.4.0] - 2021-09-05
- Add support for params which have a trailing comma
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ and can be triggered by typing @ then another characted (Provided your vscode se
| @abstract | @abstract |
| @after | @after |
| @afterClass | @afterClass |
| @author | @author \${1:name} <${2:email}> |
| @author | @author ${1:name} <${2:email}> |
| @backupGlobals | @backupGlobals ${1:switch} |
| @backupStaticAttributes | @backupStaticAttributes ${1:switch} |
| @before | @before |
Expand All @@ -131,7 +131,7 @@ and can be triggered by typing @ then another characted (Provided your vscode se
| @codeCoverageIgnore | @codeCoverageIgnore |
| @codeCoverageIgnoreEnd | @codeCoverageIgnoreEnd |
| @codeCoverageIgnoreStart | @codeCoverageIgnoreStart |
| @copyright | @copyright ${1:2018} ${2:Name} |
| @copyright | @copyright ${1:2021} ${2:Name} |
| @covers | @covers ${1:fqcn} |
| @coversDefaultClass | @coversDefaultClass ${1:fqcn} |
| @coversNothing | @coversNothing |
Expand All @@ -152,10 +152,10 @@ and can be triggered by typing @ then another characted (Provided your vscode se
| @link | @link ${1:http://url.com} |
| @medium | @medium |
| @method | @method ${1:mixed} ${2:methodName()} |
| @mixin | @mixin ${1:\Class} |
| @mixin | @mixin ${1:\MyClass} |
| @package | @package ${1:category} |
| @param | @param ${1:mixed} $${2:name} |
| @preserveGlobalState | @preserveGlobalState |
| @preserveGlobalState | @preserveGlobalState ${1:switch} |
| @property | @property ${1:mixed} $${2:name} |
| @property-read | @property-read ${1:mixed} $${2:name} |
| @property-write | @property-write ${1:mixed} $${2:name} |
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"@vscode/test-web": "^0.0.7",
"coveralls": "^3.1.1",
"esbuild": "^0.12.19",
"markdown-table-ts": "^1.0.3",
"mocha": "^9.0.3",
"nyc": "^14.0.0",
"typescript": "^3.9.10",
Expand Down
27 changes: 27 additions & 0 deletions scripts/generateTagTable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as fs from 'fs';
import Tags from "../src/tags";
import { getMarkdownTable } from 'markdown-table-ts';

let tags = new Tags();

let formatted: string[][] = [];
tags.list.forEach(tag => {
formatted.push([tag.tag, tag.snippet]);
});

let table = getMarkdownTable({
table: {
head: ['Tag', 'Snippet'],
body: formatted
},
});

console.log('');
console.log(table);
console.log('');

fs.writeFile('./out/TAGS.md', table, 'utf8', function (err) {
if (err) {
throw err;
}
});
2 changes: 0 additions & 2 deletions scripts/updateChangelog.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import * as fs from 'fs';

const version = process.env.npm_package_version
Expand Down

0 comments on commit 3ea0a38

Please sign in to comment.