- Notifications
You must be signed in to change notification settings - Fork27
Edit Textbooks using Javascript and save to GitHub
License
oerpub/github-bookeditor
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
The book editor is a javascript browser application that allows editing anebook in your browser and storing the ebook itself in a github repo.
More information can be found in thedocumentation repository as well asin thedocs directory.
- Backbone.js
- Marionette
- Bootstrap
- Font Awesome
- Jquery
- Requirejs and helpers such asrequire-css andrequire-less
- Phil Schatz'sOctokit.js
- Our ownOERPub specific version of Aloha-Editor
- NodeJS and associated development tools such as npmandBower.
Below are instructions for building the book editor yourself and a layoutof how the code is organized.
- Installvirtualbox
- Installvagrant
- Clonegithub book editor repo to somewhere
- Inside the repo run
vagrant upfrom the command line- There is currently a bug in the build that makes it not run fully on thefirst pass, the workaround is to log into the vm after running
vagrant upwithvagrant ssh, then go into/vagrantand runnpm install. Thatwill finish the build for you.
- There is currently a bug in the build that makes it not run fully on thefirst pass, the workaround is to log into the vm after running
- Vagrant will take a while to configure the new vm. When it's done you will beable to hithttp://33.33.33.10/ in a web browser and see the editor.
This is tested on Ubuntu 12.04.
First you need to install a copy of nodejs and the required utilities. Becausethe version of nodejs that ships with your favourite linux distribution islikely out of date, the easiest way is to install a basic developmentenvironment and then compile nodejs from source.
sudo apt-get updatesudo apt-get install build-essential openssl libssl-dev pkg-configNow download the source tarball and compile it:
cd /tmpwget http://nodejs.org/dist/v0.10.22/node-v0.10.22.tar.gztar zxf node-v0.10.22.tar.gzcd node-v0.10.22./configure --prefix=$HOME/nodejsmake && make installFor ease of use, I recommend that you add the npm bin directory to your PATH bytyping
export PATH=$PATH:$HOME/nodejs/binYou can also add this line to the end of$HOME/.profile so it gets added tothe PATH every time you open a shell session.
Once you have node installed, you can use npm to install the rest of what youneed. You will need coffee script and lessc if you're going to hack on theAloha code.
npm install -g coffee-scriptnpm install -g lessNext clone the bookeditor repo. For this example we will clone it into yourhome directory:
cd $HOMEgit clone git@github.com:oerpub/github-bookeditor.gitThen use npm to install all dependencies:
cd github-bookeditornpm installThe simplest way to get going, is to install the node package calledhttp-server:
npm install -g http-serverThen you can launch a web-server by typing:
http-serverThe application itself can then be found athttp://localhost:8080/
Another option is to install apache and symlink your development directoryinto the default document root:
sudo apt-get install apache2sudo ln -s $HOME/github-bookeditor /var/www/github-bookeditorThe application can then be found athttp://localhost/github-bookeditor/
The github bookeditor depends on severalseveral components.These components can be found in thebower_components directory. Some ofthese are themselves checkouts from github, but unfortunately these are notreal clones, so direct development on these are not possible.
To develop these products, you need to remove the existing checkout, andreplace it with a clone. Because runningnpm install blows away anychanges you made in bower_components, the suggested method is to clone it toan alternate directory and use symlinks. It is much simpler to replace asymlink than it is to re-clone a large product such as aloha-editor.
For example, if I want to develop on Aloha-Editor, I would link itlike this:
cd bower_componentsgit clone git@github.com:oerpub/Aloha-Editor.git aloha-editor-devrm -rf aloha-editor && ln -s aloha-editor-dev aloha-editorThis will create a symlink in bower_components that point to a real checkoutin aloha-editor-dev, allowing you to do development in a familiar setting.
If your operating system doesn't support symlinks, you have no choice but toname your git clone correctly. If you accidentally blow it away, you'd have torepeat the above steps to clone it again.
To avoid blowing away your development clone in bower_components, you caneditbower.json and temporarily remove that item from the dependencies. Justtake care not to accidentally commit bower.json in this shape.
Documentation is built usingdocco.
find . -name "*.coffee" | grep -v './bower_components/' | grep -v './node_modules' | xargs ./node_modules/docco/bin/doccoCheck the./docs directory to read through the different modules.
Except for the technologies listed above, the book editor itself is made upof three other products that each live in its own repository. The editor itselfstarted its life asatc, but was soonused as the basis for the a github basedbook editor.
At the time of writing,work is in progress to make atcgeneric enough that github-book would consist of only a hand full of extensionsand replacements.
A further progression in this process would be tosplit the common part fromatcso that atc and the bookeditor can each have their own customisations.
You should find all the relevant components in thebower_components directoryinside the github-bookeditor checkout.
TODO: Update this once the product is split.
scripts/collections/Backbone Collectionsscripts/configs/App and 3rd party configsscripts/controllers/Marionette Controllersscripts/helpers/Miscellaneous helper functionsscripts/models/Backbone Models and Marionette Modulesscripts/nls/Internationalized stringsscripts/routers/Marionette Routersscripts/views/Backbone and Marionette Viewsscripts/views/layouts/Marionette Layoutsscripts/app.coffeeMarionette Applicationscripts/config.coffeeRequirejs Configscripts/main.jsInitial Requirejs Loaderscripts/session.coffeeModel of Sessionstyles/LESS and CSS Stylingtemplates/Handlebars Templatestemplates/helpers/Handlebars Helperstest/Testable mock data and scriptsindex.htmlApp's HTML Page
This software is subject to the provisions of the GNU Affero General Public License Version 3.0 (AGPL). See license.txt for details.
Code contributed by Rice University employees and contractors is Copyright (c)2013 Rice University. Code contributed by contractors to the OERPUB project isCopyright (c) 2013 Kathi Fletcher.
Development by the OERPUB project was funded by the Shuttleworth Foundation,through a fellowship and project funds granted to Kathi Fletcher.
About
Edit Textbooks using Javascript and save to GitHub
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Languages
- CoffeeScript44.3%
- JavaScript40.5%
- CSS7.3%
- HTML6.4%
- Shell1.5%