diff --git a/doc/developer-guide.md b/doc/developer-guide.md index af0ea569..6cd80daf 100644 --- a/doc/developer-guide.md +++ b/doc/developer-guide.md @@ -8,16 +8,26 @@ Architecture ![Architecture diagram][1] -StackEdit uses [RequireJS][2] for asynchronous module definition (AMD). +StackEdit uses [RequireJS][2] for asynchronous module definition ([AMD][3]). -core ----- +### core -fileMgr -------- +The `core` module is responsible for: -synchronizer ------------- +- creating the layout (using [UI Layout][4]) +- creating the editor (using [PageDown][5]) +- Loading/saving the settings +- detecting the offline status + +### fileMgr + +The `fileMgr` module is responsible for: + +- creating/deleting local files +- switching from one file to another +- setting/removing file's sync/publish location + +### synchronizer The `synchronizer` module is responsible for: @@ -25,17 +35,33 @@ The `synchronizer` module is responsible for: - creating a new sync location from a local file (export) - running 2 ways synchronization (upload and download) for all sync locations -publisher ---------- +### publisher The `publisher` module is responsible for: - creating new publish locations - updating existing publish locations +#### publisher's providers + +A `provider` module can be associated with the `publisher` module if it implements the following functions: + +- `newPublishAttributes()`: returns a new [`publishAttributes`][6] object in order to create a new publish location +- `publish()`: performs publishing of one publish location + #### publishAttributes -A `publishAttributes` object is an object that describes a publish location +A `publishAttributes` object is an object that describes a publish location. Attributes list differs from one provider to another except for the following attributes: + +- `publishIndex`: the unique index of the publish location +- `provider`: the `provider` module that handles the publish location +- `format`: the publishing format for the publish location. It can be: + - `markdown` for Markdown format + - `html` for HTML format + - `template` for template format + + + @@ -56,4 +82,8 @@ A `publishAttributes` object is an object that describes a publish location [1]: http://benweet.github.io/stackedit/doc/img/architecture.png "Architecture diagram" - [2]: http://requirejs.org/ \ No newline at end of file + [2]: http://requirejs.org/ "RequireJS" + [3]: http://en.wikipedia.org/wiki/Asynchronous_module_definition "Asynchronous module definition" + [4]: http://layout.jquery-dev.net/ "UI Layout" + [5]: https://code.google.com/p/pagedown/ "PageDown" + [6]: #publishattributes \ No newline at end of file