2.2 KiB
2.2 KiB
Developer guide
Architecture
StackEdit uses RequireJS for asynchronous module definition (AMD).
core
The core
module is responsible for:
- creating the layout (using UI Layout)
- creating the editor (using PageDown)
- 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:
- creating a new local file from a sync location (import)
- creating a new sync location from a local file (export)
- running 2 ways synchronization (upload and download) for all sync locations
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 newpublishAttributes
object in order to create a new publish locationpublish()
: 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:
publishIndex
: the unique index of the publish locationprovider
: theprovider
module that handles the publish locationformat
: the publishing format for the publish location. It can be:markdown
for Markdown formathtml
for HTML formattemplate
for template format
provider
Written with StackEdit.