JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 160
  • Score
    100M100P100Q107447F
  • License ISC

Utility to parse YAML in stylesheets and use it to generate a style guide.

Package Exports

  • yapl

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (yapl) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Node - YAPL

YAPL is an early alpha. I don't suggest using it yet.

YAPL (Yet Another Pattern Library) is a simple task which returns (and optionally saves to file) a JSON object containing everything needed to output a style guide/pattern library. This happens by searching given directories for CSS/SCSS files containing style guide "blocks" which document a particular front end module.

Style guide "blocks" are just YAML data inside of a multiline comment, like so:

/* SG
name: Submit Button
notes: The submit button is great. Use it all the time.
partial: btn
context: btn.submit
*/

Any data can be passed, as long as it's formatted correctly as YAML, but the YAPL task can only generate the HTML example if a "partial" is passed and, optionally, a context, if the partial requires it. This also assumes you are using handlebars files for partials.

The final object is formed based on the folder structure of the given CSS directory.

Development TO-DO List:

  • Set up to look for partials that match the css/scss filename if none is specified