Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Edit Textbooks using Javascript and save to GitHub

License

NotificationsYou must be signed in to change notification settings

oerpub/github-bookeditor

 
 

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.

Book Format

Technologies used

Development and Building

Below are instructions for building the book editor yourself and a layoutof how the code is organized.

Building

With Vagrant

  • Installvirtualbox
  • Installvagrant
  • Clonegithub book editor repo to somewhere
  • Inside the repo runvagrant up from 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 runningvagrant upwithvagrant ssh, then go into/vagrant and runnpm install. Thatwill finish the build for you.
  • 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.

On Ubuntu Linux

This is tested on Ubuntu 12.04.

Installing node.js

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-config

Now 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 install

For ease of use, I recommend that you add the npm bin directory to your PATH bytyping

export PATH=$PATH:$HOME/nodejs/bin

You can also add this line to the end of$HOME/.profile so it gets added tothe PATH every time you open a shell session.

Installing coffeescript

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 less

Installing the book editor

Next clone the bookeditor repo. For this example we will clone it into yourhome directory:

cd $HOMEgit clone git@github.com:oerpub/github-bookeditor.git

Then use npm to install all dependencies:

cd github-bookeditornpm install

Setting up a web server

  • The simplest way to get going, is to install the node package calledhttp-server:

    npm install -g http-server

    Then you can launch a web-server by typing:

    http-server

    The 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-bookeditor

    The application can then be found athttp://localhost/github-bookeditor/

Developing on components in bower_components.

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-editor

This 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.

Building Documentation

Documentation is built usingdocco.

find . -name "*.coffee" | grep -v './bower_components/' | grep -v './node_modules' | xargs ./node_modules/docco/bin/docco

Check the./docs directory to read through the different modules.

Code layout

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.

Directory Layout

TODO: Update this once the product is split.

  • scripts/collections/ Backbone Collections
  • scripts/configs/ App and 3rd party configs
  • scripts/controllers/ Marionette Controllers
  • scripts/helpers/ Miscellaneous helper functions
  • scripts/models/ Backbone Models and Marionette Modules
  • scripts/nls/ Internationalized strings
  • scripts/routers/ Marionette Routers
  • scripts/views/ Backbone and Marionette Views
  • scripts/views/layouts/ Marionette Layouts
  • scripts/app.coffee Marionette Application
  • scripts/config.coffee Requirejs Config
  • scripts/main.js Initial Requirejs Loader
  • scripts/session.coffee Model of Session
  • styles/ LESS and CSS Styling
  • templates/ Handlebars Templates
  • templates/helpers/ Handlebars Helpers
  • test/ Testable mock data and scripts
  • index.html App's HTML Page

License

This software is subject to the provisions of the GNU Affero General Public License Version 3.0 (AGPL). See license.txt for details.

Copyright

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.

Funding

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

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CoffeeScript44.3%
  • JavaScript40.5%
  • CSS7.3%
  • HTML6.4%
  • Shell1.5%

[8]ページ先頭

©2009-2025 Movatter.jp