Re-enabling PDF & Image indexing on mobile if Text Extractor is installed
This commit is contained in:
@@ -85,29 +85,29 @@ export class SettingsTab extends PluginSettingTab {
|
|||||||
new Setting(containerEl).setName('Indexing').setHeading()
|
new Setting(containerEl).setName('Indexing').setHeading()
|
||||||
|
|
||||||
if (getTextExtractor()) {
|
if (getTextExtractor()) {
|
||||||
new Setting(containerEl).setDesc(
|
const desc = new DocumentFragment()
|
||||||
'👍 You have installed Text Extractor, Omnisearch will use it to index PDFs and images.'
|
desc.createSpan({}, span => {
|
||||||
)
|
span.innerHTML = `👍 You have installed <a href="https://github.com/scambier/obsidian-text-extractor">Text Extractor</a>, Omnisearch will use it to index PDFs and images.
|
||||||
|
<br />Text extraction only works on desktop, but the cache can be synchronized with your mobile device.`
|
||||||
|
})
|
||||||
|
new Setting(containerEl).setDesc(desc)
|
||||||
} else {
|
} else {
|
||||||
const label = new DocumentFragment()
|
const label = new DocumentFragment()
|
||||||
label.createSpan({}, span => {
|
label.createSpan({}, span => {
|
||||||
span.innerHTML =
|
span.innerHTML = `⚠️ Omnisearch will soon require <a href="https://github.com/scambier/obsidian-text-extractor">Text Extractor</a> to index PDFs and images.
|
||||||
`⚠️ Omnisearch will soon require <a href="https://github.com/scambier/obsidian-text-extractor">Text Extractor</a> to index PDFs and images.
|
|
||||||
You can already install it to get a head start.`
|
You can already install it to get a head start.`
|
||||||
})
|
})
|
||||||
new Setting(containerEl).setDesc(label)
|
new Setting(containerEl).setDesc(label)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PDF Indexing
|
// PDF Indexing
|
||||||
if (!Platform.isMobileApp) {
|
if (!Platform.isMobileApp || getTextExtractor()) {
|
||||||
const indexPDFsDesc = new DocumentFragment()
|
const indexPDFsDesc = new DocumentFragment()
|
||||||
indexPDFsDesc.createSpan({}, span => {
|
indexPDFsDesc.createSpan({}, span => {
|
||||||
span.innerHTML = `Omnisearch will include PDFs in search results.<br>
|
span.innerHTML = `Include PDFs in search results - Will soon depend on Text Extractor.`
|
||||||
⚠️ PDFs first need to be processed. This can take anywhere from a few seconds to 2 minutes, then the resulting text is cached.</li>
|
|
||||||
<strong style="color: var(--text-accent)">Needs a restart to fully take effect.</strong>`
|
|
||||||
})
|
})
|
||||||
new Setting(containerEl)
|
new Setting(containerEl)
|
||||||
.setName('PDF Indexing')
|
.setName(`PDFs Indexing`)
|
||||||
.setDesc(indexPDFsDesc)
|
.setDesc(indexPDFsDesc)
|
||||||
.addToggle(toggle =>
|
.addToggle(toggle =>
|
||||||
toggle.setValue(settings.PDFIndexing).onChange(async v => {
|
toggle.setValue(settings.PDFIndexing).onChange(async v => {
|
||||||
@@ -115,21 +115,14 @@ export class SettingsTab extends PluginSettingTab {
|
|||||||
await saveSettings(this.plugin)
|
await saveSettings(this.plugin)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
// Images Indexing
|
// Images Indexing
|
||||||
if (!Platform.isMobileApp) {
|
|
||||||
const indexImagesDesc = new DocumentFragment()
|
const indexImagesDesc = new DocumentFragment()
|
||||||
indexImagesDesc.createSpan({}, span => {
|
indexImagesDesc.createSpan({}, span => {
|
||||||
span.innerHTML = `Omnisearch will use <a href="https://en.wikipedia.org/wiki/Tesseract_(software)">Tesseract</a> to index images from their text.
|
span.innerHTML = `Include images in search results - Will soon depend on Text Extractor.`
|
||||||
<ul>
|
|
||||||
<li>Only English is supported at the moment.</li>
|
|
||||||
<li>Not all images can be correctly read by the OCR, this feature works best with scanned documents.</li>
|
|
||||||
</ul>
|
|
||||||
<strong style="color: var(--text-accent)">Needs a restart to fully take effect.</strong>`
|
|
||||||
})
|
})
|
||||||
new Setting(containerEl)
|
new Setting(containerEl)
|
||||||
.setName('BETA - Images Indexing')
|
.setName(`Images Indexing`)
|
||||||
.setDesc(indexImagesDesc)
|
.setDesc(indexImagesDesc)
|
||||||
.addToggle(toggle =>
|
.addToggle(toggle =>
|
||||||
toggle.setValue(settings.imagesIndexing).onChange(async v => {
|
toggle.setValue(settings.imagesIndexing).onChange(async v => {
|
||||||
@@ -138,6 +131,7 @@ export class SettingsTab extends PluginSettingTab {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Additional files to index
|
// Additional files to index
|
||||||
const indexedFileTypesDesc = new DocumentFragment()
|
const indexedFileTypesDesc = new DocumentFragment()
|
||||||
indexedFileTypesDesc.createSpan({}, span => {
|
indexedFileTypesDesc.createSpan({}, span => {
|
||||||
|
|||||||
Reference in New Issue
Block a user