From 733431a563ff875a49c74875fd032cbe7f6f356b Mon Sep 17 00:00:00 2001 From: Chris LoPresto Date: Mon, 9 May 2016 12:55:07 -0400 Subject: [PATCH 1/2] Scope freestyle options for safekeeping --- README.md | 4 +++- ember-cli-build.js | 4 +++- index.js | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0a13e753..6ae1f698 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,9 @@ as follows: ```javascript var app = new EmberAddon(defaults, { // ... - snippetSearchPaths: ['tests/dummy/app', 'app/styles'] + freestyle: { + snippetSearchPaths: ['tests/dummy/app', 'app/styles'] + } }); ``` diff --git a/ember-cli-build.js b/ember-cli-build.js index b592ee36..2b9c4e3e 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -9,7 +9,9 @@ module.exports = function(defaults) { browsers: ['last 2 version', '> 10%'], cascade: false }, - snippetSearchPaths: ['tests/dummy/app', 'app/styles'] + freestyle: { + snippetSearchPaths: ['tests/dummy/app', 'app/styles'] + } }); /* diff --git a/index.js b/index.js index 5c25c8d7..2c4edba9 100644 --- a/index.js +++ b/index.js @@ -36,14 +36,16 @@ module.exports = { snippetPaths: function() { if (this.app) { - return this.app.options.snippetPaths || ['snippets']; + var freestyleOptions = this.app.options.freestyle || {}; + return freestyleOptions.snippetPaths || ['snippets']; } return ['snippets']; }, snippetSearchPaths: function() { if (this.app) { - return this.app.options.snippetSearchPaths || ['app']; + var freestyleOptions = this.app.options.freestyle || {}; + return freestyleOptions.snippetSearchPaths || ['app']; } return ['app']; }, From 0bee0044fc33e328d4401ab32c90efaa85e14f70 Mon Sep 17 00:00:00 2001 From: Chris LoPresto Date: Sat, 21 May 2016 18:30:06 -0400 Subject: [PATCH 2/2] Document freestyle-note and freestyle-annotation --- README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ae1f698..97a6a8dd 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,37 @@ By default, variants will be stacked. If you wish to view variants side by side, #### freestyle-note + freestyle-annotation -Documentation coming soon... +_TODO:_ [Simplify Technique for Including Notes](https://github.com/chrislopresto/ember-freestyle/issues/61) + +Use the `freestyle-note` component to add a markdown note for a specific `freestyle-usage`. Note that the `freestyle-note` slug must match the `freestyle-usage` slug followed by `:notes`. + +```hbs +{{#freestyle-usage "globally-unique-slug" title="Title To Display In Style Guide"}} + {{x-foo propa="aaa" propb="bbb"}} +{{/freestyle-usage}} +{{#freestyle-note "globally-unique-slug:notes"}} + # Contextual Markdown Note for x-foo + + You can write helpful _markdown_ notes explaining how the + `x-foo` component works. +{{/freestyle-note}} +``` + +Use the `freestyle-annotation` component to add a general purpose note. + +```hbs +{{#freestyle-annotation}} +

Contextual HTML Note for Anything in the Freestyle Guide

+ +

+ You can write helpful HTML notes explaining anything in the + Freestyle guide. +

+{{/freestyle-annotation}} +``` + +Both the `freestyle-note` and `freestyle-annotation` components respect the +`Show Notes` usage controls preference. ## Customizing the Colors in Ember Freestyle's Own UI