Using Aloha Editor
1 Clone from Github
Fork it on github Github repository, then:
git clone git@github.com:YOURNAME/Aloha-Editor.git alohaeditor cd alohaeditor git checkout dev
2 Repository Directory Structure
- /
- /bin – build scripts
- /build – build configuration
- /doc
- /doc/api – the API documentation
- /doc/guides
- /vendor – third party libraries (e.g. jquery)
- /target – build output folder
- /src
- /src/css – Aloha core css files
- /src/demo – Aloha demos
- /src/img – Aloha core images
- /src/lib – Require plugins and bootstrap files
- /src/lib/aloha – Main Aloha Editor core sources
- /src/lib/vendor – third party libraries jquery
- /src/lib/util – utility libraries (e.g. json2.js, class.js)
- /src/plugins
- /src/plugins/common – Common plugin bundle
- /src/plugins/extra – Extra plugin bundle
- /src/test – QUnit tests
3 Building – Aloha Building
3.1 Debian Linux / Mac OS X
- Install nodejs See: http://nodejs.org
- Install npm See: http://npmjs.org
curl http://npmjs.org/install.sh | sh
- Invoke Building:
cd alohaeditor mvn3 clean package
You probably want to ommit building of the api and guides:
mvn3 clean package -DbareMode=true
You can also build just the css:
mvn3 generate-sources
The resulting css should be in src/css/aloha.css
3.2 Other OS:
- Microsoft Windows: Not yet supported
3.3 Customized builds:
Aloha-Editor uses maven to build a distributable package (includes documentation etc.). To build just the javascript, it suffices to invoke r.js from the command line. For example
node build/r.js -o build/aloha/build.js
To customize the build to your needs, you can modify the build profile in build/aloha/build.js. The most likely customization you want to make is to remove or add plugins from the include property of the ‘aloha’ module definition.
To include i18n files in your build, define the locale property. If the locale property is not defined, the appropriate i18n files will be loaded dynamically by requirejs. Remember to configure Aloha.locale as well.
Unless you ask for plugins to be loaded that are not defined in the build profile, or use a locale that was not defined during building, no additional files should be downloaded by requirejs. In the future requirejs may be replaced with an AMD stub such that requirejs is not necessary for production deployments.
Css building can be customized by adding or removing entries in src/css/aloha.less. If you removed or added plugins in the r.js build profile, you also want to add or remove the appropriate css in the aloha-core.less. Then, run
mvn3 generate-sources
And the resulting css should be in src/css/aloha.css
If you want to redefine modules in the build profile, for example if you want to use your own jqueryui, please first read Custom jQuery, jQueryUI and other modules
4 Guide
4.1 Installation
4.1.1 Debian Linux
apt-get install build-essential apt-get install ruby1.9.1-full cd /usr/bin ln -s ruby1.9.1 ruby ln -s gem1.9.1 gem gem install guides ln -s /var/lib/gems/1.9.1/gems/guides-0.7.1/bin/guides /usr/bin/guides guides preview
4.1.2 Mac OSX
gem install guides
4.1.3 Microsoft Windows
4.2 Using the Guides
- Preview Guides:
cd alohaeditor/doc/guides guides preview
Preview URL: http://localhost:9292/
- Building Guides:
guides build