#256 - .loom indexing is behind a setting for now
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
import type { CanvasData } from 'obsidian/canvas'
|
||||
import type { AsPlainObject } from 'minisearch'
|
||||
import type MiniSearch from 'minisearch'
|
||||
import { settings } from './settings'
|
||||
|
||||
/**
|
||||
* This function is responsible for extracting the text from a file and
|
||||
@@ -60,7 +61,7 @@ async function getAndMapIndexedDocument(
|
||||
}
|
||||
|
||||
// ** Dataloom plugin **
|
||||
else if (isFileFromDataloomPlugin(path)) {
|
||||
else if (settings.dataloomIndexing && isFileFromDataloomPlugin(path)) {
|
||||
try {
|
||||
const data = JSON.parse(await app.vault.cachedRead(file))
|
||||
// data is a json object, we recursively iterate the keys
|
||||
|
||||
@@ -33,8 +33,10 @@ export interface OmnisearchSettings extends WeightingSettings {
|
||||
indexedFileTypes: string[]
|
||||
/** Enable PDF indexing */
|
||||
PDFIndexing: boolean
|
||||
/** Enable PDF indexing */
|
||||
/** Enable Images indexing */
|
||||
imagesIndexing: boolean
|
||||
/** Enable Dataloom indexing */
|
||||
dataloomIndexing: boolean
|
||||
/** Activate the small 🔍 button on Obsidian's ribbon */
|
||||
ribbonIcon: boolean
|
||||
/** Display the small contextual excerpt in search results */
|
||||
@@ -144,6 +146,23 @@ export class SettingsTab extends PluginSettingTab {
|
||||
)
|
||||
.setDisabled(!getTextExtractor())
|
||||
|
||||
// Dataloom Indexing
|
||||
const indexDataLoomDesc = new DocumentFragment()
|
||||
indexDataLoomDesc.createSpan({}, span => {
|
||||
span.innerHTML = `Include <a href="https://github.com/trey-wallis/obsidian-dataloom">DataLoom</a> <pre style="display:inline">.loom</pre> files in search results
|
||||
<br/>${needsARestart}`
|
||||
})
|
||||
new Setting(containerEl)
|
||||
.setName('DataLoom indexing (beta)')
|
||||
.setDesc(indexDataLoomDesc)
|
||||
.addToggle(toggle =>
|
||||
toggle.setValue(settings.dataloomIndexing).onChange(async v => {
|
||||
settings.dataloomIndexing = v
|
||||
await saveSettings(this.plugin)
|
||||
})
|
||||
)
|
||||
.setDisabled(!getTextExtractor())
|
||||
|
||||
// Additional files to index
|
||||
const indexedFileTypesDesc = new DocumentFragment()
|
||||
indexedFileTypesDesc.createSpan({}, span => {
|
||||
@@ -485,6 +504,7 @@ export const DEFAULT_SETTINGS: OmnisearchSettings = {
|
||||
indexedFileTypes: [] as string[],
|
||||
PDFIndexing: false,
|
||||
imagesIndexing: false,
|
||||
dataloomIndexing: false,
|
||||
splitCamelCase: false,
|
||||
openInNewPane: false,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user