Skip to content
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

Add Ability to Disable Default Pattern Data Rules + Add Extra Pattern Data Rules #17

Closed
wants to merge 1 commit into from

Conversation

sghoweri
Copy link
Collaborator

@sghoweri sghoweri commented Sep 2, 2017

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:

disabledPatternRules:
    - DocumentationRule

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.

extraPatternRules:
    - DocumentationRule

With a new test rule file (DocumentationRule.php) added to source/_extensions/rules/DocumentationRule.php

Customize Pattern Rule Folder Location

There's also an optional config option to specify the location of your rules folder:

extraPatternRulesDir: "source_my-extensions/rules"

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?

…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
@EvanLovely
Copy link

I love this, but again: how does someone coming from the original Pattern Lab know about this and other things we've improved?

@sghoweri
Copy link
Collaborator Author

sghoweri commented Oct 6, 2017

Closing out - new PR opened on the main Pattern Lab repo! pattern-lab#124

@sghoweri sghoweri closed this Oct 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants