WebODF makes all source code available. Everybody is allowed to download and modify it. Below are instructions to get started on WebODF.
Using WebODF on your own web page
In a few steps, you can add WebODF to your website. Only one file is needed from the project: webodf.js. With a JavaScript snippet like the following, one can display an ODF file in an HTML page:
<html>
<head>
<script src="webodf.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
function init() {
var odfelement = document.getElementById("odf"),
odfcanvas = new odf.OdfCanvas(odfelement);
odfcanvas.load("myfile.odt");
}
window.setTimeout(init, 0);
</script>
</head>
<body>
<div id="odf"></div>
</body>
</html>
Obtaining the source code
The file webodf.js is created from a collection of JavaScript files. These files can be checked out from the git repository of downloaded.
Creating webodf.js
webodf.js is compile by using the closure compiler. This compiler compacts all JavaScript files, so that they are smaller and execute faster. By running CMake, webodf.js can be created.
git clone git://gitorious.org/odfkit/webodf.git mkdir build cd build cmake ../webodf make webodf.js-target
This will recreate the file webodf.js if any of the dependencies changed.
Alternatively, you can use https://git.gitorious.org/odfkit/webodf.git to check out the code.
