Remove link to README.html (and PDF)
[mkws-moved-to-github.git] / doc / index.markdown
1 % MKWS: the MasterKey Widget Set
2 <!---% Mike Taylor
3 % June 2014-->
4
5
6 Add metasearching to your web-site painlessly
7 ---------------------------------------------
8
9 The MasterKey Widget Set provides the easiest possible way to enhance
10 an existing web-site with customised searching across multiple
11 sources, ranking and merging the results.
12
13 As much of the searching functionality as possible is hosted on
14 <http://mkws.indexdata.com/> so that very simple applications such as
15 <http://example.indexdata.com/simple.html> can have MasterKey
16 searching with minimal effort.  All you need to do is pull in our
17 JavaScript and optional stylesheet, then add `<div>`s to your page
18 that have special `class` attributes. We do the rest.
19
20 Supported Browsers
21 ------------------
22
23 Any modern browser will work fine. JavaScript must be enabled.
24
25 * IE8 or later
26 * Firefox 17 or later
27 * Google Chrome 27 or later
28 * Safari 6 or later
29 * Opera  12 or later
30 * iOS 6.x (iPhone, iPad)
31 * Android 4.x
32
33 Not supported: IE6, IE7
34
35 A minimal example
36 -----------------
37
38 Here is a completely functional (though ugly) MKWS-based
39 searching application:
40
41         <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
42         <div class="mkwsSearch"></div>
43         <div class="mkwsResults"></div>
44
45 That's it. A complete metasearching application. Everything
46 else is refinement.
47
48 Configuring a client (short version)
49 ------------------------------------
50
51 The application's HTML must contains the following elements as well as
52 whatever makes up the application itself:
53
54 Prerequisites:
55
56 ~~~
57         <link rel="stylesheet" href="http://mkws.indexdata.com/mkws.css" />
58         <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
59 ~~~
60
61 Then the following special `<div>`s can be added (with no content), and
62 will be filled in by MKWS:
63
64 * `<div id="mkwsSwitch"></div>` -- switch between record and target views
65 * `<div id="mkwsLang"></div>  ` -- switch between English, Danish and German
66 * `<div id="mkwsSearch"></div>` -- search box and button
67 * `<div id="mkwsResults"></div>` -- result list, including pager/sorting
68 * `<div id="mkwsTargets"></div>` -- target list, including status
69 * `<div id="mkwsStat"></div>` -- summary statistics
70
71 You can configure and control the client by creating an `mkws_config`
72 object before loading the widget-set. Here is an example showing how
73 to use options to offer a choice between English and German UI
74 languages, and to default to sorting by title ascending:
75
76 ~~~
77     <script type="text/javascript">
78       var mkws_config = {
79         lang_options: ["en", "de" ],
80         sort_default: "title:1"
81       };
82     </script>
83 ~~~
84
85 For much more detail, see:
86 [Embedded metasearching with the MasterKey Widget Set](mkws-manual.html)
87
88 Documentation
89 -------------
90
91 * This file.
92   [<a href="index.pdf">PDF version</a>]
93 * The <a href="mkws-manual.html">MKWS manual, including a reference section.</a>
94   [<a href="mkws-manual.pdf">PDF version</a>]
95 * The <a href="mkws-developer.html">MKWS developers' guide.</a>
96   [<a href="mkws-developer.pdf">PDF version</a>]
97
98 Tools
99 -----
100
101 Here are the files that this web-site provides:
102
103 * <a href="mkws.js">mkws.js</a> --
104   JavaScript code that powers the MasterKey Widget Set
105 * <a href="pazpar2/js/pz2.js">pazpar2/js/pz2.js</a> --
106   Low-level JavaScript library for access to the MasterKey web
107   service.
108 * <a href="handlebars-v2.0.0.js">handlebars-v2.0.0.js</a> --
109   A local copy of
110   <a href="http://handlebarsjs.com/">the Handlebars templating library</a>,
111   since it doesn't like to be hotlinked.
112 * Local copy of <a href="jquery-1.10.0.min.js">jquery-1.10.0.min.js</a>
113 * Local copy of <a href="jquery.json-2.4.js">jquery.json-2.4.js</a>
114 * <a href="mkws-complete.js">mkws-complete.js</a> --
115   A single large JavaScript file containing everything needed for
116   MKWS to work: the widget-set itself, the API library, and
117   the prerequisites jQuery and Handlebars.
118 * <a href="mkws.css">mkws.css</a> --
119   A stylesheet which styles only MasterKey widgets, and does not
120   otherwise interfere with application-site's styles.
121 * <a href="mkws-jquery.js">mkws-jquery.js</a> --
122   An experimental jQuery plugin that provides an MKWS-based
123   metasearching applet.
124
125 Minified versions of the MKWS JavaScript files are also available:
126
127 * <a href="mkws.min.js">mkws.min.js</a>
128 * <a href="mkws-complete.min.js">mkws-complete.min.js</a>
129
130 ### Specific versions
131
132 The links above to the various forms of the widget-set JavaScript
133 (<a href="mkws.js">mkws.js</a>,
134 <a href="mkws-complete.js">mkws-complete.js</a>,
135 <a href="mkws.min.js">mkws.min.js</a>
136 and
137 <a href="mkws-complete.min.js">mkws-complete.min.js</a>)
138 are always to the current versions of those
139 files. Applications that rely on a particular version can
140 instead use the specific numbered versions in
141 <a href="releases/">the releases area</a>,
142 for example
143 <a href="releases/mkws-0.9.1.js">releases/mkws-0.9.1.js</a>.
144
145 The current version number is always in
146 <a href="VERSION">the VERSION file</a>.
147
148 Version history is in
149 <a href="NEWS">the NEWS file</a>.
150
151 Examples using the widget-set
152 -----------------------------
153
154 It's worth viewing the source of these to see how small they
155 are and how various things are done.
156
157 ### Simple examples
158
159 * A very simple application at
160   <a href="//example.indexdata.com/simple.html"
161        >//example.indexdata.com/simple.html</a>.
162 * <a href="//example.indexdata.com/minimal.html"
163        >The absolutely minimal application</a>
164   listed above.
165 * <a href="//example.indexdata.com/language.html"
166        >A more detailed version</a>
167   that contains a configuration structure instead of accepting the
168   defaults. Includes a custom translation option to present the
169   application in Arabic.
170 * <a href="//example.indexdata.com/mobile.html"
171        >A version suitable for mobile devices</a>,
172   with a responsive design that moves components around depending on
173   the screen size.
174
175 ### Advanced examples
176
177 * An application that
178   <a href="//example.indexdata.com/lowlevel.html"
179        >uses lower-level MKWS components</a>
180   rather than the all-in-one `#mkwsResults` division,
181   allowing it to use a rather different layout.
182 * An application that specifies how to display brief and full records
183   <a href="//example.indexdata.com/templates.html"
184        >using Handlebar templates</a>.
185   (Read about
186   <a href="http://handlebarsjs.com/"
187        >the templating language</a>.)
188 * An application that
189   <a href="http://example.indexdata.com/images.html?q=portrait"
190        >displays thumbnail images</a>.
191 * <a href="//example.indexdata.com/localauth.html"
192        >An application that uses a local authentication regime</a>,
193   and the corresponding
194   <a href="//example.indexdata.com/apache-config.txt"
195        >Apache2 configuration stanza</a>.
196 * <a href="//example.indexdata.com/popup.html"
197        >A version that uses a jQuery popup</a>.
198
199 ### Non-standard interfaces
200
201 * <a href="//example.indexdata.com/dict.html"
202        >An application that uses MKWS to find dictionary
203   definitions of words when you highlight them</a>.
204 * <a href="//example.indexdata.com/auto.html"
205        >An application that runs an automatic search on load</a>.
206 * An existing web-site,
207   <a href="http://sagp.miketaylor.org.uk/"
208        >The Self-Appointed Grammar Police</a>,
209   which has been fitted with an MKWS searching widget.
210   (See also the MKWS-widget customisations in
211   <a href="http://sagp.miketaylor.org.uk/style.css"
212        >that site's stylesheet</a>.)
213 <!---
214 * Another existing web-site,
215   <a href="http://zthes.z3950.org/"
216        >The Zthes specifications</a>,
217   which has been fitted with a popup MKWS search-box.
218 -->
219
220 Target selection
221 ----------------
222
223 MKWS comes pre-configured to search in a set of a dozen or so
224 open-access targets, as a proof of concept. But you'll want
225 to use it to search your own selection of targets -- some open
226 access, some subscription.
227
228 We can set that up for you: email us on
229 <a href="mailto:info@indexdata.com"
230                >info@indexdata.com</a>.
231
232 - - -
233
234 Copyright (&copy;) 2013-2014 Index Data ApS.
235 <a href="http://indexdata.com">`http://indexdata.com`</a>