Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made prefix configurable for the new review heading feature. #35

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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