Obsidian site

This commit is contained in:
Simon Cambier
2024-06-02 10:38:15 +02:00
parent 066f801d08
commit 9fadeea251
17 changed files with 279 additions and 0 deletions

4
Doc Omnisearch/.obsidian/app.json vendored Normal file
View File

@@ -0,0 +1,4 @@
{
"promptDelete": false,
"alwaysUpdateLinks": true
}

View File

@@ -0,0 +1,3 @@
{
"accentColor": ""
}

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,31 @@
{
"file-explorer": true,
"global-search": true,
"switcher": true,
"graph": true,
"backlink": true,
"canvas": true,
"outgoing-link": true,
"tag-pane": true,
"page-preview": true,
"daily-notes": true,
"templates": true,
"note-composer": true,
"command-palette": true,
"slash-command": false,
"editor-status": true,
"starred": true,
"markdown-importer": false,
"zk-prefixer": false,
"random-note": false,
"outline": true,
"word-count": true,
"slides": false,
"audio-recorder": false,
"workspaces": false,
"file-recovery": true,
"publish": true,
"sync": false,
"bookmarks": true,
"properties": false
}

View File

@@ -0,0 +1,21 @@
[
"file-explorer",
"global-search",
"switcher",
"graph",
"backlink",
"canvas",
"outgoing-link",
"tag-pane",
"page-preview",
"daily-notes",
"templates",
"note-composer",
"command-palette",
"editor-status",
"bookmarks",
"outline",
"word-count",
"file-recovery",
"publish"
]

6
Doc Omnisearch/.obsidian/publish.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"siteId": "acc8393c0b7bc1b0e51b5c295861835f",
"host": "publish-01.obsidian.md",
"included": [],
"excluded": []
}

View File

@@ -0,0 +1,13 @@
There are several CSS classes you can use to customize the appearance of Omnisearch.
```css
.omnisearch-modal
.omnisearch-result
.omnisearch-result__title
.omnisearch-result__counter
.omnisearch-result__body
.omnisearch-highlight
.omnisearch-input-container
.omnisearch-input-field
```
*This is list is not exhaustive, some classes might be added as Omnisearch is evolving.*

View File

@@ -0,0 +1,37 @@
Omnisearch is designed to be as unobtrusive as possible. Install it, let it index your vault, and it works.
It is quite different than the core search plugin, and is not intended to replace it. ==**It's a tool to help you find your notes as fast as possible**==. If you're well organized, know what is in your vault and where each note is located, it won't probably be very useful to you.
But if your vault looks like a messy desk full of scattered papers and post-it notes, Omnisearch might be the tool you need.
## Omnisearch contexts
### Vault Search
Omnisearch's core feature, accessible with the Command Palette "**_Omnisearch: Vault search_**". This modal searches through your vault and returns the most relevant documents. That's all you need to find a note.
If you want to list all the search matches of a single note, you can do so by using `tab` to open the **In-File Search**.
### In-File Search
Also accessible through the Command Palette "**_Omnisearch: In-file search_**". This modal searches through the active note's content and lists the matching results. Press enter to automatically scroll to the right place.
Note that this modal is unavailable if your active file is not a Markdown document.
## Efficiently looking for documents
Omnisearch maintains an index of words from your notes. When you type in a query, it compares the words from your query to the words in its index, and returns the most relevant notes.
> [!IMPORTANT] The best queries are the most spontaneous
> A good query should contain the "important" words of the note you're trying to find. Important words are the first words that come to your mind when you think about a note.
They're the ones in the filename, directory, in the titles, that are often repeated throughout the note, or quite unique to it.
While Omnisearch does not have the advanced features of the core search, there are a few options you can use to filter results.
## Advanced tips
- Use `path:"<somepath>"` to restrict your results to corresponding paths
- Use `ext:"png jpg"` or `ext:png`, or a plain `.png` to specify the filetype(s)
- Use `"exact expressions"` in quotes to further filter the results returned by the query
- Use `-exclusions` to exclude notes containing certain words

