Giter VIP home page Giter VIP logo

symfony-ux-ckeditor5's Introduction

symfony-ux-ckeditor5

Installation

Download using composer

Add repository url to your composer.json

    "repositories": {
        "xearts/symfony-ux-ckeditor5": {
            "type": "github",
            "url": "https://github.com/xearts/symfony-ux-ckeditor5.git"
        }
    }

Require the bundle with composer :

$ composer require xearts/symfony-ux-ckeditor5

Enable the bundle

Enable the bundle in the kernel :

// config/bundles.php
return [
    // ...
    Xearts\Symfony\UX\Ckeditor5\XeartsCkeditor5Bundle::class => ['all' => true],
];

Enable stimulus controller

Add package to package.json :

  // package.json
  // ...
  "devDependencies": {
    // ...
    "@xearts/symfony-ux-ckeditor5": "file:vendor/xearts/symfony-ux-ckeditor5/Resources/assets",
    // ...
  }

Add controler to assets/controllers

    "controllers": {
        // ...
        "@xearts/sumfony-ux-ckeditor5": {
            "ckeditor5": {
                "enabled": true,
                "fetch": "eager"
            }
        }
    },

assets build setting

Install dependency

$ yarn install --force

Add ckeditor5 encore setting to webpack.config.json

const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' );
const { styles: ckeditorstyles } = require( '@ckeditor/ckeditor5-dev-utils' );

// ...
// ...
Encore
    // ...
    // ...
    
    
    .addPlugin( new CKEditorWebpackPlugin({
        // See https://ckeditor.com/docs/ckeditor5/latest/features/ui-language.html
        language: 'ja',
        additionalLanguages: ['en'],
        addMainLanguageTranslationsToAllAssets: true
    }))

    // Use raw-loader for CKEditor 5 SVG files.
    .addRule({
        test: /ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/,
        loader: 'raw-loader'
    })

    // Configure other image loaders to exclude CKEditor 5 SVG files.
    .configureLoaderRule('images', loader => {
        loader.exclude = /ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/;
    })

    // Configure PostCSS loader.
    .addLoader({
        test: /ckeditor5-[^/\\]+[/\\]theme[/\\].+\.css$/,
        loader: 'postcss-loader',
        options: ckeditorstyles.getPostCssConfig({
            themeImporter: {
                themePath: require.resolve('@ckeditor/ckeditor5-theme-lark')
            }
        })
    })

Usage

TODO

symfony-ux-ckeditor5's People

Contributors

xaanton avatar xatakab avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

thislg

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.