Skip to content

Commit

Permalink
Merge pull request #16 from sidmishraw/issue-15
Browse files Browse the repository at this point in the history
Enhanced the intrinsic parameters by adding in content-root-path, repo-root-path, and absfilepath
  • Loading branch information
sidmishraw authored Apr 29, 2021
2 parents 010cd23 + f3724c4 commit 812050c
Show file tree
Hide file tree
Showing 6 changed files with 2,420 additions and 576 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,24 @@ Additionally, the default configuration for the header templates is:
"${headerEnd}"
]
}
},
{
"xml": {
"headerBegin": "<!--",
"headerPrefix": "*",
"headerEnd": "-->",
"template": [
"${headerBegin}",
"${headerPrefix} @FileName ${fileName}",
"${headerPrefix} @PathFromRepositoryRoot ${pathFromRepositoryRoot}",
"${headerPrefix} @AbsPath ${absFilePath}",
"${headerPrefix} @RepositoryRootPath ${repositoryRootPath}",
"${headerPrefix} @Created ${author} ${createdDate}",
"${headerPrefix} @Modified ${author} ${lastModifiedDate}",
"${headerPrefix} @Description ${description}",
"${headerEnd}"
]
}
}
]
```
Expand Down Expand Up @@ -132,6 +150,7 @@ Defaults to:

```javascript
'[ ]*\\@last\\-modified\\s*.?\\s+((\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}\\.\\d{3})Z([\\+\\-]?\\d{2}:\\d{2}))\\n*';

```

> Note: This configuration is dependent on the `topper.lastModified` and `topper.dateFormat` values, please make sure that both are in sync, otherwise Topper will not be able to capture the last modified field in the header and update the timestamp.
Expand All @@ -142,6 +161,7 @@ Defaults to:

```javascript
'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]Z';

```

> Note: Please make sure that the last date modified regex is also in sync to the changes made to date format, otherwise Topper will not be able to automatically update the last modified timestamp in the header.
Expand All @@ -166,6 +186,12 @@ Topper has the following intrinsic template parameters. The values of these para

- `fileVersion` - The VSCode maintained file version.

- `pathFromRepositoryRoot` - The path of the file from the current workspace (or project) root. For example, if you're working on file `/project/dir1/file1.xml` then this will give `dir1/file1.xml`. This is a relative path from your workspace's root.

- `absFilePath` - This is the absolute path of the file obtained by querying the underlying OS Filesystem.

- `repositoryRootPath` - This is the root path of the workspace (or repository or project).

## Defining a custom keyboard shortcut

To define a custom keyboard shortcut do the following:
Expand Down
Loading

0 comments on commit 812050c

Please sign in to comment.