GithubHelp home page GithubHelp logo

ckeditor4-presets's Introduction

CKEditor 4 Presets Builder

This builder is a tool that creates CKEditor release files for the main "preset" configurations officially distributed at https://ckeditor.com/. It is targeted to the CKEditor core team, to test the preset builds, to update the ckeditor.com website on new releases and to generate the nightly builds.

A preset is a CKEditor configuration for building that includes a specific set of plugins. Currently, there are 3 presets defined: standard, basic and full.

The original source code from the official CKEditor repositories is used for the build.

Cloning this Code

To clone this code:

> git clone https://github.com/ckeditor/ckeditor4-presets.git

Then, the registered submodules need to be updated:

> git submodule update --init

Running the Builder

The build.sh is the only file you should care about. It downloads CKBuilder, if necessary, and execute the building process.

This is the command syntax:

> build.sh standard|basic|full [all]

The optional "all" argument tells the builder to include all plugins available in the ckeditor4 repository, even if they're not included in the preset.

The build will be then created in the build/[preset name] folder.

Examples:

> # Build a "standard" release.
> build.sh standard

> # Build a "basic" release, including all plugins available.
> build.sh basic all

Creating custom Presets

Apart from using predefined presets, you can create a custom preset manually and use it with the build.sh script. As an example, let's create a preset including basic configuration with the Editor Placeholder plugin.

1. Adding the build configuration file

Create a builder configuration file at presets/custom-build-config.js:

var CKBUILDER_CONFIG = {
	skin: 'moono-lisa',
	ignore: [
		'bender.js',
		'bender.ci.js',
		'.bender',
		'bender-err.log',
		'bender-out.log',
		'.travis.yml',
		'dev',
		'.DS_Store',
		'.editorconfig',
		'.github',
		'.gitignore',
		'.gitattributes',
		'gruntfile.js',
		'.idea',
		'.jscsrc',
		'.jshintignore',
		'.jshintrc',
		'less',
		'.mailmap',
		'node_modules',
		'.npm',
		'.nvmrc',
		'package.json',
		'package-lock.json',
		'README.md',
		'tests'
	],
	plugins: {
		about: 1,
		basicstyles: 1,
		clipboard: 1,
		floatingspace: 1,
		list: 1,
		indentlist: 1,
		enterkey: 1,
		entities: 1,
		link: 1,
		editorplaceholder: 1,
		toolbar: 1,
		undo: 1,
		wysiwygarea: 1
	}
};

2. Adding the editor configuration file

Create an editor configuration file at presets/custom-ckeditor-config.js:

CKEDITOR.editorConfig = function( config ) {
	// The toolbar groups arrangement, optimized for a single toolbar row.
	config.toolbarGroups = [
		{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
		{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
		{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
		{ name: 'forms' },
		{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
		{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
		{ name: 'links' },
		{ name: 'insert' },
		{ name: 'styles' },
		{ name: 'colors' },
		{ name: 'tools' },
		{ name: 'others' },
		{ name: 'about' }
	];

	// The default plugins included in the basic setup define some toolbar buttons that
	// are not needed in a basic editor. These are removed here.
	config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript';

	// Dialog windows are also simplified.
	config.removeDialogTabs = 'link:advanced';

	// Finally, configure editor placeholder text.
	config.editorplaceholder = 'Type something here...';
};

3. Building a custom preset

Run build.sh file:

> # Build a custom "custom" preset.
> build.sh custom

ckeditor4-presets's People

Contributors

ckeditorbot avatar mlewand avatar reinmar avatar f1ames avatar oleq avatar comandeer avatar jacekbogdanski avatar wwalc avatar fredck avatar dumluregn avatar sculpt0r avatar hub33k avatar vokiel avatar scofalik avatar annatomanek avatar adelura avatar engineering-this avatar karoldawidziuk avatar msamsel avatar tade0 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.