-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DPL: Add Ability to Disable Default Pattern Data Rules + Add Extra Pattern Data Rules #124
Open
sghoweri
wants to merge
25
commits into
pattern-lab:master
Choose a base branch
from
drupal-pattern-lab:feature/configurable-pattern-data-rules-v2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
DPL: Add Ability to Disable Default Pattern Data Rules + Add Extra Pattern Data Rules #124
sghoweri
wants to merge
25
commits into
pattern-lab:master
from
drupal-pattern-lab:feature/configurable-pattern-data-rules-v2
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove extra character from InstallerUtil so dev branch works
… comments to explain my PHP chicken scratch. Addresses existing open issue #3 and corresponds with the 2nd half of work mentioned in drupal-pattern-lab/patternengine-php-twig#1
Updating global data to use `yml` or `yaml`
v2.8.0 RC - Merging Latest on Dev into Master
This reverts commit 8a51a73.
This reverts commit 505f32c.
Replace possible dots in pattern names with dashes
…-lineages Fix for Broken Lineage Functionality in PL When Using Twig templates w/ Path Namespaces (ie. Drupal 8-friendly Paths)
Don't overwrite nameClean if it has already been set
…exist when scanning the pattern source directory for patterns; adds the RecursiveIteratorIterator flag to follow symbolic links while still continuing to skip dots (. and ..). This opens the door for some creative workarounds to the rigid way Pattern Lab expects pattern templates to be organized at the file system level + how the physical path to a pattern determines how it's organized in Pattern Lab... pattern-lab#28
Allow Pattern Lab to follow pattern symlinks when registering patterns
…sabled in addition to providing a way to load additional extra rules as well to allow for deeper customization than previously possible. Solves use cases described in #11
This was referenced Oct 6, 2017
@sghoweri Looks like there are a few |
@aleksip whoops - missed that. Revered those composer.json changes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original pull request from the Drupal Pattern Lab Fork which already merged in these 9 previous PRs.
This allows for for any of the default set of Pattern Lab data rules to be optionally disabled in addition to allowing for extra rules to be added as well. While not that big of a change in of itself (besides checking a couple optional config options) this opens the door wide open for the customization and continued evolution of Pattern Lab well beyond what is currently possible.
cough Installable Components cough
Should address the two main use cases described in #11.
To Disable A Default Pattern Lab Rule
For example, to disable the default Markdown documentation rule, add the following to your config.yml file:
To Add A New Custom Rule
To add a new extra rule (say, to locally add in a super-powered markdown data rule that allows Twig templates to get embedded and compiled in .md files) add the following to your
config.yml
config + create a new_extensions/rules
folder in your PL source folder to house your new Rule files.With a new test rule file (
DocumentationRule.php
) added tosource/_extensions/rules/DocumentationRule.php
Customize Pattern Rule Folder Location
There's also an optional config option to specify the location of your rules folder:
CC @evanmwillhite @aleksip @legostud
Side note: @christophersmith262 sorry, I totally didn't realize you had already created a feature branch for this a while back (allowing for default PL rules to be disabled) until I was tried to push my feature branch for this.
Could you take a peek at what I came up with to see if there's a way to incorporate your single array / loop approach idea with this while still allowing for rules to either be opted out of and/or opted in?