Skip to content

Commit

Permalink
add keyword folder_path for initial content
Browse files Browse the repository at this point in the history
  • Loading branch information
xpgo committed Feb 19, 2021
1 parent 299f589 commit 76a1b1c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ When CTRL+Click a folder, the plugin will create a description note with the pat
- **Index File Name**: For the *Index-File* method, set the folder note name, like `_overview_` or `index`. (Do not use {{FOLDER_NAME}} any more)
- **Note Initial Content**: set the initial content for a new folder note.
- {{FOLDER_NAME}} in the content will be replaced with the folder name.
- {{FOLDER_PATH}} in the content will be replaced with the folder path.
- {{FOLDER_BRIEF}} in the content will be replaced with a card-style overview of current folder.
- {{FOLDER_BRIEF_LIVE}} in the content will be replaced with a tiny code block which will be rendered to the folder overview in real time.
- **Key for New Note**: set to use CTRL+Click or ALT+Click for creating new folder note.
Expand Down Expand Up @@ -79,6 +80,8 @@ Remember to update the plugin, if you find some issues.

### 0.7.x

- add Keyword {{FOLDER_PATH}} for inital content (0.7.1)
- fix multiple usage of some keywords for initial content (0.7.1)
- add imagePrefix key for ccard (0.7.0)
- add noteOnly Key for folder_brief_live (0.7.0)
- fix showing both folder and note for outside mode (0.7.0)
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "folder-note-plugin",
"name": "Folder Note",
"version": "0.7.0",
"version": "0.7.1",
"minAppVersion": "0.9.12",
"description": "Click a folder node to show a note describing the folder.",
"author": "xpgo",
Expand Down
6 changes: 4 additions & 2 deletions src/folder-note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,11 @@ export class FolderNote {

// expand content template
async expandContent(template: string) {
// keyword: {{FOLDER_NAME}}
// keyword: {{FOLDER_NAME}}, {{FOLDER_PATH}}
var folderName = this.folderPath.split('/').pop();
var content = template.replace('{{FOLDER_NAME}}', folderName);
var content = template
.replace(/{{FOLDER_NAME}}/g, folderName)
.replace(/{{FOLDER_PATH}}/g, this.folderPath)
// keyword: {{FOLDER_BRIEF}}
if (content.contains('{{FOLDER_BRIEF}}')) {
let folderBrief = new FolderBrief(this.app);
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"0.6.4": "0.9.7",
"0.6.5": "0.9.7",
"0.6.6": "0.9.7",
"0.7.0": "0.10.13"
"0.7.0": "0.10.13",
"0.7.1": "0.10.13"
}

0 comments on commit 76a1b1c

Please sign in to comment.