Browse Source

doc updates

Anatoly Pulyaevskiy 5 years ago
parent
commit
cd5ac39599
6 changed files with 20 additions and 29 deletions
  1. 1
    10
      README.md
  2. 1
    1
      doc/concepts/attributes.md
  3. 1
    1
      doc/concepts/data-and-document.md
  4. 8
    9
      doc/concepts/heuristics.md
  5. 1
    1
      doc/faq.md
  6. 8
    7
      doc/quick-start.md

+ 1
- 10
README.md View File

7
 
7
 
8
 [issue tracker]: https://github.com/memspace/zefyr/issues
8
 [issue tracker]: https://github.com/memspace/zefyr/issues
9
 
9
 
10
-### Documentation
11
-
12
-* [Quick Start](doc/quick-start.md)
13
-* [Data Format and Document Model](doc/concepts/data-and-document.md)
14
-* [Style attributes](doc/concepts/attributes.md)
15
-* [Heuristic rules](doc/concepts/heuristics.md)
16
-* [Images](doc/images.md)
17
-* [FAQ](doc/faq.md)
18
-
19
 ## Clean and modern look
10
 ## Clean and modern look
20
 
11
 
21
 Zefyr's rich text editor is built with simplicity and flexibility in
12
 Zefyr's rich text editor is built with simplicity and flexibility in
45
 conflict-free resolution of changes.
36
 conflict-free resolution of changes.
46
 
37
 
47
 > Zefyr editor uses Quill.js **Delta** as underlying data format. Read
38
 > Zefyr editor uses Quill.js **Delta** as underlying data format. Read
48
-> more about Zefyr and Deltas in our [documentation](doc/data-and-document.md).
39
+> more about Zefyr and Deltas in our [documentation](doc/concepts/data-and-document.md).
49
 > Make sure to checkout [official documentation][delta] for Delta format
40
 > Make sure to checkout [official documentation][delta] for Delta format
50
 > as well.
41
 > as well.
51
 
42
 

+ 1
- 1
doc/concepts/attributes.md View File

1
 ## Style Attributes
1
 ## Style Attributes
2
 
2
 
3
 > If you haven't yet, read introduction to Zefyr document model called
3
 > If you haven't yet, read introduction to Zefyr document model called
4
-> Notus [here](data-and-document.md);
4
+> Notus [here](data-and-document.md).
5
 
5
 
6
 Style attributes in Notus documents are simple key-value pairs, where
6
 Style attributes in Notus documents are simple key-value pairs, where
7
 keys identify the attribute and value describes the style applied, for
7
 keys identify the attribute and value describes the style applied, for

+ 1
- 1
doc/concepts/data-and-document.md View File

18
 [Delta]: https://quilljs.com/docs/delta/
18
 [Delta]: https://quilljs.com/docs/delta/
19
 [ot]: https://en.wikipedia.org/wiki/Operational_transformation
19
 [ot]: https://en.wikipedia.org/wiki/Operational_transformation
20
 [github-delta]: https://github.com/quilljs/delta
20
 [github-delta]: https://github.com/quilljs/delta
21
-[pub-delta]: https://pub.dartlang.com/packages/quill_delta
21
+[pub-delta]: https://pub.dev/packages/quill_delta
22
 
22
 
23
 ### Deltas quick start
23
 ### Deltas quick start
24
 
24
 

+ 8
- 9
doc/concepts/heuristics.md View File

11
 In Notus (document model used by Zefyr editor), such rules are called
11
 In Notus (document model used by Zefyr editor), such rules are called
12
 *heuristic rules*. There are two main purposes for heuristic rules:
12
 *heuristic rules*. There are two main purposes for heuristic rules:
13
 
13
 
14
-1. User experience: rules like above-mentioned autoformatting of links
15
-   are here to make editing a user friendly process.
16
-2. Semantics preservation: this is mostly invisible for the user but
17
-  is very important nevertheless. There is a set of rules to make sure
18
-  that a document change conforms to the data format and model
19
-  semantics.
14
+1. User experience: rules like above-mentioned autoformatting of links are here to make editing a user friendly process.
15
+2. Semantics preservation: this is mostly invisible for the user but is very important nevertheless. There is a set of rules to make sure that a document change conforms to the data format and model semantics.
20
 
16
 
21
 Let's cover the second item in more detail.
