Replace a plain textarea in a CMS with a block editor that stores structured JSON content instead of raw HTML.
Add a rich content editor to a Rails, Django, or Laravel app with built-in support for images, embeds, and custom block types.
Build a custom content block type to extend the editor with project-specific units like product cards or code snippets.
Sir Trevor is a JavaScript library that provides a block-based content editor for web pages. Instead of a single text area where you write everything as one blob of text, it lets writers build a page out of discrete content blocks: a paragraph of text here, an image there, a tweet, a video embed, a pull quote. Each block type is independent and can be added, moved, or removed without affecting the others. The editor stores its content as JSON rather than HTML, which makes it easier to save to a database and render differently on different platforms. When a user submits the form, the structured JSON representing all the blocks gets sent to the server instead of a raw HTML string. Installation is done through npm. Using it requires adding a textarea element to an HTML form, then initializing the editor in JavaScript and pointing it at that element. From that point, the textarea is replaced by the block editor interface. The library ships with built-in block types for text, images, tweets, video, quotes, headings, and lists. Custom block types can be added by extending the blocks object, and a list of community-contributed custom block types is maintained on the project wiki. The README lists integrations with several web frameworks including Rails, Django, Laravel, WordPress, and others, so the JSON content format can be consumed on the server side regardless of what backend technology you are using. Sir Trevor was built by the agency Made by Many and is released under the MIT license. The README notes that active development has slowed: tests are included and run as part of the build process, and the project supports modern versions of Chrome, Firefox, and Safari, plus IE11. It uses The Guardian's Scribe library internally for the rich text portions of the editing experience.
← madebymany on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.