diff --git a/webprofiler/README.md b/webprofiler/README.md index 5ba8bc4..77f7671 100644 --- a/webprofiler/README.md +++ b/webprofiler/README.md @@ -4,29 +4,29 @@ - d3.js: Webprofiler module requires D3 library 3.x (not 4.x) to render data. - 1) Create a /libraries/d3/ directory below your Drupal root directory - 2) Download https://d3js.org/d3.v3.min.js - 3) Rename it to /libraries/d3/d3.min.js - - For further details on how to obtain D3.js, see https://github.com/d3/d3/ - - highlight.js: Webprofiler module requires highlight 9.7.x library to syntax highlight collected queries. - Download http://highlightjs.org into /libraries/highlight - -If you use composer to manage dependencies and composer/installers plugin you could add those lines to composer.json: + +##Install using Composer (recommended) + +If you use composer to manage dependencies, edit `composer.json` as follows. + +First, make sure you have the `composer/installers` plugin in the "require" +section of your `composer.json` + +Add the following to the "require" section: ``` "d3/d3": "3.5.*", "components/highlightjs": "9.7.*" ``` -to require section. +Add the following in "installer-paths": ``` "libraries/{$name}": ["type:drupal-library"], ``` -to installer-paths section. +Finally, add this in "repositories": ``` { @@ -56,8 +56,24 @@ to installer-paths section. } } ``` +Then run `composer update` - you should find new directories have been created +under /libraries + +##Manual install + +- d3.js: + + - Create a `/libraries/d3/` directory below your Drupal root directory + - Download https://d3js.org/d3.v3.min.js + - Rename it to /libraries/d3/d3.min.js + + For further details on how to obtain D3.js, see https://github.com/d3/d3/ + + - highlight.js: + + - Create `/libraries/highlightjs/` directory below your Drupal root directory + - Download the library and CSS from http://highlightjs.org into it -to repositories section. #IDE link: diff --git a/webprofiler/webprofiler.install b/webprofiler/webprofiler.install index fee63ea..e9828ed 100644 --- a/webprofiler/webprofiler.install +++ b/webprofiler/webprofiler.install @@ -99,7 +99,7 @@ function webprofiler_requirements($phase) { $requirements['d3js']['severity'] = REQUIREMENT_WARNING; $requirements['d3js']['description'] = [ '#prefix' => ' ', - '#markup' => t('Webprofiler module requires D3.js library to properly render data. See README.md file to learn how to download it.'), + '#markup' => t('Webprofiler module requires D3.js library to properly render data. Composer based install recommended, see README.md file for instructions.'), ]; } @@ -113,7 +113,7 @@ function webprofiler_requirements($phase) { $requirements['highlightjs']['severity'] = REQUIREMENT_WARNING; $requirements['highlightjs']['description'] = [ '#prefix' => ' ', - '#markup' => t('Webprofiler module requires highlight.js library to syntax highlight collected queries. See README.md file to learn how to download it.'), + '#markup' => t('Webprofiler module requires highlight.js library to syntax highlight collected queries. Composer based install recommended, see README.md file for instructions.'), ]; } }