lakelib 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,11 +2,62 @@
2
2
 
3
3
  # Lake
4
4
 
5
- Lake is a browser-based editor that enables writing rich text directly inside of web pages or online applications. It focuses on editing web-friendly content and it is designed to provide better efficiency, stability and extensibility.
5
+ Lake is a rich text editor for the web. It has a good user experience and provides easy-to-use programming interface to allow further extension.
6
6
 
7
7
  ### Getting Started
8
8
 
9
- First, you need to clone the repository and install all necessary dependencies. Then, start a composite server that contains an HTTP service and real-time bundling. You can do this by running the following command in your terminal.
9
+ #### Downloading Lake from CDN
10
+
11
+ Compressed copies of Lake files are available, you can download them from jsDelivr or UNPKG.
12
+
13
+ * jsDelivr: https://www.jsdelivr.com/package/npm/lakelib?path=dist&tab=files
14
+ * UNPKG: https://unpkg.com/browse/lakelib@latest/dist/
15
+
16
+ Note: `lake.min.js` is not built with CodeMirror, so if you need the code block feature, addtioanaly including `codemirror.min.js` to your page is needed. But if you do not need it, there is no need to include external CodeMirror file. To find out more, take a look at the [IIFE example](https://github.com/lakejs/lake/blob/master/examples/iife.html) and [Rollup configuration](https://github.com/lakejs/lake/blob/master/rollup.config.mjs).
17
+
18
+ #### Downloading Lake using npm
19
+
20
+ Lake is registered as a package on npm. You can install the latest version of Lake with the following npm command.
21
+
22
+ ```bash
23
+ npm install lakelib
24
+ ```
25
+
26
+ #### Quick start
27
+
28
+ First, add the following lines of code in the `<head>` of an HTML page.
29
+
30
+ ```html
31
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lakelib@latest/dist/lake.css" />
32
+ <script src="https://cdn.jsdelivr.net/npm/lakelib@latest/dist/lake.min.js"></script>
33
+ ```
34
+
35
+ Then, in the HTML page add the following HTML code that will serve as a placeholder for an editor instance.
36
+
37
+ ```html
38
+ <div class="lake-editor">
39
+ <div class="lake-toolbar-root"></div>
40
+ <div class="lake-root"></div>
41
+ </div>
42
+ ```
43
+
44
+ Finally, call the following JavaScript code to render the editor.
45
+
46
+ ```js
47
+ const editor = new Lake.Editor({
48
+ root: '.lake-root',
49
+ value: '<p><br /><focus /></p>',
50
+ });
51
+ editor.render();
52
+ new Lake.Toolbar({
53
+ editor,
54
+ root: '.lake-toolbar-root',
55
+ }).render();
56
+ ```
57
+
58
+ ### Development
59
+
60
+ To build Lake or change source code, you need to download the repository and start a development server that contains an HTTP service and real-time bundling.
10
61
 
11
62
  ``` bash
12
63
  # clone the repository
@@ -15,13 +66,13 @@ git clone https://github.com/lakejs/lake.git
15
66
  cd lake
16
67
  # install all dependencies
17
68
  pnpm install
18
- # build dependencies
19
- pnpm build
69
+ # build CodeMirror
70
+ pnpm codemirror
20
71
  # start a local server
21
72
  pnpm start
22
73
  ```
23
74
 
24
- You can now view all demos by opening `http://localhost:8080/examples/` URL.
75
+ You can now view all demos by visiting `http://localhost:8080/examples/`.
25
76
 
26
77
  ### Running tests
27
78