• Stars
    star
    4,515
  • Rank 9,445 (Top 0.2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 12 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rich content editing entirely re-imagined for the web

Sir Trevor

Build Status

Conceived by Andrew Sprinz. Maintained by Chris Bell & Andrew Walker.

Upgrade guide from v0.5

Quick start

The recomended way to install Sir Trevor in your project is using npm. This will install all the files required in the build directory for the module.

npm install sir-trevor

Note: Sir Trevor is distributed combined with its dependencies. If you wish to modify Sir Trevor you will want to clone the repository and use the Compiling instructions below.

HTML

<form><textarea class="js-st-instance"></textarea></form>

Javascript

import SirTrevor from "sir-trevor";

const editor = new SirTrevor.Editor({
  el: document.querySelector(".js-st-instance"),
  defaultType: "Text",
  iconUrl: "build/sir-trevor-icons.svg"
});

Full docs

[http://madebymany.github.io/sir-trevor-js/docs.html]

Plain JS

Implementations

  1. Sir Trevor Rails
  2. Umbraco 7, Umbraco 6
  3. CakePHP
  4. Wordpress, Wordpress
  5. Laravel
  6. Django
  7. Yii Framework
  8. Symfony2

Custom blocks

We are keeping a list of custom block repos here. See the documentation to find out more about adding your own block types.

Browser support

Sir Trevor is only tested on the following modern browsers:

ECMAScript 6 shims are bundled in by default; if the platform you wish to run on doesn't support ECMAScript 5 APIs you'll need to shim those yourself.

Sir Trevor uses The Guardian's scribe for rich text editing. Double check their browser support if your application relies on full RTE support.

Contributing

See the roadmap and read a little about the philosophy guiding development.

Customising the way it looks

We use Sass for our styles, if you'd like to change the default styling please fork the repository and make changes to the Sass before recompiling.

Customising blocks

Block Types can also easily be added to the SirTrevor.Blocks object. You can also override the default block types (Text, Image, Tweet, Video, Quote, Heading & List) at any time. See the documentation to find out more about adding your own block types.

Compiling

Tests are run as part of compilation process, which require chromedriver to be installed on the machine where you are running the compilation. If you're running Homebrew on OSX this can be installed via brew install chromedriver.

Before getting started please be sure to install the necessary dependencies via npm:

$ npm install

When completed, we have a couple of preset scripts:

$ npm run dev

This compiles for development, and watches source files to recompile when you change something.

$ npm test

Runs the linter and test suite, just like the CI server does.

$ npm run dist

Concatenates scripts, compiles the Sass, runs the Jasmine tests and minifies the project.

Please ensure any pull requests have relevant Jasmine tests (where applicable).

Current browser support tests

matrix:

  • BROWSER_NAME='chrome' BROWSER_VERSION='51' PLATFORM='OSX 10.10'
  • BROWSER_NAME='chrome' BROWSER_VERSION='51' PLATFORM='Windows 7'
  • BROWSER_NAME='firefox' BROWSER_VERSION='46' PLATFORM='OSX 10.10'
  • BROWSER_NAME='firefox' BROWSER_VERSION='46' PLATFORM='Windows 7'

Building gh-pages docs

cd website
npm install
bundle exec rake publish PROJECT_ROOT=./ ALLOW_DIRTY=true

License

Sir Trevor is released under the MIT license: opensource.org/licenses/MIT

More Repositories

1

sir-trevor-blocks

A place for Sir Trevor BlockTypes
JavaScript
162
star
2

sir-trevor-rails

Rails gem for Sir Trevor integration.
Ruby
150
star
3

isthetoiletfree

Python
103
star
4

passwordless_auth

A library for simple passwordless authentication
Elixir
49
star
5

css-patterns

CSS
43
star
6

restful-authentication-facebook-connect-tutorial

Restful Authentication Facebook Connect Tutorial
Ruby
34
star
7

eventable

JavaScript
32
star
8

pharod

Docker container names to DNS records that can be resolved locally
Go
28
star
9

allele

A Ruby on Rails app template for even rapid-er prototyping.
Ruby
23
star
10

conan

Conan the Deployer
Ruby
20
star
11

front-end-london

The Front-end London website
JavaScript
20
star
12

Tasky

Sample Continuous Integration project.
15
star
13

bigbird

JavaScript
15
star
14

redux-action-logging

Redux testing utility middleware to log actions received by a store without mocking that store.
JavaScript
10
star
15

croppy

Scales and crops images to specific aspect ratios
JavaScript
9
star
16

tilly

A Slack bot to run standups, with no weird commands to remember
Go
7
star
17

ccdash

Simple build dashboard that understands cctray XML.
JavaScript
7
star
18

bzzzt

Python
7
star
19

coding-club

6
star
20

tweetparser

Extract content from tweets
Ruby
6
star
21

calappy

An iOS app to show an at-a-glance view of a Google Calendar resource's day
Objective-C
5
star
22

lazy_context

Elixir
4
star
23

css-guide-example

CSS
4
star
24

mixpanel_plug

A plug-based approach to Mixpanel tracking with Elixir
Elixir
4
star
25

password-store

Our fork of http://zx2c4.com/projects/password-store/
Shell
4
star
26

sxswagram

Some of the Many go to SXSW 2011
JavaScript
4
star
27

BzzztTray

Objective-C
4
star
28

votr

A super simple voting app we're using for the FEL One Day event
Ruby
4
star
29

parameter_cleaner

Strip angle brackets from Rails parameters at input, providing an extra level of security against XSS vulnerabilities.
Ruby
3
star
30

etcd-package

Debian package for etcd and etcdctl
Shell
3
star
31

roger

A little runit-able, cron-style scheduler
Go
3
star
32

tansit

deb-s3-as-a-service
Haskell
2
star
33

front-end-new-york

Website for FENY
CSS
2
star
34

metallus

Build Debian packages with Docker
Python
2
star
35

assert_valid_html

Check HTML validity without using an external web service
Ruby
2
star
36

environmentor

Ruby config management with a strong, checked schema and mapping from environment
Ruby
2
star
37

moltar

Our developer tool for operating over sets of AWS instances, tagged with well-known metadata.
Go
2
star
38

homebrew-custom

Formulae for our own tools
Ruby
1
star
39

cereal

Rails serialization, the simple way
Ruby
1
star
40

madebymany.github.com

Ruby
1
star
41

packages

ubuntu pkg creation scripts
Shell
1
star
42

Knightmare

Game
JavaScript
1
star
43

nightofthedigitaldead

Night of the Digital Dead Chrome extension
JavaScript
1
star
44

techdu_web

CSS
1
star
45

nephelae

Nephelae runs as a daemon and sends custom stats such as disk space, memory usage to Cloud Watch on a regular basis
Ruby
1
star
46

clippy

Ruby
1
star
47

activeresource-nestful

Ruby
1
star
48

scormtrooper

Ruby gem for parsing SCORM packages
Ruby
1
star
49

spree_country_pricing

Variant Country Pricing for Spree
Ruby
1
star