patternlab-php-core icon indicating copy to clipboard operation
patternlab-php-core copied to clipboard

DPL: Adding Ability for Markdown Files to Specify Which Pattern It Should Be Associated With (ex. README.md)

Open sghoweri opened this issue 8 years ago • 4 comments

Original pull request from the Drupal Pattern Lab Fork which already merged in these 9 previous PRs.

For example, if I had a colors.twig file in my code with a README.md file living right next to it (living in a colors folder), currently this file is completely ignored by Pattern Lab.

This update adds the ability to specify a patternType option in the markdown file's front matter to tell Pattern Lab which pattern it should be associated with (or more specifically, which patternType it should be associated with).

---
title: Color Palette
patternType: colors
---

Our primary palette consists of our primary brand color...

Besides offering more flexible in how files are named, this also helps make Pattern Lab much friendlier to monorepo projects where each pattern might be individually versioned, documented, and published to NPM and/or Github where README.md filenames provide a better user experience if browsing a pattern's source files.

CC @aleksip @EvanLovely @evanmwillhite

sghoweri avatar Oct 06 '17 21:10 sghoweri

And just so this doesn't accidently get lost, @EvanLovely also mentioned: Awesome! Tested & works. Could we get it so it could make this scenario work?

  • atoms/
    • 06-buttons/
      • button-primary
      • button-alt
    • 06-buttons.md

When you name files like 06-buttons.md it places it above the group, full width, and always visible. I like that placing a lot.

sghoweri avatar Oct 06 '17 21:10 sghoweri

See #48

EvanLovely avatar Oct 12 '17 06:10 EvanLovely

And #34

EvanLovely avatar Oct 12 '17 06:10 EvanLovely

FYI, just added these to MD docs config: https://github.com/pattern-lab/patternlab-php-core/pull/137

EvanLovely avatar Oct 12 '17 22:10 EvanLovely