The engine is the central piece of livingdocs and defines the APIs for manipulating, displaying and storing the document.
For a more detailed documentation see our livingdocs documentation. For a quick overview stay right here.
Load the necessary scripts into your browser.
<!-- dependencies of livingdocs-engine -->
<script src="/jquery/jquery.js"></script>
<script src="/editable/editable.js"></script>
<!-- design -->
<script src="/designs/bootstrap/design.js"></script>
<!-- livingdocs-engine. yeah! -->
<script src="/livingdocs-engine.js"></script>
The engine then sets the global variable doc
. Here you'll find the API of the engine
.
doc.design.load(design.bootstrap);
If you want to create your own design get started with the livingdocs-design-boilerplate project.
var livingdoc = doc.new({
design: 'bootstrap'
});
Simply render a livingdoc into your current page:
livingdoc.appendTo({ host: '.article-container', interactive: false });
Create multiple views in iframes:
var interactiveView = livingdoc.createView({ host: '.editor-section', interactive: true });
var preview = livingdoc.createView({ host: '.editor-preview' });
With the iframe technique you can isolate CSS or Javascript that is needed in your documents and also generate views that will work properly with responsive designs. There can only be one interactive view where the user can edit, but you can have as many readOnly views as you want to preview the content at different screen sizes at the same time.
// Create a component
var titleComponent = livingdoc.createComponent('title');
titleComponent.set('title', "My Title");
// Appned the component to the livingdoc
livingdoc.componentTree.append(titleComponent);
# Build into the dist/ folder
grunt build
For a detailed description see: guides/repositories/versioning
- Build and Update Changelog
List changes and link to merged pull-requests
- Update Readme
(if something changed)
- Create a release tag and push everything
# Example for a patch release:
grunt release:patch
Grunt Tasks:
# For manual testing of the engine in the browser
grunt dev
# run browser tests
grunt test
# run tests in Chrome, Firefox and Safari
grunt karma:browsers
# run tests in node environment
grunt node-test
Copyright (c) 2012-2014 upfront GmbH
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License (LGPL) for more details.
You should have received a copy of the GNU Lesser General Public License (LGPL) along with this program. If not, see http://www.gnu.org/licenses/.