View File

@@ -0,0 +1,3 @@
Omnisearch can index PDFs, images, and some Microsoft Office documents with the help of [Text Extractor](https://github.com/scambier/obsidian-text-extractor). You can install this plugin, and enable the relevant settings.
Keep in mind that extracting text from those files is not guaranteed. At the time of writing, many PDFs don't work with Text Extractor.

29
Doc Omnisearch/Index.md Normal file
View File

@@ -0,0 +1,29 @@
**Omnisearch** is a search engine that "_just works_". It always instantly shows you the most relevant results, thanks to its smart weighting algorithm.
## Installation
- Omnisearch is available on [the official Community Plugins repository](https://obsidian.md/plugins?search=Omnisearch).
- Beta releases can be installed through [BRAT](https://github.com/TfTHacker/obsidian42-brat). **Be advised that those versions can be buggy and break things.**
> [!INFO] Chinese, Japanese, Korean, ...
> If you have notes in a CJK language, you should install [this additional plugin](https://github.com/aidenlx/cm-chs-patch)
## Documentation
- [[How to use Omnisearch]]
- [[Images, PDFs, and non-text documents]]
- [[Public API & URL Scheme]]
- [[Inject Omnisearch results into your search engine]]
- [[Issues & Solutions]]
## LICENSE
Omnisearch is licensed under [GPL-3](https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3)). You're welcome to fork it and use its code in your own project, but you must disclose your code and publish it under the same terms.
## Thanks
❤ To all people who donate through [Ko-Fi](https://ko-fi.com/scambier)or [Github Sponsors](https://github.com/sponsors/scambier), to code contributors, and to Obsidian who graciously provides this Publish space ❤
If you wish to get involved in Omnisearch's development, there are [open issues](https://github.com/scambier/obsidian-omnisearch/issues) that need to be solved, and probably several of them tagged as "[good first issue](https://github.com/scambier/obsidian-omnisearch/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)" :)
![JetBrains Logo (Main) logo](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)

View File

@@ -0,0 +1,26 @@
It is possible to get Omnisearch results into your favorite Internet search engine, to increase discoverability of your notes.
## How-to
1. Install the latest version of [Omnisearch](https://obsidian.md/plugins?search=Omnisearch)
2. Enable the HTTP server in Omnisearch settings ![[Pasted image 20231015195107.png]]
3. Install [Tampermonkey](https://www.tampermonkey.net/) (or another userscript manager) for your browser
4. Install the userscript corresponding to your favorite search engine:
- [Kagi](https://github.com/scambier/userscripts/raw/master/dist/obsidian-omnisearch-kagi.user.js)
- [Google](https://github.com/scambier/userscripts/raw/master/dist/obsidian-omnisearch-google.user.js)
- [DuckDuckGo](https://github.com/scambier/userscripts/raw/master/dist/obsidian-omnisearch-ddg.user.js)
- [Bing](https://github.com/scambier/userscripts/raw/master/dist/obsidian-omnisearch-bing.user.js)
> [!question] Userscripts
> [Userscripts](https://en.wikipedia.org/wiki/Userscript) are "micro plugins" for your browser, they're small hackable JavaScript programs intended to modify the appearance or behavior of some sites.
> [!info] HTTP Server
> More info on Omnisearch's HTTP server [[Public API & URL Scheme#HTTP Server API|here]].
## Demos
![[Pasted image 20231015190539.png]]
<small>Omnisearch results injected in Google</small>
![[Pasted image 20231016173131.png]]
<small>Omnisearch results injected in Kagi</small>

View File

@@ -0,0 +1,36 @@
Despite our best efforts, we unfortunately can't totally prevent bugs and performance issues. Those few tips should hopefully help you fix Omnisearch.
**Omnisearch makes Obsidian sluggish/freeze at startup.**
- While Omnisearch does its best to work smoothly in the background, bigger vaults and files can make Obsidian stutter during indexing.
- If you have several thousands of files, Obsidian may freeze a few seconds at startup while its cache is loaded in memory.
- To avoid boot loop crashes, Omnisearch will automatically disable its cache if there is an issue at startup.
**Omnisearch crashes on Android/iOS.**
- If you have many notes, Omnisearch can consume more RAM than what is available on your device. This can cause hard crashes, and there is no solution other than to disable Omnisearch.
- iOS devices are more prone to crashes when loading the cache. For this reason, caching is disabled on iOS.
**Omnisearch seems to make Obsidian slower.**
- Once Obsidian has indexed your files at startup, it doesn't do any background work while its modal is closed. Your changes are not indexed until you open the modal again. If you experience slowdowns while using Obsidian, it's unlikely that Omnisearch is responsible.
- However, Text Extractor can make Obsidian slower while indexing PDFs and images for the first time. If you don't need those features, you can disable them in the plugin settings.
**Omnisearch is slow to index my PDFs and images**
- The first time Text Extractor reads those files, it can take a long time to extract their text. The results are then cached for the text startup.
**Omnisearch gives inconsistent/invalid results, there are errors in the developer console**
- Restart Obsidian to force a reindex of Omnisearch.
- The cache could be corrupted; you can clear it at the bottom of the settings page, then restart Obsidian.
**A query should return a result that does not appear.**
- If applicable, make sure that "*Ignore diacritics*" is enabled.
- If you have modified them, reset weightings to their original values.
- Rewrite your query and avoid numbers and common words.
**I'm still having an issue**
You can write your issue [here](https://github.com/scambier/obsidian-omnisearch/issues) with as much details as possible.

View File

@@ -0,0 +1,69 @@
For technical users and plugins developers, Omnisearch exposes several utilities to integrate it into other plugins or 3rd party tools.
## URL Scheme
You can open Omnisearch and trigger a search with the following scheme: `obsidian://omnisearch?query=foo bar`. This will switch the focus to Obsidian, open Omnisearch, and execute the query "foo bar".
## Omnisearch API
Access it directly within Obsidian with the global `omnisearch` object.
```ts
// API:
type OmnisearchApi = {
// Returns a promise that will contain the same results as the Vault modal
search: (query: string) => Promise<ResultNoteApi[]>,
// Refreshes the index
refreshIndex: () => Promise<void>
// Register a callback that will be called when the indexing is done
registerOnIndexed: (callback: () => void) => void,
// Unregister a callback that was previously registered
unregisterOnIndexed: (callback: () => void) => void,
}
type ResultNoteApi = {
score: number
vault: string
path: string
basename: string
foundWords: string[]
matches: SearchMatchApi[]
excerpt: string
}
type SearchMatchApi = {
match: string
offset: number
}
```
### Example: Dataview Integration
You can use the Omnisearch API directly within the [Dataview](https://blacksmithgu.github.io/obsidian-dataview/) plugin.
~~~js
```dataviewjs
const results = await omnisearch.search('your query')
const arr = dv.array(results).sort(r => r.score, 'desc')
dv.table(['File', 'Score'], arr.map(o => [dv.fileLink(o.path), Math.round(o.score)]))
```
~~~
## HTTP Server API
For our most tech-savvy users, Omnisearch comes with a simple HTTP server. That makes it possible to query Omnisearch from 3rd-party applications running on your computer.
```
GET http://localhost:51361/search?q=your%20query
```
This will return a JSON array of `ResultNoteApi`, exactly like the "internal" API.
> [!Important]
> The HTTP Server must be activated in Omnisearch settings. It is not accessible outside of localhost. The server is automatically stopped when closing Obsidian.
>
> This feature is not available on mobile.
**Usage example: [[Inject Omnisearch results into your search engine]]**

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.