Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Formally declare markdown with yaml as Pattern Meta (patternMeta) #34

@EvanLovely

Description

@EvanLovely

Each *.md has been consider "Documentation" and appears in various ways to tell more about the pattern. Originally, changing the file name of the pattern informed pattern lab about it: _pattern.twig to hide it, -pattern.twig to only show in menu, [email protected] to show state. Those all are less than ideal as not only are they cryptic and limited, but systems outside of Pattern Lab that don't understand the Pattern Lab Partial Syntax get thrown off by files constantly having to be renamed. Here is what I'm proposing for being able to go into a Pattern Meta markdown file:

---
title: My title 
state: inprogress
hidden: true
noviewall: true
order: 5
tags:
  - products
  - teasers
annotations:
  - 
    title: Masthead
    element: .c-header
    annotation: The main header of the site doesn't take up too much screen real estate in order to keep the focus on the core content. It's using a linear CSS gradient instead of a background image to give greater design flexibility and reduce HTTP requests. 
links:
  - 
    label: Demo
    url: "#"
  - 
    label: Article
    url: "#"
  - 
    label: Source
    url: "#"
---
My *super* cool markdown description...

OK, there's a lot there, let's break it down:

  • title - Overrides pattern name derived from file name.
    • Already implemented in PHP & Node
  • state - Sets state. Replaces appending @inprogress to filename.
    • Was how Node version did it already
    • PHP version updated to this method this week at v2.8.4.
  • hidden - Hides pattern everywhere aka prepending _ to filename.
    • Implemented in PHP version this week at v2.8.4
  • noviewall - Hides pattern from View All lists, but keeps in menu aka prepending - to filename.
    • Added this week in PHP at v2.8.4
  • order - Order of pattern, would replace prepending filename by 05-.
  • tags - Arbitrary tags for whatever the future may hold.
  • annotations - Discussed very recently over in Move annotations to markdown file #33
  • links - Collection of links - useful as they would all require target="_blank" or target="_parent" to work correctly in the <iframe> and covers all sorts of Jira ticket, documentation, or inspiration article scenarios one would want.

Again, a lot there, but I wanted to summarize the best I could. I'm down to narrow that down a bit or whatever, but I think it's a good idea to say: "this is where we keep information about the pattern itself". Since everything *.yml / *.json is all about data passed to the pattern, I think it'd be best to do it this way.

Additionally, I think that we should create a JSON Schema that defines this data model that both PHP & Node could pull into validate.

I know a lot of discussion has gone on around this already, but I've done my best to aggregate it all. I'd love to see this in the PL Docs as "Pattern Meta" and under the hood in PHP/Node as patternMeta with the same structure.

Thoughts? Am I missing anything?

Related Issues
Related code blocks

/cc @pattern-lab/voting-members

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions