diff --git a/bootstrap.drush.inc b/bootstrap.drush.inc deleted file mode 100644 index fdd9b5cdc04ee5c05067c4066e36a13f173e0d1d..0000000000000000000000000000000000000000 --- a/bootstrap.drush.inc +++ /dev/null @@ -1,126 +0,0 @@ - dt('Generates markdown documentation for the Drupal based code.'), - 'arguments' => [ - 'type' => 'The specific type of documentation to generate, defaults to "all". Can be: "all", "settings".', - ], - 'aliases' => ['bs-docs'], - ]; - return $items; -} - -/** - * Generates markdown documentation. - * - * @param string $type - * The type of documentation. - */ -function drush_bootstrap_generate_docs($type = 'all') { - $types = $type === 'all' ? ['settings'] : [$type]; - foreach ($types as $type) { - $function = "_drush_bootstrap_generate_docs_$type"; - if (function_exists($function)) { - $ret = $function(Bootstrap::getTheme('bootstrap')); - if ($ret) { - drush_log('Successfully generated documentation for: ' . $type, 'success'); - } - else { - drush_log('Unable to generate documentation for: ' . $type, 'error'); - } - } - else { - drush_log('Invalid documentation type: ' . $type, 'error'); - } - } -} - -/** - * Generates settings documentation. - * - * @param \Drupal\bootstrap\Theme $bootstrap - * The theme instance of the Drupal Bootstrap base theme. - */ -function _drush_bootstrap_generate_docs_settings(Theme $bootstrap) { - $filename = realpath($bootstrap->getPath() . '/docs/Theme-Settings.md'); - $marker_start = ""; - $marker_end = "\n"; - $contents = @file_get_contents($filename) ?: ''; - $parts = @preg_split('/' . preg_quote($marker_start, '/') . '|' . preg_quote($marker_end, '/') . '/', $contents) ?: []; - $start = isset($parts[0]) ? [trim($parts[0])] : []; - $end = isset($parts[2]) ? [trim($parts[2])] : []; - - // Determine the groups. - $groups = [ - 'general' => [], - 'components' => [], - 'javascript' => [], - 'cdn' => [], - 'advanced' => [], - ]; - foreach ($bootstrap->getSettingPlugin() as $setting) { - // Only get the first two groups (we don't need 3rd, or more, levels). - $_groups = array_slice(array_filter($setting->getGroups()), 0, 2, FALSE); - if (!$_groups) { - continue; - } - $groups[array_keys($_groups)[0]][implode(' > ', $_groups)][] = $setting->getPluginDefinition(); - } - - // Generate a table of each group's settings. - $lines = [$marker_start]; - foreach ($groups as $subgroups) { - foreach ($subgroups as $group => $settings) { - $lines[] = ''; - $lines[] = '---'; - $lines[] = ''; - $lines[] = "### $group"; - $lines[] = ''; - $lines[] = ''; - $lines[] = ' '; - $lines[] = ' '; - $lines[] = ' '; - $lines[] = ' '; - $lines[] = ' '; - $lines[] = ' '; - $lines[] = ' '; - foreach ($settings as $definition) { - $lines[] = ' '; - $lines[] = ' '; - $lines[] = ' '; - $lines[] = ' '; - } - $lines[] = ' '; - $lines[] = '
Setting nameDescription and default value
'; - $lines[] = $definition['id']; - $lines[] = ' '; - if ($description = trim(str_replace('"', '"', $definition['description']))) { - $lines[] = '
' . $description . '
'; - } - if ($example = trim(Yaml::encode([$definition['id'] => $definition['defaultValue']]))) { - $lines[] = '
' . $example . '
'; - } - $lines[] = '
'; - } - } - $lines[] = $marker_end; - - // Ensure we have link references at the bottom. - $output = implode("\n", array_merge($start, $lines, $end)) . "\n"; - - // Save the generated output to the appropriate file. - return file_put_contents($filename, $output) !== FALSE; -} diff --git a/deprecated.php b/deprecated.php index 2d7ca5b3e960f41cf03062d02c820b91ad74ca24..faf91287f4431448fbf85f7111a00e5ab20596da 100644 --- a/deprecated.php +++ b/deprecated.php @@ -771,19 +771,14 @@ function bootstrap_element_smart_description(array &$element, array &$target = N function bootstrap_get_cdn_assets($type = NULL, $provider = NULL, $theme = NULL) { Bootstrap::deprecated(); $original_type = $type; - $assets = []; + $return = []; $config = \Drupal::config('system.performance'); - $cdnAssets = ProviderManager::load($theme, $provider)->getCdnAssets(); + $assets = ProviderManager::load($theme, $provider)->getCdnAssets(); $types = !isset($type) ? ['css', 'js'] : (array) $type; foreach ($types as $type) { - if ($config->get("$type.preprocess") && !empty($cdnAssets['min'][$type])) { - $assets[$type] = $cdnAssets['min'][$type]; - } - elseif (!empty($data[$type])) { - $assets[$type] = $cdnAssets[$type]; - } + $return[$type] = $assets->get($type, $config->get("$type.preprocess")); } - return is_string($original_type) ? $assets[$original_type] : $assets; + return is_string($original_type) ? $return[$original_type] : $return; } /** diff --git a/docs/Maintainers.md b/docs/Maintainers.md index c7acb932ec7c88ddfc2eb02b2c184525247354f5..1939ce144614204b8353fe3fd58bf8255758ed6e 100644 --- a/docs/Maintainers.md +++ b/docs/Maintainers.md @@ -28,15 +28,6 @@ After NodeJS has finished installing its own modules, it will automatically invoke `grunt install` for you. This is a grunt task that is specifically designed to keep the project in sync amongst maintainers. -## Drush -There are several commands available to run, please execute `drush` to view the -full list. This topic only covers the commands this project created. - -### `drush bootstrap-generate-docs` or `drush bs-docs` -Generates markdown documentation for the Drupal based code. Possible arguments: -- **type:** The specific type of documentation to generate, defaults to `all`. - Possible values: `all|settings` - ## Grunt There are several tasks available to run, please execute `grunt --help` to view the full list of tasks currently available. This topic only covers the most @@ -105,6 +96,15 @@ this limits the rapid development of the `overrides.less` file to the default Bootstrap theme. If you have switched themes, you must manually compile all the version and theme override files. +## Custom Scripts +This project also uses custom/standalone PHP scripts opposed to vendor specific +CLI programs (e.g. Drush or Drupal Console). This is primarily to ensure these +scripts can be executed regardless of which vendor specific CLI program or +version a maintainer may have installed. + +### `./gen-theme-setting-docs.php` +Generates the markdown documentation for all available theme settings. + ## Releases This project attempts to provide more structured release notes. This allows the project to communicate more effectively to the users what exactly has changed @@ -128,6 +128,11 @@ However, if it is long, it should really be a change record.

 

Changes since ():

+

Security Announcements

+ +

New Features