A document viewer; fuzzy match incremental search.
Chemrtron is Chemr on Electron.
- Create index on-demand
- Same incremental search user interface to all document
Chemrtron is built with Electron.
npm -g install electron-prebuilt
git clone https://github.com/cho45/Chemrtron.git
cd Chemrtron
electron .
- ~/.chemer/indexers/*.js
- ./indexers/*.js
Unique id of this indexer.
Display name of this indexer;
Callback of item called when item will be shown.
A function for query translator.
A function which returns Promise instance of index data.
Index data is following format:
[Search string]\t[URI]
[Search string]\t[URI]
...
Created index data is cached under ./cache as a file.
pushIndex
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
fetches 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
fetches a URL by fetchText()
and parse with JSON.parse
.
fetchText
fetches a URL and just resolves with its responseText
.
fetchAsXHR
is raw method for fetch*
.
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.
See CONTRIBUTING.md
Chemrtron has 2 browser window (by Electron). One of them is main viewer window and another one is for indexing window which is hidden.
The indexing window is shown under development mode which is switched by settings or menu (View -> Toggle Developer Tools).
A main window and an indexing window is communicate with IPC via Electron main process. (there is no direct connection between them)
- Updaste
ChangeLog
- Edit
VERSION
file to increment version git commit -a
andgit push
to uploaded to githubmake release
creates packages, tag origin/master and upload packages to github releases.