1.1.1 • Published 1 year ago

@nycopportunity/pttrn-docs v1.1.1

Weekly downloads
57
License
GPL-3.0+
Repository
github
Last release
1 year ago

Patterns Documentation

Reusable documentation for pattern libraries created with the @nycopportunity/pttrn CLI. Save time on writing common documentation.

Table of Contents

Available Guides

NameDescription
InstallationHow to install pattern libraries in projects that will use them.
ContributingA general developers contribution and style guide.
PatternsAn overview of the design patterns methodology for elements, components, objects, and utilities.
PrototypingA guide on prototyping with pattern libraries and Figma using the HTML to Figma plugin.
TailwindcssAn introduction to Tailwindcss and Slm markup that will use a tailwindcss.js configuration to create an interactive table demonstrating the configuration.

To include them in other pattern library static documentation sites use the this.include() method and double equals sign == render markdown files as HTML. Pass the full path to the desired file in the node modules directory.

== this.include('../node_modules/@nycopportunity/pttrn-docs/installation.md')

Package variables

The following template variables are used by the documentation to refer to paths specific to your project. Template variables set to this.package refer to values stored in your project's package.json file. Some are required for NPM package.json files and others are custom attributes.

Template VariableDescription
this.package.nameThe package name. See NPM package.json documentation for details. This may or may not include an NPM Organization prefix.
this.package.niceA human readable package or pattern library name.
this.package.versionThe package semantic version. See NPM package.json documentation for details.
this.package.cdn.urlThe preferred CDN url. Usually matches the pattern https://cdn.jsdelivr.net/gh/{{ GitHub Organization }}/{{ repo }}. This example uses JS Delivr.
this.package.cdn.sourceThe GitHub repository url. Usually matches the pattern https://github.com/{{ GitHub Organization }}/{{ repo }}
this.package.cdn.archiveThe GitHub archive url. Usually matches the pattern https://github.com/{{ GitHub Organization }}/{{ repo }}/archive.
this.package.cdn.stylesThe local path to the fully distributed stylesheet module.
this.package.cdn.scriptsThe local path to the fully distributed JavaScript module.
this.package.cdn.svgThe local path to the fully distributed SVG sprite.
this.package.cdn.tailwindcssThe local path to the fully distributed Tailwindcss utility CSS stylesheet.
this.package.cdn.tailwindsassThe local path to the fully distributed Tailwindcss Utility Sass stylesheet.
this.package.instantiations.scriptsThe main script module name used to instantiate the global pattern script. For example new Default() would instantiate a module named Default.

Below is how template variables are set in a sample package.json file.

{
  "name": "@npm-organization/pattern-library",
  "nice": "My Pattern Library",
  "version": "1.0.0",
  "cdn": {
    "url": "https://cdn.jsdelivr.net/gh/github-organization/pattern-library",
    "source": "https://github.com/github-organization/pattern-library",
    "archive": "https://github.com/github-organization/pattern-library/archive",
    "styles": "/dist/scripts/default.css",
    "scripts": "/dist/scripts/default.js",
    "svg": "/dist/svg/svgs.svg",
    "tailwindcss": "/dist/styles/tailwindcss.css",
    "tailwindsass": "/dist/styles/_tailwindcss.scss"
  },
  "instantiations": {
    "scripts": "Default"
  },
  // ...
}

Slm Variables

Additional template variables can be set in the project config/slm.js.

Template VariableDescription
this.marked.headerPrefixPrefix for markdown file heading IDs. This should be set to a blank string if no prefix is desired ''. This assists with inline anchor links.
1.1.1

1 year ago

1.1.0

2 years ago

1.0.7

2 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago