file-headerOverviewFile Header VSCode extension allows adding a heading to the currently active document. Although it’s not on feature parity, and most likely it won’t ever be, this extension is a conceptual fork of Psioniq File Header; reimplementing most useful features while adding some extras. If your work revolves around multiple companies, with multiple conventions or requirements you will love the automatic variable value detection capabilities of this extension. Why bother creating just another heading extensionWhile there are multiple extensions solving the same problem, each has it's trade-offs. Most require extensive configuration and are unable to offer all required template interpolations, some do - but lack any automatization, and some are nearly perfect. To better understand where i’m coming from, you could give Psioniq File Header a try and see if it fits your needs. It was the main inspiration source of the current extension. FeaturesThe list of supported configurations can better illustrate the supported options, but at a glance:
CommandsThis extension adds the following commands to VSCode:
VariablesThe following pre defined variables are supported in template interpolation, keep in mind custom variables can be defined and referenced by identifier: | Variable Name | Description | |---|---| | date | The current date as yyyy-MMM-dd | | time | The current time as HH:mm:ss | | filepath | The fully-qualified name of the file | | filerelativepath | Relative path to the current file within the project (include the file name) | | filename | Current file name (including extension) | | filenamebase | Current file name (excluding extension) | | projectpath | The fully-qualified name of the project/workspace root directory | | projectname | Package.json displayName or name properties value or the projectpath basename if both properites are missing | | projectversion | Package.json version property value | | company | The name of your company or employer as configured or license file detected (coming soon) | | author | Specified author name, or SCM determined author, or OS full user name or username | | authoremail | Specified author email, or SCM determined email | | licensetext | The full text of the license determined either based on the SPDX ID or the contents of the referenced license file | | licensename | Name of the license, will default to Custom for custom licenses | | licenseurl | Url for the license, will default to '' for custom licenses | | spdxid | SPDX License ID as provided in the license fild of package.json or custom for custom licenses | FunctionsThe following functions are supported in heading templates: | Function Name | Arguments | Description | |---|---|---| | dateformat | (format?: string) | Formats the current date based on the provided date-fns format. | | filecreated | (format?: string) | Formats the file creation date based on the provided date-fns format. | Extension SettingsThis extension contributes the following settings:
Release Notes0.0.1Initial release of File Header adding the base functionality and some of the intended automations. |