17
 Let's cover the second item in more detail.
22
 
18
 
19
+### Example heuristic rule
20
+
23
 Say, a user is editing following document (cursor position is indicated
21
 Say, a user is editing following document (cursor position is indicated
24
 by pipe `|` character):
22
 by pipe `|` character):
25
 
23
 
39
 ```
37
 ```
40
 
38
 
41
 If we try to apply this change as-is it would have no effect or, more
39
 If we try to apply this change as-is it would have no effect or, more
42
-likely, result in an `AssertionError`. This is why all methods in
40
+likely, result in an `AssertionError` because we are trying to apply line style
41
+to a character in the middle of a line. This is why all methods in
43
 `NotusDocument` have an extra step which applies heuristic rules to
42
 `NotusDocument` have an extra step which applies heuristic rules to
44
 the change (there is one method which skips this step, `compose`,
43
 the change (there is one method which skips this step, `compose`,
45
 read more on it later) before actually composing it.
44
 read more on it later) before actually composing it.
62
 There are more similar scenarios which are covered by heuristic rules
61
 There are more similar scenarios which are covered by heuristic rules
63
 to ensure consistency with the document model and provide better UX.
62
 to ensure consistency with the document model and provide better UX.
64
 
63
 
65
-### `NotusDocument.compose()` and skipping heuristic rules.
64
+### `NotusDocument.compose()` and skipping heuristic rules
66
 
65
 
67
 The `compose()` method is the only method which skips the step of
66
 The `compose()` method is the only method which skips the step of
68
 applying heuristic rules and therefore **should be used with great
67
 applying heuristic rules and therefore **should be used with great
69
 care** as it can result in corrupted document state.
68
 care** as it can result in corrupted document state.
70
 
69
 
71
-Use this method when you sure that the change you are about to compose
70
+Use this method when you are sure that the change you are about to compose
72
 conforms to the document model and data format semantics.
71
 conforms to the document model and data format semantics.
73
 
72
 
74
 This method exists mostly to enable following use cases:
73
 This method exists mostly to enable following use cases:

+ 1
- 1
doc/faq.md View File

1
 ## Frequently asked questions
1
 ## Frequently asked questions
2
 
2
 
3
-### Are Notus documents compatible with Quill documents?
3
+### Q: Are Notus documents compatible with Quill documents?
4
 
4
 
5
 Short answer is no. Even though Notus uses Quill Delta as underlying
5
 Short answer is no. Even though Notus uses Quill Delta as underlying
6
 representation for its documents there are at least differences in
6
 representation for its documents there are at least differences in

+ 8
- 7
doc/quick-start.md View File

1
 ## Quick Start
1
 ## Quick Start
2
 
2
 
3
-Zefyr project is split in two main packages:
3
+Zefyr project consists of two packages:
4
 
4
 
5
-1. `zefyr` - Flutter package which provides the UI part
6
-2. `notus` - platform-agnostic package which provides document model
7
-   used by `zefyr` package.
5
+1. [zefyr](https://pub.dev/packages/zefyr) - Flutter package which provides
6
+   the UI part.
7
+2. [notus](https://pub.dev/packages/notus) - platform-agnostic package which
8
+   provides document model used in Zefyr editor.
8
 
9
 
9
 ### Installation
10
 ### Installation
10
 
11
 
25
 * `NotusDocument`, represents a rich text document and provides
26
 * `NotusDocument`, represents a rich text document and provides
26
   high-level methods for manipulating the document's state, like
27
   high-level methods for manipulating the document's state, like
27
   inserting, deleting and formatting of text.
28
   inserting, deleting and formatting of text.
28
-  Read [documentation][data_and_docs] for more details on Notus
29
+  Read [documentation](concepts/data-and-document.md) for more details on Notus
29
   document model and data format.
30
   document model and data format.
30
 * `ZefyrEditor`, a Flutter widget responsible for rendering of rich text
31
 * `ZefyrEditor`, a Flutter widget responsible for rendering of rich text
31
   on the screen and reacting to user actions.
32
   on the screen and reacting to user actions.
73
 }
74
 }
74
 ```
75
 ```
75
 
76
 
76
-In following sections you will learn more about document
77
-model, Deltas, attributes and other aspects of the editor.
77
+This above is required minimum to include Zefyr in your Flutter app and start
78
+writing some rich text.