Skip to content

Commit 26c8260

Browse files
committed
Updating README to point users to the CDN
1 parent 327c64c commit 26c8260

1 file changed

Lines changed: 30 additions & 24 deletions

File tree

README.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,34 @@ standard dialogs for "File > Open" and "File > Save as..." and "File > Save"
88
then this is the module for you. If you have more advanced needs, you will
99
need a different toolkit.
1010

11+
## Usage
12+
13+
Import the relevant files into your page. You can use a CDN, like so:
14+
```html
15+
<!-- The main file, essential: -->
16+
<script src='https://cdn.jsdelivr.net/gh/lurchmath/cloud-storage@v1.0.0/cloud-storage.js'></script>
17+
<!-- If you want the Dropbox backend, which you probably do: -->
18+
<script src='https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js'></script>
19+
<script src='https://cdn.jsdelivr.net/gh/lurchmath/cloud-storage@v1.0.0/dropbox-backend.js'></script>
20+
<!-- If you want the LocalStorage backend also: -->
21+
<script src='https://cdn.jsdelivr.net/gh/lurchmath/cloud-storage@v1.0.0/localstorage-backend.js'></script>
22+
```
23+
24+
Call `openFile()` or `saveFile()`. That's it! Obviously, you'll want to
25+
pass parameters to those functions to customize what to save or what to do
26+
with opened files, so you should see the example in the next section, or the
27+
documented source code for those two functions, about half way through
28+
[cloud-storage.js](cloud-storage.js).
29+
30+
## Example
31+
32+
See the [simple test
33+
page](http://lurchmath.github.io/cloud-storage/test.html) for an example of
34+
how the various storage options and functions work.
35+
36+
The source code for that page [is documented with
37+
comments](https://github.com/lurchmath/cloud-storage/blob/master/test.html).
38+
1139
## Status
1240

1341
Right now three data storage backends are supported.
@@ -24,31 +52,9 @@ Right now three data storage backends are supported.
2452

2553
To add a new backend, mimic the work done in
2654
[dropbox-backend.js](dropbox-backend.js) and create your own backend.
55+
Cloud storage providers besides Dropbox are welcome!
2756

28-
## Example
29-
30-
See the [simple test
31-
page](http://lurchmath.github.io/cloud-storage/test.html) for an example of
32-
how the various storage options and functions work.
33-
34-
The source code for that page [is documented with
35-
comments](https://github.com/lurchmath/cloud-storage/blob/master/test.html).
36-
37-
## Usage
38-
39-
Import [cloud-storage.js](cloud-storage.js) into your page. If you want to
40-
use the Dropbox backend, you'll need to also import
41-
[the Dropbox SDK](https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js) and
42-
[dropbox-backend.js](dropbox-backend.js) (in that order).
43-
44-
Call `openFile()` or `saveFile()`. That's it! Obviously, you'll want to
45-
pass parameters to those functions to customize what to save or what to do
46-
with opened files, so you should see the documented source code for those
47-
two functions, about half way through [cloud-storage.js](cloud-storage.js).
48-
49-
## Status
50-
51-
There are a few things that need to be improved about this project.
57+
There are other things that could be improved about this project.
5258
See [the to-do list](TODO.md) for details.
5359

5460
## License

0 commit comments

Comments
 (0)