diff --git a/README.txt b/README.txt index 465a341..d8d9a6b 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ CodeSnippet -Installation -============ +Installation (Manual) +===================== This module requires the core CKEditor module and the CodeSnippet plugin from CKEditor.com. @@ -10,6 +10,43 @@ This module requires the core CKEditor module and the CodeSnippet plugin from CK 3. Enable CodeSnippet in the Drupal admin. 4. Configure your WYSIWYG toolbar to include the buttons. +Installation (Composer) +======================= + +1. Ensure you have 'composer/installers' as a requirement in your main 'composer.json' file. If you do, skip to 4 +2. Run 'composer require composer/installer' to add this package to your installation. It will make sure modules and libraries end up in their correct location. +3. Add this to the 'composer.json', change the webroot to match your Drupal 8 installation path: + ''' + { + "extra": { + "installer-paths": { + "__WEBROOT__/libraries/{$name}": ["type:drupal-library"] + } + } + } + ''' +4. In the "repositories" section of your 'composer.json' file, add the following code to require the plugin: + ''' + "repositories": [ + ... + { + "type": "package", + "package": { + "name": "ckeditor/codesnippet", + "version": "4.8.0", + "type": "drupal-library", + "dist": { + "url": "https://download.ckeditor.com/codesnippet/releases/codesnippet_4.8.0.zip", + "type": "zip" + } + } + } + ] + ''' +5. Run 'composer require ckeditor/codesnippet:4.8.0' add the library itself to your composer required list. +6. Enable CodeSnippet in the Drupal admin. +7. Configure your WYSIWYG toolbar to include the buttons. + Basic Usage ===========