Giter Club home page Giter Club logo

friendlycode's Introduction

Build Status

This is a friendly HTML editor that uses slowparse and hacktionary to provide ultra-friendly real-time help to novice webmakers.

Prerequisites

Using Friendlycode doesn't actually require anything other than a static file server like Apache. However, if you want to generate optimized builds and run the test suites, you'll need node 0.8+, npm 1.1+, and phantomjs 1.7+.

Quick Start

git clone --recursive git://github.com/mozilla/friendlycode.git
cd friendlycode
npm install
npm test

To run a simple built-in static file server from the repository's root directory, run:

node bin/server.js

Examples

You can see a trivial embedding at:

http://localhost:8005/examples/bare.html

By default, friendlycode doesn't allow JS. An example of an embedding that allows JS and publishes using an alternate API is here:

http://localhost:8005/examples/alternate-publisher.html

Localization

We currently use Transifex for localization. To localize Friendlycode in your language, please visit the Transifex friendlycode project. Any strings you don't translate will fall-back to English.

Trying out a Localization

Run node bin/server.js and visit http://localhost:8005/examples/transifex.html. If this doesn't work, however—or if it runs too slowly for your tastes—you will have to take the following steps.

  1. Run node bin/transifex.js -u user:pass, where user:pass is your Transifex username and password. You can run node bin/transifex.js --help for information on more options, such as only importing strings that have been reviewed. This will export all Transifex localizations as requirejs i18n bundles in the transifex directory.

  2. Run node bin/server.js and then visit http://localhost:8005/examples/transifex.html?local=1 to see your localizations.

Adding a new i18n bundle module

Before adding a new i18n bundle, first read the requirejs i18n bundle documentation.

When creating an i18n bundle, you only need to provide the root localization. The following instructions assume that your new i18n bundle module is at js/fc/nls/foo.

  1. Run node bin/build-i18n.js plist fc/nls/foo > foo.plist. This will output a Property List file to foo.plist, which Transifex can use as a template for localization.

  2. Under friendlycode's resource management page on Transifex, add a new resource with name fc/nls/foo and i18n type Apple PLIST files (.plist). Then upload the foo.plist file.

Updating an existing i18n bundle module

If the root localization for an i18n bundle module has changed, follow the same steps for adding a new i18n bundle (above), but simply re-upload the plist file for the existing module instead of creating a new one.

Deploying an internationalized widget

See the source code in examples/transifex.html for information on how to do this with unoptimized builds.

For optimized builds, use the --i18n-url option to bin/build-require.js to create an optimized build that retrieves its localizations at run-time from a different URL. For instance, if you deploy your Transifex requirejs i18n bundles to /locale, running node bin/build-require.js --i18n-url="/locale/" will create an optimized build that loads localizations from that URL at runtime.

Updating CodeMirror

In the vendor/codemirror2 directory is a mini-distribution of CodeMirror which contains only the files necessary for HTML editing. It can be updated with the bin/update-codemirror.py script.

friendlycode's People

Contributors

toolness avatar pomax avatar stenington avatar smagch avatar brianloveswords avatar alicoding avatar cmcavoy avatar k88hudson avatar davidascher avatar jbuck avatar

Watchers

James Cloos avatar Vikas Reddy Burri avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.