Skip to content

Commit

Permalink
Merge pull request #35 from ryanjamurphy/AddHeading
Browse files Browse the repository at this point in the history
Made prefix configurable for the new review heading feature.
  • Loading branch information
ryanjamurphy authored Nov 3, 2023
2 parents de27261 + 8f2dd49 commit c75c57f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions data.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"dailyNotesFolder": "",
"reviewSectionHeading": "## Review",
"linePrefix": "- ",
"headingPrefix": "",
"defaultReviewDate": "tomorrow",
"blockLinePrefix": "!"
}
15 changes: 15 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ interface IReviewSettings {
dailyNotesFolder: string;
reviewSectionHeading: string;
linePrefix: string;
headingPrefix: string;
defaultReviewDate: string;
blockLinePrefix: string;
}
Expand All @@ -13,6 +14,7 @@ const DEFAULT_SETTINGS: IReviewSettings = {
dailyNotesFolder: "",
reviewSectionHeading: "## Review",
linePrefix: "- ",
headingPrefix: "",
defaultReviewDate: "tomorrow",
blockLinePrefix: "!",
}
Expand Down Expand Up @@ -208,6 +210,7 @@ export default class Review extends Plugin {
if (heading) {
heading = heading.replace(/^#(#*) /gm, "");
noteLink = noteLink + "#" + heading;
reviewLinePrefix = this.settings.headingPrefix;
}

break;
Expand Down Expand Up @@ -368,6 +371,18 @@ class ReviewSettingTab extends PluginSettingTab {
plugin.saveData(plugin.settings);
})
);
new Setting(containerEl)
.setName('Heading prefix')
.setDesc('Set the prefix to use for reviewed headings. You probably want this to be a - bulleted list item or an ! embed.')
.addText((text) =>
text
.setPlaceholder('- ')
.setValue(plugin.settings.headingPrefix)
.onChange((value) => {
plugin.settings.headingPrefix = value;
plugin.saveData(plugin.settings);
})
);
new Setting(containerEl)
.setName('Block review line prefix')
.setDesc('Set the prefix used when adding blocks to daily notes with Review. Use e.g., `- [ ] ` to link the block as a task, or `!` to create embeds.')
Expand Down

0 comments on commit c75c57f

Please sign in to comment.