Skip to content

Commit

Permalink
Follow Obsidian Style Guide for capitalization (#2289)
Browse files Browse the repository at this point in the history
  • Loading branch information
kepano authored Apr 9, 2024
1 parent 4829a83 commit 582be43
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default class DataviewPlugin extends Plugin {
// Dataview "force refresh" operation.
this.addCommand({
id: "dataview-force-refresh-views",
name: "Force Refresh All Views and Blocks",
name: "Force refresh all views and blocks",
callback: () => {
this.index.revision += 1;
this.app.workspace.trigger("dataview:refresh-views");
Expand All @@ -117,7 +117,7 @@ export default class DataviewPlugin extends Plugin {

this.addCommand({
id: "dataview-drop-cache",
name: "Drop All Cached File Metadata",
name: "Drop all cached file metadata",
callback: () => {
this.index.reinitialize();
},
Expand Down Expand Up @@ -316,10 +316,10 @@ class GeneralSettingsTab extends PluginSettingTab {

public display(): void {
this.containerEl.empty();
this.containerEl.createEl("h2", { text: "General Settings" });
this.containerEl.createEl("h2", { text: "General settings" });

new Setting(this.containerEl)
.setName("Enable Inline Queries")
.setName("Enable inline queries")
.setDesc("Enable or disable executing regular inline Dataview queries.")
.addToggle(toggle =>
toggle
Expand All @@ -328,7 +328,7 @@ class GeneralSettingsTab extends PluginSettingTab {
);

new Setting(this.containerEl)
.setName("Enable JavaScript Queries")
.setName("Enable JavaScript queries")
.setDesc("Enable or disable executing DataviewJS queries.")
.addToggle(toggle =>
toggle
Expand All @@ -337,7 +337,7 @@ class GeneralSettingsTab extends PluginSettingTab {
);

new Setting(this.containerEl)
.setName("Enable Inline JavaScript Queries")
.setName("Enable inline JavaScript queries")
.setDesc(
"Enable or disable executing inline DataviewJS queries. Requires that DataviewJS queries are enabled."
)
Expand All @@ -348,16 +348,16 @@ class GeneralSettingsTab extends PluginSettingTab {
);

new Setting(this.containerEl)
.setName("Enable Inline Field Highlighting in Reading View")
.setDesc("Enables or disables visual highlighting / pretty rendering for inline fields in Reading View.")
.setName("Enable inline field highlighting in reading view")
.setDesc("Enables or disables visual highlighting / pretty rendering for inline fields in reading view.")
.addToggle(toggle =>
toggle
.setValue(this.plugin.settings.prettyRenderInlineFields)
.onChange(async value => await this.plugin.updateSettings({ prettyRenderInlineFields: value }))
);

new Setting(this.containerEl)
.setName("Enable Inline Field Highlighting in Live Preview")
.setName("Enable inline field highlighting in Live Preview")
.setDesc("Enables or disables visual highlighting / pretty rendering for inline fields in Live Preview.")
.addToggle(toggle =>
toggle.setValue(this.plugin.settings.prettyRenderInlineFieldsInLivePreview).onChange(async value => {
Expand All @@ -366,10 +366,10 @@ class GeneralSettingsTab extends PluginSettingTab {
})
);

this.containerEl.createEl("h2", { text: "Codeblock Settings" });
this.containerEl.createEl("h2", { text: "Codeblock settings" });

new Setting(this.containerEl)
.setName("DataviewJS Keyword")
.setName("DataviewJS keyword")
.setDesc(
"Keyword for DataviewJS blocks. Defaults to 'dataviewjs'. Reload required for changes to take effect."
)
Expand All @@ -384,7 +384,7 @@ class GeneralSettingsTab extends PluginSettingTab {
);

new Setting(this.containerEl)
.setName("Inline Query Prefix")
.setName("Inline query prefix")
.setDesc("The prefix to inline queries (to mark them as Dataview queries). Defaults to '='.")
.addText(text =>
text
Expand All @@ -398,7 +398,7 @@ class GeneralSettingsTab extends PluginSettingTab {
);

new Setting(this.containerEl)
.setName("JavaScript Inline Query Prefix")
.setName("JavaScript inline query prefix")
.setDesc("The prefix to JavaScript inline queries (to mark them as DataviewJS queries). Defaults to '$='.")
.addText(text =>
text
Expand All @@ -412,20 +412,20 @@ class GeneralSettingsTab extends PluginSettingTab {
);

new Setting(this.containerEl)
.setName("Codeblock Inline Queries")
.setDesc("If enabled, inline queries will also be evaluated inside full codeblocks.")
.setName("Code block inline queries")
.setDesc("If enabled, inline queries will also be evaluated inside full code blocks.")
.addToggle(toggle =>
toggle
.setValue(this.plugin.settings.inlineQueriesInCodeblocks)
.onChange(async value => await this.plugin.updateSettings({ inlineQueriesInCodeblocks: value }))
);

this.containerEl.createEl("h2", { text: "View Settings" });
this.containerEl.createEl("h2", { text: "View settings" });
this.containerEl.createEl("h3", { text: "General" });

new Setting(this.containerEl)
.setName("Display result count")
.setDesc("If toggled off, the small number in the result header of TASK and TABLE Queries will be hidden.")
.setDesc("If toggled off, the small number in the result header of TASK and TABLE queries will be hidden.")
.addToggle(toggle =>
toggle.setValue(this.plugin.settings.showResultCount).onChange(async value => {
await this.plugin.updateSettings({ showResultCount: value });
Expand All @@ -434,7 +434,7 @@ class GeneralSettingsTab extends PluginSettingTab {
);

new Setting(this.containerEl)
.setName("Warn on Empty Result")
.setName("Warn on empty result")
.setDesc("If set, queries which return 0 results will render a warning message.")
.addToggle(toggle =>
toggle.setValue(this.plugin.settings.warnOnEmptyResult).onChange(async value => {
Expand All @@ -444,7 +444,7 @@ class GeneralSettingsTab extends PluginSettingTab {
);

new Setting(this.containerEl)
.setName("Render Null As")
.setName("Render null as")
.setDesc("What null/non-existent should show up as in tables, by default. This supports Markdown notation.")
.addText(text =>
text
Expand All @@ -457,7 +457,7 @@ class GeneralSettingsTab extends PluginSettingTab {
);

new Setting(this.containerEl)
.setName("Automatic View Refreshing")
.setName("Automatic view refreshing")
.setDesc(
"If enabled, views will automatically refresh when files in your vault change; this can negatively affect" +
" some functionality like embeds in views, so turn it off if such functionality is not working."
Expand All @@ -470,7 +470,7 @@ class GeneralSettingsTab extends PluginSettingTab {
);

new Setting(this.containerEl)
.setName("Refresh Interval")
.setName("Refresh interval")
.setDesc("How long to wait (in milliseconds) for files to stop changing before updating views.")
.addText(text =>
text
Expand All @@ -485,7 +485,7 @@ class GeneralSettingsTab extends PluginSettingTab {
);

let dformat = new Setting(this.containerEl)
.setName("Date Format")
.setName("Date format")
.setDesc(
"The default date format (see Luxon date format options)." +
" Currently: " +
Expand All @@ -508,7 +508,7 @@ class GeneralSettingsTab extends PluginSettingTab {
);

let dtformat = new Setting(this.containerEl)
.setName("Date + Time Format")
.setName("Date + time format")
.setDesc(
"The default date and time format (see Luxon date format options)." +
" Currently: " +
Expand All @@ -530,10 +530,10 @@ class GeneralSettingsTab extends PluginSettingTab {
})
);

this.containerEl.createEl("h3", { text: "Table Settings" });
this.containerEl.createEl("h3", { text: "Table settings" });

new Setting(this.containerEl)
.setName("Primary Column Name")
.setName("Primary column name")
.setDesc(
"The name of the default ID column in tables; this is the auto-generated first column that links to the source file."
)
Expand All @@ -548,7 +548,7 @@ class GeneralSettingsTab extends PluginSettingTab {
);

new Setting(this.containerEl)
.setName("Grouped Column Name")
.setName("Grouped column name")
.setDesc(
"The name of the default ID column in tables, when the table is on grouped data; this is the auto-generated first column" +
"that links to the source file/group."
Expand All @@ -563,14 +563,14 @@ class GeneralSettingsTab extends PluginSettingTab {
})
);

this.containerEl.createEl("h3", { text: "Task Settings" });
this.containerEl.createEl("h3", { text: "Task settings" });

let taskCompletionSubsettingsEnabled = this.plugin.settings.taskCompletionTracking;
let taskCompletionInlineSubsettingsEnabled =
taskCompletionSubsettingsEnabled && !this.plugin.settings.taskCompletionUseEmojiShorthand;

new Setting(this.containerEl)
.setName("Automatic Task Completion Tracking")
.setName("Automatic task completion tracking")
.setDesc(
createFragment(el => {
el.appendText(
Expand All @@ -591,7 +591,7 @@ class GeneralSettingsTab extends PluginSettingTab {
);

let taskEmojiShorthand = new Setting(this.containerEl)
.setName("Use Emoji Shorthand for Completion")
.setName("Use emoji shorthand for completion")
.setDisabled(!taskCompletionSubsettingsEnabled);
if (taskCompletionSubsettingsEnabled)
taskEmojiShorthand
Expand All @@ -607,7 +607,7 @@ class GeneralSettingsTab extends PluginSettingTab {
"Disable this to customize the completion date format or field name, or to use Dataview inline field formatting."
);
el.createEl("br");
el.appendText('Only available when "Automatic Task Completion Tracking" is enabled.');
el.appendText('Only available when "automatic task completion tracking" is enabled.');
})
)
.addToggle(toggle =>
Expand All @@ -617,21 +617,21 @@ class GeneralSettingsTab extends PluginSettingTab {
this.display();
})
);
else taskEmojiShorthand.setDesc('Only available when "Automatic Task Completion Tracking" is enabled.');
else taskEmojiShorthand.setDesc('Only available when "automatic task completion tracking" is enabled.');

let taskFieldName = new Setting(this.containerEl)
.setName("Completion Field Name")
.setName("Completion field name")
.setDisabled(!taskCompletionInlineSubsettingsEnabled);
if (taskCompletionInlineSubsettingsEnabled)
taskFieldName
.setDesc(
createFragment(el => {
el.appendText(
"Text used as inline field key for task completion date when toggling a task's checkbox in a dataview view."
"Text used as inline field key for task completion date when toggling a task's checkbox in a Dataview view."
);
el.createEl("br");
el.appendText(
'Only available when "Automatic Task Completion Tracking" is enabled and "Use Emoji Shorthand for Completion" is disabled.'
'Only available when "automatic task completion tracking" is enabled and "use emoji shorthand for completion" is disabled.'
);
})
)
Expand All @@ -642,16 +642,16 @@ class GeneralSettingsTab extends PluginSettingTab {
);
else
taskFieldName.setDesc(
'Only available when "Automatic Task Completion Tracking" is enabled and "Use Emoji Shorthand for Completion" is disabled.'
'Only available when "automatic task completion tracking" is enabled and "use emoji shorthand for completion" is disabled.'
);

let taskDtFormat = new Setting(this.containerEl)
.setName("Completion Date Format")
.setName("Completion date format")
.setDisabled(!taskCompletionInlineSubsettingsEnabled);
if (taskCompletionInlineSubsettingsEnabled) {
let descTextLines = [
"Date-time format for task completion date when toggling a task's checkbox in a dataview view (see Luxon date format options).",
'Only available when "Automatic Task Completion Tracking" is enabled and "Use Emoji Shorthand for Completion" is disabled.',
"Date-time format for task completion date when toggling a task's checkbox in a Dataview view (see Luxon date format options).",
'Only available when "automatic task completion tracking" is enabled and "use emoji shorthand for completion" is disabled.',
"Currently: ",
];
taskDtFormat
Expand Down Expand Up @@ -692,13 +692,13 @@ class GeneralSettingsTab extends PluginSettingTab {
);
} else {
taskDtFormat.setDesc(
'Only available when "Automatic Task Completion Tracking" is enabled and "Use Emoji Shorthand for Completion" is disabled.'
'Only available when "automatic task completion tracking" is enabled and "use emoji shorthand for completion" is disabled.'
);
}
new Setting(this.containerEl)
.setName("Recursive Sub-Task Completion")
.setName("Recursive sub-task completion")
// I gotta word this better :/
.setDesc("If enabled, completing a task in a DataView will automatically complete its subtasks too.")
.setDesc("If enabled, completing a task in a Dataview will automatically complete its subtasks too.")
.addToggle(toggle =>
toggle
.setValue(this.plugin.settings.recursiveSubTaskCompletion)
Expand Down

0 comments on commit 582be43

Please sign in to comment.