diff --git a/src/settings.ts b/src/settings.ts
index 303c5e9..9143bff 100644
--- a/src/settings.ts
+++ b/src/settings.ts
@@ -117,31 +117,27 @@ export class SettingsTab extends PluginSettingTab {
//#region Indexing
- const indexingDesc = new DocumentFragment()
- indexingDesc.createSpan({}, span => {
- span.innerHTML = `⚠️ Changing indexing settings will clear the cache, and requires a restart of Obsidian.
`
- if (textExtractor) {
- span.innerHTML += `
- 👍 You have installed Text Extractor, Omnisearch can use it to index PDFs and images contents.
-
Text extraction only works on desktop, but the cache can be synchronized with your mobile device.`
- } else {
- span.innerHTML += `⚠️ Omnisearch requires Text Extractor to index PDFs and images.`
- }
- })
-
new Setting(containerEl)
.setName('Indexing')
.setHeading()
- .setDesc(indexingDesc)
+ .setDesc(
+ htmlDescription(`⚠️ Changing indexing settings will clear the cache, and requires a restart of Obsidian.
+ ${
+ textExtractor
+ ? `👍 You have installed Text Extractor, Omnisearch can use it to index PDFs and images contents.
+
Text extraction only works on desktop, but the cache can be synchronized with your mobile device.`
+ : `⚠️ Omnisearch requires Text Extractor to index PDFs and images.`
+ }`)
+ )
// PDF Indexing
- const indexPDFsDesc = new DocumentFragment()
- indexPDFsDesc.createSpan({}, span => {
- span.innerHTML = `Omnisearch will use Text Extractor to index the content of your PDFs.`
- })
new Setting(containerEl)
.setName(`PDFs content indexing ${textExtractor ? '' : '⚠️ Disabled'}`)
- .setDesc(indexPDFsDesc)
+ .setDesc(
+ htmlDescription(
+ `Omnisearch will use Text Extractor to index the content of your PDFs.`
+ )
+ )
.addToggle(toggle =>
toggle.setValue(settings.PDFIndexing).onChange(async v => {
await database.clearCache()
@@ -152,13 +148,13 @@ export class SettingsTab extends PluginSettingTab {
.setDisabled(!textExtractor)
// Images Indexing
- const indexImagesDesc = new DocumentFragment()
- indexImagesDesc.createSpan({}, span => {
- span.innerHTML = `Omnisearch will use Text Extractor to OCR your images and index their content.`
- })
new Setting(containerEl)
.setName(`Images OCR indexing ${textExtractor ? '' : '⚠️ Disabled'}`)
- .setDesc(indexImagesDesc)
+ .setDesc(
+ htmlDescription(
+ `Omnisearch will use Text Extractor to OCR your images and index their content.`
+ )
+ )
.addToggle(toggle =>
toggle.setValue(settings.imagesIndexing).onChange(async v => {
await database.clearCache()
@@ -188,16 +184,14 @@ export class SettingsTab extends PluginSettingTab {
.setDisabled(!textExtractor)
// Index filenames of unsupported files
- const indexUnsupportedDesc = new DocumentFragment()
- indexUnsupportedDesc.createSpan({}, span => {
- span.innerHTML = `
- Omnisearch can index filenames of "unsupported" files, such as e.g.
.mp4- or non-extracted PDFs & images.
.mp4+ or non-extracted PDFs & images.
md files, Omnisearch can also index other PLAINTEXT files.txt org csv".md files, Omnisearch can also index other PLAINTEXT files.txt org csv".shift ↵ shortcut, can be useful for mobile device users.`
- })
new Setting(containerEl)
.setName('Show "Create note" button')
- .setDesc(createBtnDesc)
+ .setDesc(
+ htmlDescription(`Shows a button next to the search input, to create a note.
+ Acts the same as the shift ↵ shortcut, can be useful for mobile device users.`)
+ )
.addToggle(toggle =>
toggle.setValue(settings.showCreateButton).onChange(async v => {
settings.showCreateButton = v
@@ -564,14 +551,14 @@ export class SettingsTab extends PluginSettingTab {
//#region HTTP Server
if (!Platform.isMobile) {
- const httpServerDesc = new DocumentFragment()
- httpServerDesc.createSpan({}, span => {
- span.innerHTML = `Omnisearch can be used through a simple HTTP server (more information).`
- })
new Setting(containerEl)
.setName('API Access Through HTTP')
.setHeading()
- .setDesc(httpServerDesc)
+ .setDesc(
+ htmlDescription(
+ `Omnisearch can be used through a simple HTTP server (more information).`
+ )
+ )
new Setting(containerEl)
.setName('Enable the HTTP server')
@@ -643,17 +630,14 @@ export class SettingsTab extends PluginSettingTab {
new Setting(containerEl).setName('Danger Zone').setHeading()
// Ignore diacritics
- const diacriticsDesc = new DocumentFragment()
- diacriticsDesc.createSpan({}, span => {
- span.innerHTML = `Normalize diacritics in search terms. Words like "brûlée" or "žluťoučký" will be indexed as "brulee" and "zlutoucky".