From 8428ab256edb7540aefa36e08521012cf3945350 Mon Sep 17 00:00:00 2001 From: Benoit Schweblin Date: Sun, 16 Jun 2013 11:35:46 -0700 Subject: [PATCH 1/7] Published with http://benweet.github.io/stackedit/ --- doc/developer-guide.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/developer-guide.md b/doc/developer-guide.md index 0b2d229a..70e3a4dd 100644 --- a/doc/developer-guide.md +++ b/doc/developer-guide.md @@ -66,7 +66,6 @@ The `publisher` module is responsible for: A [`provider`][6] module can be associated with the `publisher` module if it implements the following functions: - `newPublishAttributes()`: returns a new [`publishAttributes`][7] object in order to create a new publish location - - `publish()`: performs publishing of one publish location #### publishAttributes From b38586e52862e39d2de0e389c16c98ec0e16a0af Mon Sep 17 00:00:00 2001 From: Benoit Schweblin Date: Sun, 16 Jun 2013 12:08:33 -0700 Subject: [PATCH 2/7] Published with http://benweet.github.io/stackedit/ --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4cc8393c..c48ab554 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,12 @@ StackEdit is a free, open-source Markdown editor based on PageDown, the Markdown - Manage multiple Markdown documents online or offline - Export your documents in Markdown or HTML and format it using a template - Synchronize your Markdown documents in the Cloud - - Edit existing Markdown documents from Google Drive and Dropbox + - Edit existing Markdown documents from Google Drive, Dropbox and your local hard drive - Post your Markdown document on Blogger/Blogspot, WordPress, Tumblr - Publish your Markdown document on GitHub, Gist, Google Drive, Dropbox or any SSH server - Share a link to a Markdown document that renders it in a nice viewer - - Show some statistics about your document + - Show statistics about your document + - Convert HTML to Markdown ### Features: @@ -27,6 +28,14 @@ StackEdit is a free, open-source Markdown editor based on PageDown, the Markdown - Online synchronization using Google Drive and Dropbox - One click publish on Blogger, Dropbox, Gist, GitHub, Google Drive, SSH server, Tumblr, WordPress -> **NOTE:** This page has been written and published with [StackEdit][1]. +### Documentation - [1]: http://benweet.github.io/stackedit/ "StackEdit" \ No newline at end of file + - [Developer guide][2] + - [Theming guide][1] + +> **NOTE:** This page has been written and published with [StackEdit][3]. + + + [1]: https://github.com/benweet/stackedit/blob/master/doc/theming.md#stackedit-theming-guide "Theming guide" + [2]: https://github.com/benweet/stackedit/blob/master/doc/developer-guide.md#developer-guide "Developer guide" + [3]: http://benweet.github.io/stackedit/ "StackEdit" \ No newline at end of file From c981a96eaba388fddeb254dbd8c7b7777ad73cb9 Mon Sep 17 00:00:00 2001 From: Benoit Schweblin Date: Sun, 16 Jun 2013 15:06:26 -0700 Subject: [PATCH 3/7] Published with http://benweet.github.io/stackedit/ --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c48ab554..10fa23c1 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ StackEdit is a free, open-source Markdown editor based on PageDown, the Markdown - Online synchronization using Google Drive and Dropbox - One click publish on Blogger, Dropbox, Gist, GitHub, Google Drive, SSH server, Tumblr, WordPress -### Documentation +### Documentation: - [Developer guide][2] - [Theming guide][1] From 0eb59ff41a554e14ab898beaa0cabf26653fe87f Mon Sep 17 00:00:00 2001 From: Benoit Schweblin Date: Sun, 16 Jun 2013 16:12:13 -0700 Subject: [PATCH 4/7] Published with http://benweet.github.io/stackedit/ --- doc/developer-guide.md | 70 +++++++++++++++++++++++++++++++++++------- 1 file changed, 59 insertions(+), 11 deletions(-) diff --git a/doc/developer-guide.md b/doc/developer-guide.md index 70e3a4dd..23f1af11 100644 --- a/doc/developer-guide.md +++ b/doc/developer-guide.md @@ -23,8 +23,10 @@ The `core` module is responsible for: - creating the layout (using [UI Layout][4]) - creating the editor (using [PageDown][5]) -- Loading/saving the settings -- detecting the offline status +- loading/saving the settings +- running period tasks +- detecting the user activity +- checking the offline status ---------- @@ -34,9 +36,29 @@ The `core` module is responsible for: The `fileMgr` module is responsible for: -- creating/deleting local files +- creating and deleting local files - switching from one file to another -- setting/removing file's sync/publish location + +#### FileDescriptor + +The `FileDescriptor` class represents a local file. A `FileDescriptor` object has the following properties: + +- `fileIndex`: the unique string index of the file in the file system +- `title`: the title of the document +- `content`: the content of the document +- `syncLocations`: a map containing all the associated [`syncAttributes`][7] objects with their `syncIndex` as a key +- `publishLocations`: a map containing all the associated [`publishAttributes`][8] objects with their `publishIndex` as a key + +And the following methods: + +- `addSyncLocation(syncAttributes)`: associates a [`syncAttributes`][9] object with the file +- `removeSyncLocation(syncAttributes)`: unassociates a [`syncAttributes`][10] object with the file +- `addPublishLocation(publishAttributes)`: associates a [`publishAttributes`][11] object with the file +- `removePublishLocation(publishAttributes)`: unassociates a [`publishAttributes`][12] object with the file + +#### fileSystem + +The `fileSystem` module is a map containing all the [`FileDescriptor`][6] objects with their `fileIndex` as a key ---------- @@ -50,6 +72,22 @@ 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 +#### synchronizer's providers + +A [`provider`][13] module can be associated with the `synchronizer` module if it implements the following functions: + +- `importFiles()`: downloads one or multiple files and create local files associated with the sync locations +- `exportFile()`: uploads a local file to a new sync location +- `syncDown()`: performs a download of all the changes operated on all sync locations +- `syncUp()`: performs an upload of a change to a sync location + +#### syncAttributes + +A `syncAttributes` object is an object that describes a sync location. Attributes differ from one provider to another except for the following: + +- `syncIndex`: the unique string index of the publish location +- `provider`: the [`provider`][14] module that handles the sync location + ---------- @@ -63,17 +101,17 @@ The `publisher` module is responsible for: #### publisher's providers -A [`provider`][6] module can be associated with the `publisher` module if it implements the following functions: +A [`provider`][15] module can be associated with the `publisher` module if it implements the following functions: -- `newPublishAttributes()`: returns a new [`publishAttributes`][7] object in order to create a new publish location +- `newPublishAttributes()`: returns a new [`publishAttributes`][16] 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. Attributes list differs from one provider to another except for the following attributes: +A `publishAttributes` object is an object that describes a publish location. Attributes differ from one provider to another except for the following: -- `publishIndex`: the unique index of the publish location -- `provider`: the [`provider`][6] module that handles the publish location +- `publishIndex`: the unique string index of the publish location +- `provider`: the [`provider`][17] 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 @@ -98,5 +136,15 @@ A `publishAttributes` object is an object that describes a publish location. Att [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]: #provider - [7]: #publishattributes \ No newline at end of file + [6]: #filedescriptor + [7]: #syncattributes + [8]: #publishattributes + [9]: #syncattributes + [10]: #syncattributes + [11]: #publishattributes + [12]: #publishattributes + [13]: #provider + [14]: #provider + [15]: #provider + [16]: #publishattributes + [17]: #provider \ No newline at end of file From 2bfb30784942b86b5e56d2bc4ac9c66467d4930c Mon Sep 17 00:00:00 2001 From: Benoit Schweblin Date: Sun, 16 Jun 2013 16:16:02 -0700 Subject: [PATCH 5/7] Published with http://benweet.github.io/stackedit/ --- doc/developer-guide.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/developer-guide.md b/doc/developer-guide.md index 23f1af11..ef1f0954 100644 --- a/doc/developer-guide.md +++ b/doc/developer-guide.md @@ -2,7 +2,6 @@ Developer guide =============== ----------- Architecture From c564b74c3936eb4fd5ba8ef27a88801959a63d23 Mon Sep 17 00:00:00 2001 From: Benoit Schweblin Date: Tue, 18 Jun 2013 15:43:52 -0700 Subject: [PATCH 6/7] Published with http://benweet.github.io/stackedit/ --- doc/developer-guide.md | 78 ++++++++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 29 deletions(-) diff --git a/doc/developer-guide.md b/doc/developer-guide.md index ef1f0954..30f852b2 100644 --- a/doc/developer-guide.md +++ b/doc/developer-guide.md @@ -20,12 +20,29 @@ StackEdit uses [RequireJS][2] for asynchronous module definition ([AMD][3]). The `core` module is responsible for: -- creating the layout (using [UI Layout][4]) -- creating the editor (using [PageDown][5]) -- loading/saving the settings -- running period tasks -- detecting the user activity -- checking the offline status +- creating the [UI Layout][4], +- creating the [PageDown][5] editor, +- loading/saving the settings, +- running periodic tasks, +- detecting the user activity, +- checking the offline status. + +##### Attributes: + +- `isOffline`: indicates the offline status of the application. + +##### Methods: + +- `core.onReady(callback)`: sets a callback to be called when all modules have been loaded and the DOM is ready. +> **NOTE:** This is preferred over [jQuery's `.ready()`][6] because it ensures that all AMD modules are loaded by [RequireJS][2]). + +- `runPeriodically(callback)`: sets a callback to be called every second. +> **NOTE:** The callback will not run if the user is inactive or in StackEdit Viewer. User is considered inactive after 5 minutes of inactivity (mouse or keyboard). + +- `setOffline()`: can be called by any other modules when a network timeout occurs for instance. +> **NOTE:** the offline status is also set by detecting the window `offline` event. `isOffline` is automatically set to `false` when the network is recovered. + +- `initEditor(fileDesc)`: creates or refreshes the [PageDown][7] editor with a given [`FileDescriptor`][8] object. ---------- @@ -45,19 +62,19 @@ The `FileDescriptor` class represents a local file. A `FileDescriptor` object ha - `fileIndex`: the unique string index of the file in the file system - `title`: the title of the document - `content`: the content of the document -- `syncLocations`: a map containing all the associated [`syncAttributes`][7] objects with their `syncIndex` as a key -- `publishLocations`: a map containing all the associated [`publishAttributes`][8] objects with their `publishIndex` as a key +- `syncLocations`: a map containing all the associated [`syncAttributes`][9] objects with their `syncIndex` as a key +- `publishLocations`: a map containing all the associated [`publishAttributes`][10] objects with their `publishIndex` as a key And the following methods: -- `addSyncLocation(syncAttributes)`: associates a [`syncAttributes`][9] object with the file -- `removeSyncLocation(syncAttributes)`: unassociates a [`syncAttributes`][10] object with the file -- `addPublishLocation(publishAttributes)`: associates a [`publishAttributes`][11] object with the file -- `removePublishLocation(publishAttributes)`: unassociates a [`publishAttributes`][12] object with the file +- `addSyncLocation(syncAttributes)`: associates a [`syncAttributes`][11] object with the file +- `removeSyncLocation(syncAttributes)`: unassociates a [`syncAttributes`][12] object with the file +- `addPublishLocation(publishAttributes)`: associates a [`publishAttributes`][13] object with the file +- `removePublishLocation(publishAttributes)`: unassociates a [`publishAttributes`][14] object with the file #### fileSystem -The `fileSystem` module is a map containing all the [`FileDescriptor`][6] objects with their `fileIndex` as a key +The `fileSystem` module is a map containing all the [`FileDescriptor`][15] objects with their `fileIndex` as a key ---------- @@ -73,7 +90,7 @@ The `synchronizer` module is responsible for: #### synchronizer's providers -A [`provider`][13] module can be associated with the `synchronizer` module if it implements the following functions: +A [`provider`][16] module can be associated with the `synchronizer` module if it implements the following functions: - `importFiles()`: downloads one or multiple files and create local files associated with the sync locations - `exportFile()`: uploads a local file to a new sync location @@ -85,7 +102,7 @@ A [`provider`][13] module can be associated with the `synchronizer` module if it A `syncAttributes` object is an object that describes a sync location. Attributes differ from one provider to another except for the following: - `syncIndex`: the unique string index of the publish location -- `provider`: the [`provider`][14] module that handles the sync location +- `provider`: the [`provider`][17] module that handles the sync location ---------- @@ -100,9 +117,9 @@ The `publisher` module is responsible for: #### publisher's providers -A [`provider`][15] module can be associated with the `publisher` module if it implements the following functions: +A [`provider`][18] module can be associated with the `publisher` module if it implements the following functions: -- `newPublishAttributes()`: returns a new [`publishAttributes`][16] object in order to create a new publish location +- `newPublishAttributes()`: returns a new [`publishAttributes`][19] object in order to create a new publish location - `publish()`: performs publishing of one publish location #### publishAttributes @@ -110,7 +127,7 @@ A [`provider`][15] module can be associated with the `publisher` module if it im A `publishAttributes` object is an object that describes a publish location. Attributes differ from one provider to another except for the following: - `publishIndex`: the unique string index of the publish location -- `provider`: the [`provider`][17] module that handles the publish location +- `provider`: the [`provider`][20] 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 @@ -135,15 +152,18 @@ A `publishAttributes` object is an object that describes a publish location. Att [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]: #filedescriptor - [7]: #syncattributes - [8]: #publishattributes + [6]: http://api.jquery.com/ready/ + [7]: https://code.google.com/p/pagedown/ "PageDown" + [8]: #filedescriptor [9]: #syncattributes - [10]: #syncattributes - [11]: #publishattributes - [12]: #publishattributes - [13]: #provider - [14]: #provider - [15]: #provider - [16]: #publishattributes - [17]: #provider \ No newline at end of file + [10]: #publishattributes + [11]: #syncattributes + [12]: #syncattributes + [13]: #publishattributes + [14]: #publishattributes + [15]: #filedescriptor + [16]: #provider + [17]: #provider + [18]: #provider + [19]: #publishattributes + [20]: #provider \ No newline at end of file From 88d224aa847c7b71c64cd87749146fd16bcae988 Mon Sep 17 00:00:00 2001 From: Benoit Schweblin Date: Tue, 18 Jun 2013 15:55:17 -0700 Subject: [PATCH 7/7] Published with http://benweet.github.io/stackedit/ --- doc/developer-guide.md | 79 ++++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/doc/developer-guide.md b/doc/developer-guide.md index 30f852b2..487f4e63 100644 --- a/doc/developer-guide.md +++ b/doc/developer-guide.md @@ -9,8 +9,10 @@ Architecture ![Architecture diagram][1] +> **NOTE:** -StackEdit uses [RequireJS][2] for asynchronous module definition ([AMD][3]). +> - StackEdit uses [RequireJS][2] for asynchronous module definition ([AMD][3]). +> - [jQuery][4], [Underscore.js][5] or any other 3rd party libraries can be called from anywhere as long as they have been declared as module dependencies. ---------- @@ -20,29 +22,29 @@ StackEdit uses [RequireJS][2] for asynchronous module definition ([AMD][3]). The `core` module is responsible for: -- creating the [UI Layout][4], -- creating the [PageDown][5] editor, +- creating the [UI Layout][6], +- creating the [PageDown][7] editor, - loading/saving the settings, - running periodic tasks, - detecting the user activity, - checking the offline status. -##### Attributes: +**Attributes:** -- `isOffline`: indicates the offline status of the application. +- `core.isOffline`: indicates the offline status of the application. -##### Methods: +**Methods:** - `core.onReady(callback)`: sets a callback to be called when all modules have been loaded and the DOM is ready. -> **NOTE:** This is preferred over [jQuery's `.ready()`][6] because it ensures that all AMD modules are loaded by [RequireJS][2]). +> **NOTE:** This is preferred over [jQuery's `.ready()`][8] because it ensures that all AMD modules are loaded by [RequireJS][9]). -- `runPeriodically(callback)`: sets a callback to be called every second. +- `core.runPeriodically(callback)`: sets a callback to be called every second. > **NOTE:** The callback will not run if the user is inactive or in StackEdit Viewer. User is considered inactive after 5 minutes of inactivity (mouse or keyboard). -- `setOffline()`: can be called by any other modules when a network timeout occurs for instance. -> **NOTE:** the offline status is also set by detecting the window `offline` event. `isOffline` is automatically set to `false` when the network is recovered. +- `core.setOffline()`: can be called by any other modules when a network timeout occurs for instance. +> **NOTE:** the offline status is also set by detecting the window `offline` event. `core.isOffline` is automatically set to `false` when the network is recovered. -- `initEditor(fileDesc)`: creates or refreshes the [PageDown][7] editor with a given [`FileDescriptor`][8] object. +- `core.initEditor(fileDesc)`: creates or refreshes the [PageDown][10] editor with a given [`FileDescriptor`][11] object. ---------- @@ -62,19 +64,19 @@ The `FileDescriptor` class represents a local file. A `FileDescriptor` object ha - `fileIndex`: the unique string index of the file in the file system - `title`: the title of the document - `content`: the content of the document -- `syncLocations`: a map containing all the associated [`syncAttributes`][9] objects with their `syncIndex` as a key -- `publishLocations`: a map containing all the associated [`publishAttributes`][10] objects with their `publishIndex` as a key +- `syncLocations`: a map containing all the associated [`syncAttributes`][12] objects with their `syncIndex` as a key +- `publishLocations`: a map containing all the associated [`publishAttributes`][13] objects with their `publishIndex` as a key And the following methods: -- `addSyncLocation(syncAttributes)`: associates a [`syncAttributes`][11] object with the file -- `removeSyncLocation(syncAttributes)`: unassociates a [`syncAttributes`][12] object with the file -- `addPublishLocation(publishAttributes)`: associates a [`publishAttributes`][13] object with the file -- `removePublishLocation(publishAttributes)`: unassociates a [`publishAttributes`][14] object with the file +- `addSyncLocation(syncAttributes)`: associates a [`syncAttributes`][14] object with the file +- `removeSyncLocation(syncAttributes)`: unassociates a [`syncAttributes`][15] object with the file +- `addPublishLocation(publishAttributes)`: associates a [`publishAttributes`][16] object with the file +- `removePublishLocation(publishAttributes)`: unassociates a [`publishAttributes`][17] object with the file #### fileSystem -The `fileSystem` module is a map containing all the [`FileDescriptor`][15] objects with their `fileIndex` as a key +The `fileSystem` module is a map containing all the [`FileDescriptor`][18] objects with their `fileIndex` as a key ---------- @@ -90,7 +92,7 @@ The `synchronizer` module is responsible for: #### synchronizer's providers -A [`provider`][16] module can be associated with the `synchronizer` module if it implements the following functions: +A [`provider`][19] module can be associated with the `synchronizer` module if it implements the following functions: - `importFiles()`: downloads one or multiple files and create local files associated with the sync locations - `exportFile()`: uploads a local file to a new sync location @@ -102,7 +104,7 @@ A [`provider`][16] module can be associated with the `synchronizer` module if it A `syncAttributes` object is an object that describes a sync location. Attributes differ from one provider to another except for the following: - `syncIndex`: the unique string index of the publish location -- `provider`: the [`provider`][17] module that handles the sync location +- `provider`: the [`provider`][20] module that handles the sync location ---------- @@ -117,9 +119,9 @@ The `publisher` module is responsible for: #### publisher's providers -A [`provider`][18] module can be associated with the `publisher` module if it implements the following functions: +A [`provider`][21] module can be associated with the `publisher` module if it implements the following functions: -- `newPublishAttributes()`: returns a new [`publishAttributes`][19] object in order to create a new publish location +- `newPublishAttributes()`: returns a new [`publishAttributes`][22] object in order to create a new publish location - `publish()`: performs publishing of one publish location #### publishAttributes @@ -127,7 +129,7 @@ A [`provider`][18] module can be associated with the `publisher` module if it im A `publishAttributes` object is an object that describes a publish location. Attributes differ from one provider to another except for the following: - `publishIndex`: the unique string index of the publish location -- `provider`: the [`provider`][20] module that handles the publish location +- `provider`: the [`provider`][23] 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 @@ -150,20 +152,23 @@ A `publishAttributes` object is an object that describes a publish location. Att [1]: http://benweet.github.io/stackedit/doc/img/architecture.png "Architecture diagram" [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]: http://api.jquery.com/ready/ + [4]: http://jquery.com/ + [5]: http://underscorejs.org/ + [6]: http://layout.jquery-dev.net/ "UI Layout" [7]: https://code.google.com/p/pagedown/ "PageDown" - [8]: #filedescriptor - [9]: #syncattributes - [10]: #publishattributes - [11]: #syncattributes + [8]: http://api.jquery.com/ready/ + [9]: http://requirejs.org/ "RequireJS" + [10]: https://code.google.com/p/pagedown/ "PageDown" + [11]: #filedescriptor [12]: #syncattributes [13]: #publishattributes - [14]: #publishattributes - [15]: #filedescriptor - [16]: #provider - [17]: #provider - [18]: #provider - [19]: #publishattributes - [20]: #provider \ No newline at end of file + [14]: #syncattributes + [15]: #syncattributes + [16]: #publishattributes + [17]: #publishattributes + [18]: #filedescriptor + [19]: #provider + [20]: #provider + [21]: #provider + [22]: #publishattributes + [23]: #provider \ No newline at end of file