sir-trevor-js

Rich content editing entirely re-imagined for the web

  • 所有者: madebymany/sir-trevor-js
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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

主要指標

概覽
名稱與所有者madebymany/sir-trevor-js
主編程語言JavaScript
編程語言HTML (語言數: 6)
平台
許可證MIT License
所有者活动
創建於2012-08-06 07:50:15
推送於2024-06-10 11:39:09
最后一次提交2024-06-10 08:35:51
發布數74
最新版本名稱v0.9.0-beta9 (發布於 2024-06-10 08:38:47)
第一版名稱0.1.3 (發布於 2012-12-18 12:49:34)
用户参与
星數4.5k
關注者數122
派生數396
提交數1.4k
已啟用問題?
問題數341
打開的問題數45
拉請求數205
打開的拉請求數6
關閉的拉請求數43
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?