MCPcopy Index your code
hub / github.com/madebymany/sir-trevor-js

github.com/madebymany/sir-trevor-js @v0.8.2 sqlite

repository ↗ · DeepWiki ↗ · release v0.8.2 ↗
84 symbols 130 edges 132 files 0 documented · 0%
README

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:

  • IE11+ (https://github.com/madebymany/sir-trevor-js/tree/ie-support)
  • Chrome 51+
  • Safari 9+
  • Firefox 47+

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

Core symbols most depended-on inside this repo

isAtStart
called by 4
src/blocks/scribe-plugins/shared.js
getTotalLength
called by 4
src/blocks/scribe-plugins/shared.js
createBlock
called by 4
spec/e2e/helpers.js
isMsWordListParagraph
called by 3
src/blocks/scribe-plugins/scribe-paste-plugin.js
selectToEnd
called by 3
src/blocks/scribe-plugins/shared.js
isAtEnd
called by 3
src/blocks/scribe-plugins/shared.js
createListBlock
called by 2
src/blocks/scribe-plugins/scribe-paste-plugin.js
handleListItems
called by 2
src/blocks/scribe-plugins/scribe-paste-plugin.js

Shape

Function 84

Languages

TypeScript100%

Modules by API surface

src/blocks/scribe-plugins/shared.js10 symbols
src/blocks/scribe-plugins/scribe-paste-plugin.js6 symbols
src/block-controls.js6 symbols
src/selection-handler.js5 symbols
src/block-addition.js4 symbols
spec/e2e/text-editing.spec.js4 symbols
src/helpers/drop-events.js3 symbols
src/block.js3 symbols
src/block-addition-top.js3 symbols
spec/e2e/format-bar.spec.js3 symbols
src/to-markdown.js2 symbols
src/extensions/file-uploader.js2 symbols

Dependencies from manifests, versioned

@babel/core7.2.2 · 1×
@babel/preset-env7.2.3 · 1×
array.prototype.find2.0.4 · 1×
autoprefixer-loader3.2.0 · 1×
babel-core7.0.0-bridge.0 · 1×
babel-jest23.6.0 · 1×
babel-loader8.0.4 · 1×
css-loader2.0.2 · 1×
es5-shim4.5.12 · 1×
es6-promise4.2.5 · 1×
es6-shim0.35.4 · 1×

For agents

$ claude mcp add sir-trevor-js \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact