Overview

Incremental Search

Chemr has fuzzy matched incremental search. You can query any old how.

On-demand Indexers

Chemr includes indexing system for generating index. You can index any web sites on your demand.

Built on Electron

Chemr is developed with standard web technologies: HTML, CSS, JavaScript. So you can modify this very easily.

Screenshots

OS X

Windows

Download

Build from source

Or create your own build with following:

Install Development Tools

You must install node.js and git.

Install Electron and Build Tools

npm -g install electron-prebuilt electron-packager electron-builder

Clone Repository

git clone https://github.com/cho45/Chemrtron.git

Package

sh dev/package.sh

Packaged application is located under build/releases

Packaged release

For Mac

Download on the App Store

For Windows or Mac

Download on GitHub

Usage

Introduction

  1. Enable indexer at settings dialog.
  2. Start initial indexing by selecting icon.
  3. Ready to query.

Select Index

Press Control + Enter to open select index dialog.

Or Alt + [Number] / Command + [Number] for selecting index directly.

Keyboard shortcuts

Alt + Space (Global) Default shortcut key for activating Chemr window. This is customizable on settings.
⌘L
Control + L
Focus to query text area.
Control + N
Select next item.
Control + P
Select previous item.
Control + U Clear current query.
⌘↵
Control + Enter
Open index selection dialog.
⌘[
Control + [
Back navigation.
⌘]
Control + ]
Forward navigation.
⌘[Numer]
Control + [Number]
Select index by index.

Reindex by hand

To reindex by hand for updating to latest index. Right click or double click index icon and open menu by clicking gear icon.

Including Indexers

Or you can write new indexer easily.

Create New Indexer

The indexer definition files is written in JavaScript and load from following paths:

  1. $HOME/.chemr/indexers/*.js
  2. $APP_ROOT/indexers/*.js

You can put your own indexer to $HOME/.chemer/indexers/.

Indexer definition file

This is a sample indexer definition for PHP:


indexer = {
	id: 'php',
	name: 'PHP',

	index : function (ctx) {
		return ctx.fetchDocument('http://www.php.net/manual/en/indexes.functions.php', { srcdoc: true }).then(function (document) {
			console.log(document);

			var links = document.querySelectorAll('a.index');
			for (var i = 0, it; (it = links[i]); i++) {
				ctx.pushIndex(it.textContent, it.href);
			}
		});
	}
};
id : string
Unique identifier for this indexer.
name : string
Display name. This is also used for indexer search.
index : function(ctx: IndexerContext):Promise<string | null>
A function for creating index. Index data is following format:
[Search string]\t[URI]
[Search string]\t[URI]
...

Or you can use pushIndex() on IndexerContext instead of returning string.

beforeSearch : function(query : string): string
A function for query translator.
item : function(item: Item):Item
Callback of item called when item will be shown.

IndexerContext

IndexerContext is passed as index() argument.

pushIndex(name: string, url: string)
Add specified index to current context index. You do not return any value from a promise returned from index(). Chemr will generate index string from current context index.
fetchDocument(url: string: opts: Object):Promise<HTMLDocument>

Fetche a URL and create HTMLDocument.

Specified URL is loaded to sandboxed iframe (scripting is disabled).

You may encounter with error when the target URL issues X-Frame-Options header. This is restriction of iframe. You can ignore that error with specifing srcdoc: true option to opts.

With srcdoc: true option, fetchDocument() fetches a URL by fetchText() and set its result to iframe's srcdoc attribute and append <base> element with target URL to document.head. This means document.URL is not more usable (this may be about:srcdoc). But you can load URLs which uses X-Frame-Options.

fetchJSON(url: string):Promise<any>
Fetch a URL by fetchText() and parse with JSON.parse.
fetchText(url: string):Promise<string>
Fetche a URL and just resolves with its responseText.
fetchAsXHR(opts: Object):Promise<XMLHttpRequest>
This is raw method for fetch*.
crawl(list: Array, callback: function (url, doc: HTMLDocument):void):Promise<any>

crawl can crawl specified list which is array of URLs and call callback with its document.

callback function is called with special this object which has pushPage(url) method. pushPage(url) adds to url to current crawl queue.

Contributing

Chemr is open source project. You can read whole code and submit patch any time.

If you can contribute to Chemr, see also CONTRIBUTING.md.

Supports

Report to github issue.

Privacy Policy

Chemr does not collect any privacy information of users.