diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..08f89ed --- /dev/null +++ b/docs/404.html @@ -0,0 +1,447 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 404 Page not found | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/browserconfig.xml b/docs/browserconfig.xml new file mode 100644 index 0000000..bf660ea --- /dev/null +++ b/docs/browserconfig.xml @@ -0,0 +1,2 @@ + +#ffffff diff --git a/docs/categories/index.xml b/docs/categories/index.xml new file mode 100644 index 0000000..efbc48d --- /dev/null +++ b/docs/categories/index.xml @@ -0,0 +1,14 @@ + + + + Categories on Cupper + https://thepaciellogroup.github.io/cupper/categories/ + Recent content in Categories on Cupper + Hugo -- gohugo.io + en-us + + + + + + \ No newline at end of file diff --git a/docs/css/fonts/miriamlibre-bold.woff b/docs/css/fonts/miriamlibre-bold.woff new file mode 100755 index 0000000..154152d Binary files /dev/null and b/docs/css/fonts/miriamlibre-bold.woff differ diff --git a/docs/css/fonts/miriamlibre-bold.woff2 b/docs/css/fonts/miriamlibre-bold.woff2 new file mode 100755 index 0000000..136f17e Binary files /dev/null and b/docs/css/fonts/miriamlibre-bold.woff2 differ diff --git a/docs/css/images/arrow_effect.svg b/docs/css/images/arrow_effect.svg new file mode 100644 index 0000000..2d669ef --- /dev/null +++ b/docs/css/images/arrow_effect.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/css/images/icon-tick.svg b/docs/css/images/icon-tick.svg new file mode 100644 index 0000000..20f9650 --- /dev/null +++ b/docs/css/images/icon-tick.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/css/images/stripe.svg b/docs/css/images/stripe.svg new file mode 100644 index 0000000..48bf5f9 --- /dev/null +++ b/docs/css/images/stripe.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/css/prism.css b/docs/css/prism.css new file mode 100644 index 0000000..7dc9a0a --- /dev/null +++ b/docs/css/prism.css @@ -0,0 +1,179 @@ +/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript&plugins=line-numbers */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ + +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*="language-"]::selection, pre[class*="language-"] ::selection, +code[class*="language-"]::selection, code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #a67f59; + background: hsla(0, 0%, 100%, .5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + +.token.function { + color: #DD4A68; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + +pre.line-numbers { + position: relative; + padding-left: 3.8em; + counter-reset: linenumber; +} + +pre.line-numbers > code { + position: relative; +} + +.line-numbers .line-numbers-rows { + position: absolute; + pointer-events: none; + top: 0; + font-size: 100%; + left: -3.8em; + width: 3em; /* works for line-numbers below 1000 lines */ + letter-spacing: -1px; + border-right: 1px solid #999; + + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + +} + + .line-numbers-rows > span { + pointer-events: none; + display: block; + counter-increment: linenumber; + } + + .line-numbers-rows > span:before { + content: counter(linenumber); + color: #999; + display: block; + padding-right: 0.8em; + text-align: right; + } diff --git a/docs/css/styles.css b/docs/css/styles.css new file mode 100644 index 0000000..96b3565 --- /dev/null +++ b/docs/css/styles.css @@ -0,0 +1,955 @@ +/* fonts */ +@font-face { + font-family: 'Miriam Libre'; + src: url('fonts/miriamlibre-bold.woff2') format('woff2'), url('fonts/miriamlibre-bold.woff') format('woff'); + font-weight: bold; + font-style: normal; +} +*, +*::before, +*::after { + font-family: inherit; + background-color: inherit; + color: inherit; + margin: 0; + padding: 0; + box-sizing: border-box; +} +html { + font-size: calc(1em + 0.33vw); + font-family: PT Sans, sans-serif; + line-height: 1.5; + color: #111; + background-color: #fefefe; +} +template { + display: none !important; +} +* + * { + margin-top: 2.25rem; +} +br, +dt, +dd, +th, +td, +option, +[hidden] + *, +li + li, +body, +.main-and-footer { + margin-top: 0; +} +p + p { + margin-top: 0.75rem; +} +a { + text-decoration: none; + border-bottom: 1px solid; +} +abbr { + text-decoration: none; + cursor: help; + border-bottom: 1px dashed; +} +img { + max-width: 100%; +} +p img { + margin: 0.75rem 0; +} +figure p img { + margin: 0; +} +:focus:not([tabindex="-1"]), +[data-expands]:focus svg, +.patterns a:focus .text, +[for="themer"] :focus + [aria-hidden] { + outline: 4px solid #999; +} +a { + outline-offset: 2px; +} +/* fix for IE :( */ + +[tabindex="-1"]:focus, +div:not([tabindex]):focus { + outline: none; +} +[hidden] { + display: none; +} + +/* skip link */ + +[href="#main"] { + display: block; + width: 100%; + padding: 0.75rem; + color: #fefefe; + background: #000; + position: absolute; + top: -3rem; + text-align: center; + z-index: 1; +} +[href="#main"]:focus { + top: 0; + outline: none; +} +/* text styles */ + +h1, +h2, +h3, +h4 { + font-family: Miriam Libre, serif; + line-height: 1.125; +} +h1 { + font-size: 2rem; +} +h2 { + font-size: 1.66rem; +} +h3 { + font-size: 1.25rem; +} +h4, +h5 { + font-size: 1rem; + font-family: PT Sans, sans-serif; +} +h5 { + font-size: 0.85rem; + text-transform: uppercase; +} +kbd { + line-height: 1; + font-size: 0.66rem; + padding: 0.1rem 0.33rem; + border-radius: 0.25rem; + border: 2px solid; + box-shadow: 0.125rem 0.125rem 0 #111; + vertical-align: 0.33em; +} +pre, +.file-tree { + overflow-x: auto; + padding: 1.5rem; + border: 1px solid; +} +code { + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 0.85em; +} +.cmd { + padding: 0.75rem; + background: #111; +} +.cmd code { + color: #fefefe; + white-space: nowrap; +} +.cmd code::before { + content: '$'; + font-weight: bold; + padding-right: 0.25em; +} +/* Lists */ + +main ul, +main ol { + margin-left: 2.25rem; +} +main li + li { + margin-top: 0.5rem; +} +main ul ul, main ol ol { + margin-top: 0.5rem; +} +/* Blockquotes */ + +blockquote { + font-size: 0.85rem; + font-style: italic; +} +/* Buttons */ + +button { + font-size: 1.25rem; + border-radius: 0.33em; + font-family: inherit; + background: #111; + color: #fefefe; + padding: 0.75rem; + border: 0; +} +[data-launch] { + font-size: 0.75rem !important; + margin-top: 0.75rem !important; + padding: 0.5rem !important; + border-radius: 0 !important; + box-shadow: none !important; + background: #111 !important; + color: #fefefe !important +} + +/* Forms */ +label { + display: inline-block; + font-weight: bold; +} + +[for="themer"] { + background: #111; + border-radius: 0.33em; + color: #fefefe; + padding: 0.25em 0.75em; + margin: 0.5rem; +} + +[for="themer"] [aria-hidden]::before { + content: 'off'; +} + +[for="themer"] :checked + [aria-hidden]::before { + content: 'on'; +} +/* Tables */ + +table { + text-align: left; + table-layout: fixed; + width: 100%; + border-collapse: collapse; +} +th, +td { + border: 2px solid; + padding: 0.5rem; + line-height: 1.25; + margin: 0; +} +th { + font-weight: bold; +} +th:empty { + border: 0; +} +/* Tested using... table */ + +.tested { + text-align: center; + border: 1px solid #111; +} +.tested tr { + display: flex; + flex-flow: row wrap; +} +.tested td, .tested th { + vertical-align: middle; + overflow: hidden; + flex: 1 0 auto; + border: 1px solid #111; +} +.tested th { + width: 100%; + background-color: #111; + color: #fefefe; + outline-color: #111; +} +.tested img { + max-width: 3rem; +} +.tested span { + display: block; + margin: 0; +} +.tested .additional { + font-size: 0.85rem; +} +caption { + font-size: 1.125rem; + padding-bottom: 0.25rem; + font-style: italic; +} +/* Page structure */ + +.wrapper { + position: relative; + margin-top: 0; + overflow-x: hidden; +} +.intro-and-nav { + font-size: 0.8rem; + width: 15rem; + height: 100vh; + position: fixed; + top: 0; + left: 0; + border-right: 2px solid; +} +.intro-and-nav > div { + padding: 2.25rem; + display: flex; + flex-direction: column; + height: 100%; +} +.intro { + flex: 0 0 auto; +} +.patterns { + flex: 1 1 auto; +} +.logo { + border: 0; +} +.logo img { + width: 100%; + max-width: 12rem; +} +.library-desc { + margin-top: 0.5rem; + margin-left: auto; + margin-right: auto; + max-width: 25rem; +} +.main-and-footer { + margin-left: 15rem; +} +.main-and-footer > div { + max-width: 40rem; + margin: 0 auto; + padding: 2.25rem; +} +[role="contentinfo"] { + font-size: 0.85rem; + margin-top: 4rem; + text-align: center; +} +/* Patterns navigation */ + +.patterns { + overflow: auto; + margin-top: 1.5rem; +} +.patterns * { + margin-top: 0; +} +.patterns h3 { + font-size: 1rem; +} +.patterns h3 + ul { + margin-top: 0.75rem; +} +.patterns li { + line-height: 1.125; + list-style: none; +} +.patterns li + li { + margin-top: 0.75rem; +} +.patterns ul ul { + margin-left: 0.75rem; +} +.pattern a { + border: 0; + display: flex; + flex-wrap: nowrap; + align-items: baseline; + font-weight: bold; +} +.pattern a:focus { + outline: none; +} +.pattern span { + margin-left: 0.125rem; +} +.pattern [aria-current] { + background-color: #111; + background-image: url(images/arrow_effect.svg); + background-position: 98% center; + background-size: 125%; + background-repeat: no-repeat; + color: #fefefe; + padding: 0.5em 1em 0.5em; +} +/* menu button */ + +#menu-button { + display: none; + width: 100%; + text-align: center; +} +#menu-button:focus { + outline: none; + box-shadow: inset 0 0 0 0.25rem #999; +} +/* Tables of contents */ + +.toc { + font-size: 0.85rem; + border: 1px solid; + padding: 1.5rem; +} +.toc h2 { + font-size: 1rem; +} +.toc ol { + margin-left: 0.75rem; + margin-top: 0.5rem; +} +/* Pattern lists */ + +.patterns-list { + list-style: none; + margin-left: 0; +} +.patterns-list h2 { + font-size: 1.25rem; +} +.patterns-list li + li { + margin-top: 1rem; + padding-top: 1rem; + border-top: 2px solid; +} +.patterns-list a { + border: 0; +} +/* Tags */ + +.tags { + margin-top: 0; + font-size: 0.85rem; +} +.tags * { + display: inline; + margin: 0; +} +.tags strong { + margin-right: 0.25rem; +} +.tags li { + white-space: nowrap; + margin: 0 0.25rem 0 0; +} +/* Notes and warnings */ + +.note { + border-left: 0.5rem solid; + font-size: 0.85rem; +} +.note .sign { + height: 2.25rem; + width: 2.25rem; +} +.note > div { + margin-left: 0.75rem; +} +.note > div > img:first-child { + height: 1.5rem; +} +.note > div >:first-child + * { + margin-top: 0; +} +.note.warning { + border-left: 0; + background-image: url(images/stripe.svg); + background-size: 0.5rem auto; + background-repeat: repeat-y; +} +.note.warning > div { + margin-left: 1.25rem; +} +/* Tick lists */ + +.ticks li { + list-style: none; + position: relative; +} +.ticks li::before { + content: ''; + display: inline-block; + width: 1rem; + height: 1rem; + margin-right: 0.25rem; + background-image: url(images/icon-tick.svg); + background-size: 100% auto; + position: absolute; + left: -1.25rem; + top: 0.25rem; +} +/* Figures */ + +figure { + text-align: center; +} +figcaption { + font-size: 0.85rem; + font-style: italic; + margin-top: 0.5rem; +} +main { + display: block; + counter-reset: fig; + min-height: 100vh; +} +figcaption::before { + counter-increment: fig; + content: 'Figure ' counter(fig) ':\0020'; + font-weight: bold; +} +/* Code blocks */ + +pre[class*=language-] { + background: none; + margin-top: 2.25rem; + margin-bottom: 0; + overflow-y: hidden; + overflow-x: auto; +} +code[class*="language-"], pre[class*="language-"] { + text-shadow: none; + filter: grayscale(100%); +} +pre[class*=language-][data-line] { + padding: 1em 0 0 2.25rem; +} +pre[class*=language-] code * { + margin-top: 0 !important; +} +[data-codeblock-shortcode], .code-annotated code { + display: inline-block; + margin-top: -1rem; +} +.code-annotated { + overflow-y: hidden; + overflow-x: auto; + padding: 1.5rem; + border: 1px solid; + white-space: pre; + counter-reset: annotation; +} +.highlight { + background: #ddd; + padding: 0.0625rem 0.33rem; + border-radius: 0.5rem; +} +.numbered .highlight::after, +.code-annotated.numbered + ol li::before { + counter-increment: annotation; + content: counter(annotation); + font-weight: bold; + font-size: 0.5rem; + background: #111; + color: #fefefe; + border-radius: 1rem; + margin-left: 0.25rem; + padding: 0.125em 0.5em; + vertical-align: 0.33em; +} + +.code-annotated.numbered + ol { + list-style: none; + counter-reset: annotation; +} + +.code-annotated.numbered + ol li::before { + font-size: 0.66em; + margin-right: 0.33em; + vertical-align: 0.25em; +} +/* file tree lists */ +.file-tree { + overflow-x: auto; +} +.file-tree ul { + font-family: Courier, monospace; + margin: 0; + padding: 0; + padding-left: 3rem; + list-style: none; + line-height: 1.25; + position: relative; +} +.file-tree > ul { + padding-left: 0; + overflow-x: auto; + overflow-y: hidden; +} +.file-tree li { + background: #fefefe; + position: relative; + white-space: nowrap; +} +.file-tree li + li { + margin-top: 0; +} +.file-tree li:not(:last-child) > ul::before { + content: '\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020'; + position: absolute; + left: 0; + top: 0; + bottom: 0; + width: 1em; + white-space: normal; +} +.file-tree li::before { + content: '\251C\2500\2500\0020'; +} +.file-tree li:last-child::before { + content: '\2514\2500\2500\0020'; +} +/* Expandable sections */ +.expandable-section { + border-top: 1px solid; + border-bottom: 1px solid; + padding: 0.75rem 0; +} +[id^="js-expandable-"] { + margin: 0; + padding: 1.5rem 0 0.75rem; +} +@media screen { + .expandable-section + .expandable-section { + margin-top: 0; + border-top: 0; + } +} +[data-expands] { + text-align: left; + color: #111; + border: 0; + background: none; + width: 100%; + padding: 0; + margin: 0; + display: flex; + align-items: center; + justify-content: space-between; + cursor: pointer; +} +[data-expands] svg { + margin-top: 0; + width: 1em; + height: 1em; +} +[data-expands][aria-expanded="true"] svg .up-strut { + display: none; +} +[data-expands]:focus { + outline: none; +} +p:empty { + display: none; +} +*:not(p) + p:empty + p { + margin-top: 2.25rem; +} +/* WCAG and principles */ +.wcag li { + font-size: 0.85em; +} +.principles p { + font-size: 0.85rem; + margin-top: 0.75rem; +} +.principles.with-desc > li + li, +.wcag.with-desc > li + li { + border-top: 1px solid; + margin-top: 0.75rem; + padding-top: 0.75rem; +} +/* Site errors */ + +.site-error { + padding: 1.5rem; + background: #efefef; +} +.site-error strong { + color: #C83737; +} +/* SVG icons */ +a svg, +button svg, +h1 svg, +th svg, +li > svg { + height: 0.75em; + width: 0.75em; + margin-right: 0.25em; +} +h1 svg { + margin-right: 0; + width: 0.85em; + height: 0.85em; +} +.wcag-icon { + width: 1.25em; +} +.bookmark-icon { + vertical-align: middle; +} +.link-icon { + width: 0.75em; + height: 0.75em; +} +.tags svg, .link-icon { + vertical-align: middle; +} +.balloon-icon { + width: 0.75em; + margin-right: 0; +} +.print { + white-space: nowrap; + font-style: normal; +} +/* Color palettes */ +.colors { + display: flex; + height: 5rem; + margin: -0.25rem; + list-style: none; + flex-wrap: nowrap; +} +.colors li { + margin: 0.25rem; + flex: 1 0 auto; + position: relative; +} +.colors span { + line-height: 1; + background-color: #111; + color: #fefefe; + font-size: 0.75rem; + padding: 0.25rem; + position: absolute; + bottom: 0.25rem; + right: 0.25rem; +} +/* cross references */ +.pattern-link { + font-weight: bold; +} +/* inline demos */ +.demo-inner { + border-top: 1px solid; + border-bottom: 1px solid; + padding: 1.5rem 0 0; + text-align: right; +} + +[id^="js-demo-"] { + all: initial; + display: block; +} +/* Section links */ +.h2-container { + position: relative; + font-size: 1.66rem; +} +.h2-container a { + position: absolute; + margin-top: 0; + top: 0; + line-height: 1; + left: -1em; + border: 0; +} +/* Single page layout */ + +.wrapper.print-version .main-and-footer { + margin-left: 0; +} +.wrapper.print-version .intro-and-nav { + position: static; + border: 0; + width: auto; + text-align: center; + display: flex; + align-items: center; + justify-content: center; +} +.wrapper.print-version main { + min-height: 0; +} +.wrapper.print-version .library-desc { + font-size: 1rem; +} +.wrapper.print-version .intro-and-nav > div { + height: auto; +} +.wrapper.print-version #patterns-list { + margin-left: 0; + margin-top: 1.5rem; + display: block; +} +.wrapper.print-version .toc { + font-size: 1rem; +} +.wrapper.print-version .toc h2 { + font-size: 1.66rem; +} +.wrapper.print-version #patterns-list h3 { + font-size: 1.25rem; +} +.wrapper.print-version .patterns { + margin-top: 0; +} +.pattern-section:not(:last-child) { + padding-bottom: 2.25rem; + border-bottom: 2px solid; +} +.pattern-section h1 { + padding: 0 !important; +} +/* Custom 404 */ +.custom-404 { + text-align: center; +} +.custom-404 * { + margin: 0; +} +.custom-404 svg { + max-width: 100%; +} +/* Utilities */ +.vh { + clip: rect(1px, 1px, 1px, 1px); + height: 1px; + overflow: hidden; + position: absolute; + white-space: nowrap; + width: 1px; +} +@media screen and (max-width: 45em) { + + body a { + hyphens: auto; + } + + [role="banner"] { + position: static; + width: auto; + height: auto; + } + .intro { + text-align: center; + } + .intro-and-nav > div { + padding: 1.5rem; + } + .main-and-footer { + margin: 0; + } + main { + min-height: auto; + } + .patterns h3 { + font-size: 1.125rem; + border-top: 4px solid; + border-bottom: 4px solid; + padding: 0.75rem 0; + } + .patterns li:not(.pattern) { + margin-top: 0; + } + .patterns ul ul { + margin: 0; + } + .patterns li { + margin-top: 0; + } + .pattern { + font-size: 1rem; + } + .pattern a { + padding: 0.75rem 0; + } + .pattern [aria-current] { + background-image: none; + } + .pattern + .pattern { + border-top: 1px solid; + margin-top: 0; + } + #menu-button { + display: block; + } + #patterns-list { + display: none; + } + .toc-link { + display: none; + } + [aria-expanded="true"] + #patterns-list { + display: block; + } + code { + word-break: break-all; + } +} +@media print { + .wrapper:not(.print-version) .intro-and-nav, + .wrapper:not(.print-version) [role="contentinfo"] { + display: none; + } + .main-and-footer { + margin-left: 0; + } + a { + border: 0; + } + main a::after { + content: " (" attr(href) ")"; + word-break: break-word; + } + main nav a::after { + content: ''; + } + .cmd code { + background: #fefefe; + color: #111; + } + pre code { + white-space: pre-wrap !important; + } + .expandable-section { + border: 0; + padding: 0; + } + .expandable-section + p { + margin-top: 0.75rem; + } + [id^="js-expandable-"] { + display: block; + } + [data-expands] svg { + display: none; + } + main *:not(.with-desc) { + page-break-inside: avoid; + } + .note.warning { + border-left: 0.5rem solid; + background: none; + } +} +@media (-ms-high-contrast: active) { + img[src*=".svg"] { + background: #fefefe; + padding: 0.5rem; + } + .ticks li::before { + content: '✓'; + background: none; + width: auto; + top: 0; + } + .note.warning { + border-left: 0.5rem solid; + background: none; + } +} diff --git a/docs/images/android-icon-144x144.png b/docs/images/android-icon-144x144.png new file mode 100644 index 0000000..16b300a Binary files /dev/null and b/docs/images/android-icon-144x144.png differ diff --git a/docs/images/android-icon-192x192.png b/docs/images/android-icon-192x192.png new file mode 100644 index 0000000..f9dec92 Binary files /dev/null and b/docs/images/android-icon-192x192.png differ diff --git a/docs/images/android-icon-36x36.png b/docs/images/android-icon-36x36.png new file mode 100644 index 0000000..50ae6ff Binary files /dev/null and b/docs/images/android-icon-36x36.png differ diff --git a/docs/images/android-icon-48x48.png b/docs/images/android-icon-48x48.png new file mode 100644 index 0000000..e8259a6 Binary files /dev/null and b/docs/images/android-icon-48x48.png differ diff --git a/docs/images/android-icon-512x512.png b/docs/images/android-icon-512x512.png new file mode 100644 index 0000000..8c374e3 Binary files /dev/null and b/docs/images/android-icon-512x512.png differ diff --git a/docs/images/android-icon-72x72.png b/docs/images/android-icon-72x72.png new file mode 100644 index 0000000..3271506 Binary files /dev/null and b/docs/images/android-icon-72x72.png differ diff --git a/docs/images/android-icon-96x96.png b/docs/images/android-icon-96x96.png new file mode 100644 index 0000000..74546ad Binary files /dev/null and b/docs/images/android-icon-96x96.png differ diff --git a/docs/images/apple-icon-precomposed.png b/docs/images/apple-icon-precomposed.png new file mode 100644 index 0000000..e17d0c6 Binary files /dev/null and b/docs/images/apple-icon-precomposed.png differ diff --git a/docs/images/apple-icon.png b/docs/images/apple-icon.png new file mode 100644 index 0000000..e17d0c6 Binary files /dev/null and b/docs/images/apple-icon.png differ diff --git a/docs/images/apple-touch-icon-114x114.png b/docs/images/apple-touch-icon-114x114.png new file mode 100644 index 0000000..dad300d Binary files /dev/null and b/docs/images/apple-touch-icon-114x114.png differ diff --git a/docs/images/apple-touch-icon-120x120.png b/docs/images/apple-touch-icon-120x120.png new file mode 100644 index 0000000..dae6c6b Binary files /dev/null and b/docs/images/apple-touch-icon-120x120.png differ diff --git a/docs/images/apple-touch-icon-144x144.png b/docs/images/apple-touch-icon-144x144.png new file mode 100644 index 0000000..0008aa9 Binary files /dev/null and b/docs/images/apple-touch-icon-144x144.png differ diff --git a/docs/images/apple-touch-icon-152x152.png b/docs/images/apple-touch-icon-152x152.png new file mode 100644 index 0000000..ccadebc Binary files /dev/null and b/docs/images/apple-touch-icon-152x152.png differ diff --git a/docs/images/apple-touch-icon-180x180.png b/docs/images/apple-touch-icon-180x180.png new file mode 100644 index 0000000..c878299 Binary files /dev/null and b/docs/images/apple-touch-icon-180x180.png differ diff --git a/docs/images/apple-touch-icon-57x57.png b/docs/images/apple-touch-icon-57x57.png new file mode 100644 index 0000000..1eadd76 Binary files /dev/null and b/docs/images/apple-touch-icon-57x57.png differ diff --git a/docs/images/apple-touch-icon-60x60.png b/docs/images/apple-touch-icon-60x60.png new file mode 100644 index 0000000..878fa64 Binary files /dev/null and b/docs/images/apple-touch-icon-60x60.png differ diff --git a/docs/images/apple-touch-icon-72x72.png b/docs/images/apple-touch-icon-72x72.png new file mode 100644 index 0000000..c483f1b Binary files /dev/null and b/docs/images/apple-touch-icon-72x72.png differ diff --git a/docs/images/apple-touch-icon-76x76.png b/docs/images/apple-touch-icon-76x76.png new file mode 100644 index 0000000..01512f7 Binary files /dev/null and b/docs/images/apple-touch-icon-76x76.png differ diff --git a/docs/images/bad_design_system.png b/docs/images/bad_design_system.png new file mode 100644 index 0000000..182899f Binary files /dev/null and b/docs/images/bad_design_system.png differ diff --git a/docs/images/browser-chrome-android.svg b/docs/images/browser-chrome-android.svg new file mode 100644 index 0000000..5ecb985 --- /dev/null +++ b/docs/images/browser-chrome-android.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/docs/images/browser-chrome.svg b/docs/images/browser-chrome.svg new file mode 100644 index 0000000..02d8389 --- /dev/null +++ b/docs/images/browser-chrome.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/images/browser-edge.svg b/docs/images/browser-edge.svg new file mode 100644 index 0000000..a755a9d --- /dev/null +++ b/docs/images/browser-edge.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/images/browser-firefox-android.svg b/docs/images/browser-firefox-android.svg new file mode 100644 index 0000000..f9c0e66 --- /dev/null +++ b/docs/images/browser-firefox-android.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/docs/images/browser-firefox.svg b/docs/images/browser-firefox.svg new file mode 100644 index 0000000..1a80b65 --- /dev/null +++ b/docs/images/browser-firefox.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/images/browser-ie.svg b/docs/images/browser-ie.svg new file mode 100644 index 0000000..8636924 --- /dev/null +++ b/docs/images/browser-ie.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/docs/images/browser-opera.svg b/docs/images/browser-opera.svg new file mode 100644 index 0000000..f127290 --- /dev/null +++ b/docs/images/browser-opera.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/images/browser-safari-ios.svg b/docs/images/browser-safari-ios.svg new file mode 100644 index 0000000..da98377 --- /dev/null +++ b/docs/images/browser-safari-ios.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/images/browser-safari.svg b/docs/images/browser-safari.svg new file mode 100644 index 0000000..12f0c76 --- /dev/null +++ b/docs/images/browser-safari.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/images/favicon-16x16.png b/docs/images/favicon-16x16.png new file mode 100644 index 0000000..2551923 Binary files /dev/null and b/docs/images/favicon-16x16.png differ diff --git a/docs/images/favicon-32x32.png b/docs/images/favicon-32x32.png new file mode 100644 index 0000000..9761666 Binary files /dev/null and b/docs/images/favicon-32x32.png differ diff --git a/docs/images/favicon-96x96.png b/docs/images/favicon-96x96.png new file mode 100644 index 0000000..74546ad Binary files /dev/null and b/docs/images/favicon-96x96.png differ diff --git a/docs/images/favicon.ico b/docs/images/favicon.ico new file mode 100644 index 0000000..6b15142 Binary files /dev/null and b/docs/images/favicon.ico differ diff --git a/docs/images/icon-info.svg b/docs/images/icon-info.svg new file mode 100644 index 0000000..1e2384f --- /dev/null +++ b/docs/images/icon-info.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/images/icon-tag.svg b/docs/images/icon-tag.svg new file mode 100644 index 0000000..0d8d3af --- /dev/null +++ b/docs/images/icon-tag.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/images/icon-warning.svg b/docs/images/icon-warning.svg new file mode 100644 index 0000000..49d20fc --- /dev/null +++ b/docs/images/icon-warning.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/images/logo.svg b/docs/images/logo.svg new file mode 100644 index 0000000..b0a4220 --- /dev/null +++ b/docs/images/logo.svg @@ -0,0 +1 @@ + diff --git a/docs/images/ms-icon-144x144.png b/docs/images/ms-icon-144x144.png new file mode 100644 index 0000000..16b300a Binary files /dev/null and b/docs/images/ms-icon-144x144.png differ diff --git a/docs/images/ms-icon-150x150.png b/docs/images/ms-icon-150x150.png new file mode 100644 index 0000000..9cc0e1e Binary files /dev/null and b/docs/images/ms-icon-150x150.png differ diff --git a/docs/images/ms-icon-310x310.png b/docs/images/ms-icon-310x310.png new file mode 100644 index 0000000..517c976 Binary files /dev/null and b/docs/images/ms-icon-310x310.png differ diff --git a/docs/images/ms-icon-70x70.png b/docs/images/ms-icon-70x70.png new file mode 100644 index 0000000..a8e4d41 Binary files /dev/null and b/docs/images/ms-icon-70x70.png differ diff --git a/docs/images/open_in_desktop.png b/docs/images/open_in_desktop.png new file mode 100644 index 0000000..7255ad5 Binary files /dev/null and b/docs/images/open_in_desktop.png differ diff --git a/docs/images/samsung_homescreen.png b/docs/images/samsung_homescreen.png new file mode 100644 index 0000000..fa30515 Binary files /dev/null and b/docs/images/samsung_homescreen.png differ diff --git a/docs/images/serve_from_docs.png b/docs/images/serve_from_docs.png new file mode 100644 index 0000000..eab9b76 Binary files /dev/null and b/docs/images/serve_from_docs.png differ diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..92da82e --- /dev/null +++ b/docs/index.html @@ -0,0 +1,428 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cupper + + + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + diff --git a/docs/index.xml b/docs/index.xml new file mode 100644 index 0000000..2539513 --- /dev/null +++ b/docs/index.xml @@ -0,0 +1,248 @@ + + + + The Cupper Pattern Library Builder on Cupper + https://thepaciellogroup.github.io/cupper/ + Recent content in The Cupper Pattern Library Builder on Cupper + Hugo -- gohugo.io + en-us + Mon, 26 Jun 2017 18:27:58 +0100 + + + + + + Code blocks + https://thepaciellogroup.github.io/cupper/patterns/coding/code-blocks/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/coding/code-blocks/ + Markdown already supports code samples both inline (using single backticks like `some code here`) and in blocks. Cupper will syntax highlight HTML, CSS, and JavaScript if you provide the correct language in the formulation of the block. +So, this… +```html <button aria-pressed="false"toggle me</button ``` … will result in this: +<button aria-pressed="false">toggle me</button> Note that the syntax highlighting uses a greyscale theme. Cupper is careful not to use color as part of its own design, because these colors may clash with those of the design being illustrated and discussed. + + + + Installation + https://thepaciellogroup.github.io/cupper/patterns/installation/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/installation/ + Cupper is built using the static site engine, Hugo, and NPM. The codebase is available to download on Github. Let’s get everything installed step-by-step. +Install Hugo First you need to install Hugo globally. +OSX users If you are a Mac user and have Homebrew on your system, installing Hugo is simple: +brew install hugo Alternatively, you can manually install Hugo from a package. You can verify the installation was successful by typing: + + + + Project structure + https://thepaciellogroup.github.io/cupper/patterns/writing/project-structure/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/project-structure/ + Before you can set about making documentation, you need to know where everything goes. The simplest folder structure looks like this: + content _index.md print-version.md patterns name-of-my-pattern.md name-of-my-other-pattern.md /content - This is where all of your content lives. You won’t need to visit any other folders very frequently. _index.md — This is the content file for your home page. print-version.md — This is a placeholder for the single-page / print-friendly version of you library. + + + + Demo embedding + https://thepaciellogroup.github.io/cupper/patterns/coding/demo-embedding/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/coding/demo-embedding/ + Sometimes just pictures of the pattern you’re documenting aren’t enough. Interactive patterns benefit from live demos, so that readers can test their functionality. +CodePen Cupper offers a couple of ways to do this. The first is by embedding CodePen demos into the content. The codePen shortcode takes just one argument: the codePen’s ID. +{{% codePen VpVNKW %}} This will embed the identified codePen into the content wherever you placed the shortcode, with the result view showing by default: + + + + Setup + https://thepaciellogroup.github.io/cupper/patterns/setup/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/setup/ + By now, you should have followed the Installation instructions. You should have Hugo and Node installed, and a local copy of a forked version of Cupper. You should also have run npm install in the root of that codebase. +“Cleaning” the content folder Before you can start writing documentation, there are a few things still to do in order to get set up. At the moment, your version of Cupper is a facsimile of the original, containing all the content you’re reading right now. + + + + Markdown & metadata + https://thepaciellogroup.github.io/cupper/patterns/writing/markdown-and-metadata/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/markdown-and-metadata/ + In Cupper everything is documented using markdown, as a “pattern”. To create a new pattern file, just add a file with the .md extension to the content/patterns folder. It’s recommended you use “kebab case” to name the file (words separated by hyphens). For example, a pattern with the title “Menu button” should probably have the filename menu-button. Then you get a nice clean URL: username.github.io/your-library/patterns/menu-button. +If you’re not familiar with writing markdown, there are a number of tutorials available. + + + + Serving + https://thepaciellogroup.github.io/cupper/patterns/serving/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/serving/ + Serving locally While you’re creating content for your project, you’ll probably want to see what the finished product looks like. Fortunately, Cupper is easy to serve locally using the serve command: +npm run serve This will serve your working project from localhost:1313. Whenever you make changes to your files, the site will automatically rebuild. No need to refresh the web page! +Publishing on Github Pages Cupper creates a /docs folder containing the latest version of your site whenever you do an npm run build or a git commit. + + + + Writing inline demos + https://thepaciellogroup.github.io/cupper/patterns/coding/writing-inline-demos/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/coding/writing-inline-demos/ + There are some issues with Demo embedding, like the embeds not working offline. They also come with their own branding, which will clash with the pattern you’re trying to illustrate. +Cupper offers another option: a special demo shortcode that allows you to write HTML, CSS, and JavaScript directly into the markdown file. The outputted demo is encapsulated using Shadow DOM, so you don’t have to worry about broken styles and global JS. + + + + Printing + https://thepaciellogroup.github.io/cupper/patterns/printing/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/printing/ + Cupper’s output site includes a one-page Print version of the generated library, available at /print-version. So, if your library base URL is https://yourName.github.io/your-library, you can print the whole library — to PDF if wanted — from the following address: +https://yourName.github.io/your-library/print-version Print styles are also provided for individual pattern pages so, if you wanted to print off a single pattern document, you can! + + + + + Updating Cupper + https://thepaciellogroup.github.io/cupper/patterns/updating/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/updating/ + The core of Cupper’s functionality is in its Hugo theme, also called Cupper. This is found in the theme folder. + content docs lib snippets static themes cupper Do not “hack the core”. If you have any issues with Cupper, please report them to the Cupper Github repository and they will be dealt with ASAP. +Cupper is undergoing constant development, so keep an eye out for new releases. + + + + Expandable sections + https://thepaciellogroup.github.io/cupper/patterns/writing/expandable-sections/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/expandable-sections/ + In some cases, where there is a lot of content, it’s helpful to collapse certain sections. That way, readers get an overview of what’s in the content and can choose where to focus in. Cupper provides a shortcode method for creating expandable sections which generates accessible markup using aria-expanded. +The expandable shortcode takes three parameters: + label — This is the label for the the section heading. level — This is the heading level (e. + + + + Print version + https://thepaciellogroup.github.io/cupper/print-version/ + Sat, 29 Jul 2017 22:48:43 +0100 + + https://thepaciellogroup.github.io/cupper/print-version/ + You don’t want to edit this file :-) + + + + Color palettes + https://thepaciellogroup.github.io/cupper/patterns/coding/color-palettes/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/coding/color-palettes/ + There’s no reason why your Cupper-powered pattern library has to be all about functionality. You can include style guide-like information such as color palettes too. The colors shortcode makes it easy to exhibit colors and their values together. Just supply a comma-separated list of CSS color values. +{{% colors "#111111, #cccccc, #ffffff" %}} The result is a one row strip showing each color supplied in order. The colors for Cupper are greyscale: + + + + Command line + https://thepaciellogroup.github.io/cupper/patterns/coding/command-line/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/coding/command-line/ + Your pattern documentation may need to include commands for installing packages or using CLIs. Cupper offers the cmd shortcode for making code blocks look like terminal commands. +Here’s how you write it: +{{<cmd}} npm run start {{</cmd}} And here’s how it looks: +npm run start The cmd shortcode currently only supports single commands. If you want to show multiple, successive commands use separate cmd blocks. + + + + + File trees + https://thepaciellogroup.github.io/cupper/patterns/coding/file-trees/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/coding/file-trees/ + Representing folder/file structures is simple and accessible in Cupper. Which is just as well, because some components may need to conform to a certain folder structure. +The file tree is described using a markdown nested list structure: +{{% fileTree %}} * Level 1 folder * Level 2 file * Level 2 folder * Level 3 file * Level 3 folder * Level 4 file * Level 3 folder * Level 4 file * Level 4 file * Level 3 file * Level 2 folder * Level 3 file * Level 3 file * Level 3 file * Level 2 file * Level 1 file {{% /fileTree %}} This is drawn in the following fashion, but preserves the underlying nested list structure for assistive technologies such as screen readers: + + + + Including images + https://thepaciellogroup.github.io/cupper/patterns/media/including-images/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/media/including-images/ + From time to time, you’ll be wanting to include images illustrating the documented pattern in hand. Images live in the static folder, which is a sibling of the /content folder you’ll be mostly working in. + content static images logo.png menu-button.gif When you first make a copy of Cupper, Cupper’s own logo will be included. You should replace this with your own company or project logo. + + + + Including videos + https://thepaciellogroup.github.io/cupper/patterns/media/including-videos/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/media/including-videos/ + Cupper has a lot of its own shortcodes, but you can still use Hugo’s built in shortcodes. These include a simple shortcode for including YouTube videos in your content. The shortcode takes just one parameter — the video’s id. +{{<youtube w7Ft2ymGmfc}} + + + + Notes & warnings + https://thepaciellogroup.github.io/cupper/patterns/writing/notes-and-warnings/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/notes-and-warnings/ + Cupper acknowledges that simple markdown is limiting when it comes to writing compelling documentation, so it provides a number of “shortcodes”. Shortcodes offer a simple syntax for including rich content. For example, Cupper provides shortcodes for including notes and warnings. +Notes You may wish to pick out some content in your pattern’s documentation as a note — an aside to the main thrust of the pattern’s description. This is possible using the following syntax: + + + + References + https://thepaciellogroup.github.io/cupper/patterns/writing/references/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/references/ + Cross-references Cupper identifies the main content files in your documentation as patterns, and they’re kept in the content/ patterns folder. It’s easy to cross-reference patterns using the pattern shortcode. For example, I can reference the Notes & warnings pattern. Here’s what the markdown looks like, including the shortcode: +I can reference the {{% pattern "Notes & warnings" %}} pattern here. This saves you having to worry about pathing and decorates the generated link with a bookmark icon, identifying the link as a pattern reference visually. + + + + Snippets + https://thepaciellogroup.github.io/cupper/patterns/writing/snippets/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/snippets/ + A lot of the time, your larger documentation patterns will share some common techniques and utilities. For this reason, Cupper lets you save snippets of markdown in a snippets folder, alongside the main content folder. +The example visually-hidden.md snippet describes the CSS needed to create content that is visually hidden but still available to screen readers. Since this is a technique/utility you are likely to use often, it’s nice to be able to just drop a snippet into your markdown content. + + + + Tables of contents + https://thepaciellogroup.github.io/cupper/patterns/writing/tables-of-contents/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/tables-of-contents/ + Pattern pages in Cupper that have two or more subheadings (<h2>s) automatically get a table of contents: a list of links to the main subsections for the page. This feature is made accessible as a navigation region with the “Table of contents” label and uses an ordered list. The table of contents markup for the Setup page looks something like this: +<nav class="toc" aria-labelledby="toc-heading"> <h2 id="toc-heading">Table of contents</h2> <ol> <li> <a href="#cleaning-the-content-folder">“Cleaning” the content folder</a> </li> <li> <a href="#the-setup-command">The setup command</a> </li> <li> <a href="#the-config-file">The config file</a> </li> <li> <a href="#including-a-logo">Including a logo</a> </li> </ol> </nav> Tables of content are a neat way to break down the content of the page and give users a navigable overview. + + + + Tested using... + https://thepaciellogroup.github.io/cupper/patterns/coding/tested/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/coding/tested/ + When you’re an inclusive designer, it’s pertinent to do some testing. Following specs is one thing, but you need to verify that your component works okay for users. +Cupper provided a tested shortcode that lets you show which browsers and assistive technologies you’ve tried your design out in. Here’s an example. Note the commas and “+” signs. +{{% tested using="Firefox + JAWS, Chrome, Safari iOS + Voiceover, Edge" %}} This outputs: + + + + \ No newline at end of file diff --git a/docs/js/dom-scripts.js b/docs/js/dom-scripts.js new file mode 100644 index 0000000..27aeb78 --- /dev/null +++ b/docs/js/dom-scripts.js @@ -0,0 +1,133 @@ +/* expandable sections */ +(function () { + function toggle (button, target) { + var expanded = button.getAttribute('aria-expanded') === 'true'; + button.setAttribute('aria-expanded', !expanded); + target.hidden = !target.hidden; + } + + var expanders = document.querySelectorAll('[data-expands]'); + + Array.prototype.forEach.call(expanders, function (expander) { + var target = document.getElementById(expander.getAttribute('data-expands')); + + expander.addEventListener('click', function () { + toggle(expander, target); + }) + }) +}()); + +/* menu button */ +(function () { + var button = document.getElementById('menu-button'); + if (button) { + var menu = document.getElementById('patterns-list'); + button.addEventListener('click', function() { + var expanded = this.getAttribute('aria-expanded') === 'true'; + this.setAttribute('aria-expanded', !expanded); + }) + } +}()); + +/* persist navigation scroll point */ +(function () { + window.onbeforeunload = function () { + var patternsNav = document.getElementById('patterns-nav'); + if (patternsNav) { + var scrollPoint = patternsNav.scrollTop; + localStorage.setItem('scrollPoint', scrollPoint); + } + } + + window.addEventListener('DOMContentLoaded', function () { + if (document.getElementById('patterns-nav')) { + if (window.location.href.indexOf('patterns/') !== -1) { + document.getElementById('patterns-nav').scrollTop = parseInt(localStorage.getItem('scrollPoint')); + } else { + document.getElementById('patterns-nav').scrollTop = 0; + } + } + }) +}()); + +/* Add "link here" links to

headings */ +(function () { + var headings = document.querySelectorAll('main > h2'); + + Array.prototype.forEach.call(headings, function (heading) { + var id = heading.getAttribute('id'); + + if (id) { + var newHeading = heading.cloneNode(true); + newHeading.setAttribute('tabindex', '-1'); + + var container = document.createElement('div'); + container.setAttribute('class', 'h2-container'); + container.appendChild(newHeading); + + heading.parentNode.insertBefore(container, heading); + + var link = document.createElement('a'); + link.setAttribute('href', '#' + id); + var headingText = heading.textContent; + link.setAttribute('aria-label', 'This ' + headingText + ' section'); + link.innerHTML = ''; + + container.appendChild(link); + + heading.parentNode.removeChild(heading); + } + }) +}()); + +/* Enable scrolling by keyboard of code samples */ +(function () { + var codeBlocks = document.querySelectorAll('pre, .code-annotated'); + + Array.prototype.forEach.call(codeBlocks, function (block) { + if (block.querySelector('code')) { + block.setAttribute('role', 'region'); + block.setAttribute('aria-label', 'code sample'); + if (block.scrollWidth > block.clientWidth) { + block.setAttribute('tabindex', '0'); + } + } + }); +}()); + +/* Switch and persist theme */ +(function () { + function CSSSupported (property, value) { + var prop = property + ':', + el = document.createElement('test'), + mStyle = el.style; + el.style.cssText = prop + value; + return mStyle[property]; + } + + var checkbox = document.getElementById('themer'); + var inverter = document.getElementById('inverter'); + + if (!CSSSupported('filter', 'invert(100%)')) { + checkbox.parentNode.hidden = true; + return; + } + + function darkTheme(media) { + inverter.setAttribute('media', media); + inverter.textContent = inverter.textContent.trim(); + localStorage.setItem('darkTheme', media); + } + + checkbox.addEventListener('change', function () { + darkTheme(this.checked ? 'screen' : 'none'); + }); + + window.addEventListener('DOMContentLoaded', function () { + if ('filter' in document.body.style) { + if (localStorage.getItem('darkTheme') === 'screen') { + checkbox.click(); + } + } + }); +}()); diff --git a/docs/js/prism.js b/docs/js/prism.js new file mode 100644 index 0000000..8e2ab17 --- /dev/null +++ b/docs/js/prism.js @@ -0,0 +1,7 @@ +/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript&plugins=line-numbers */ +var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof s)){h.lastIndex=0;var _=h.exec(w),P=1;if(!_&&m&&b!=t.length-1){if(h.lastIndex=k,_=h.exec(e),!_)break;for(var A=_.index+(d?_[1].length:0),j=_.index+_[0].length,x=b,O=k,S=t.length;S>x&&(j>O||!t[x].type&&!t[x-1].greedy);++x)O+=t[x].length,A>=O&&(++b,k=O);if(t[b]instanceof s||t[x-1].greedy)continue;P=x-b,w=e.slice(k,O),_.index-=k}if(_){d&&(p=_[1].length);var A=_.index+p,_=_[0].slice(p),j=A+_.length,N=w.slice(0,A),C=w.slice(j),E=[b,P];N&&(++b,k+=N.length,E.push(N));var L=new s(u,f?n.tokenize(_,f):_,y,_,m);if(E.push(L),C&&E.push(C),Array.prototype.splice.apply(t,E),1!=P&&n.matchGrammar(e,t,a,b,k,!0,u),l)break}else if(l)break}}}}},tokenize:function(e,t){var a=[e],r=t.rest;if(r){for(var i in r)t[i]=r[i];delete t.rest}return n.matchGrammar(e,a,t,0,0,!1),a},hooks:{all:{},add:function(e,t){var a=n.hooks.all;a[e]=a[e]||[],a[e].push(t)},run:function(e,t){var a=n.hooks.all[e];if(a&&a.length)for(var r,i=0;r=a[i++];)r(t)}}},a=n.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.length=0|(a||"").length,this.greedy=!!r};if(a.stringify=function(e,t,r){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join("");var i={type:e.type,content:a.stringify(e.content,t,r),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:r};if("comment"==i.type&&(i.attributes.spellcheck="true"),e.alias){var l="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,l)}n.hooks.run("wrap",i);var o=Object.keys(i.attributes).map(function(e){return e+'="'+(i.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+(o?" "+o:"")+">"+i.content+""},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var t=JSON.parse(e.data),a=t.language,r=t.code,i=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[a],a)),i&&_self.close()},!1),_self.Prism):_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return r&&(n.filename=r.src,!document.addEventListener||n.manual||r.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); +Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\s\S])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\s\S]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup; +Prism.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:{pattern:/("|')(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/()[\s\S]*?(?=<\/style>)/i,lookbehind:!0,inside:Prism.languages.css,alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag)); +Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/}; +Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\\\|\\?[^\\])*?`/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/()[\s\S]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:"language-javascript"}}),Prism.languages.js=Prism.languages.javascript; +!function(){"undefined"!=typeof self&&self.Prism&&self.document&&Prism.hooks.add("complete",function(e){if(e.code){var t=e.element.parentNode,s=/\s*\bline-numbers\b\s*/;if(t&&/pre/i.test(t.nodeName)&&(s.test(t.className)||s.test(e.element.className))&&!e.element.querySelector(".line-numbers-rows")){s.test(e.element.className)&&(e.element.className=e.element.className.replace(s,"")),s.test(t.className)||(t.className+=" line-numbers");var n,a=e.code.match(/\n(?!$)/g),l=a?a.length+1:1,r=new Array(l+1);r=r.join(""),n=document.createElement("span"),n.setAttribute("aria-hidden","true"),n.className="line-numbers-rows",n.innerHTML=r,t.hasAttribute("data-start")&&(t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)),e.element.appendChild(n)}}})}(); diff --git a/docs/js/service-worker-registration.js b/docs/js/service-worker-registration.js new file mode 100644 index 0000000..bbcc757 --- /dev/null +++ b/docs/js/service-worker-registration.js @@ -0,0 +1,62 @@ +/** + * Copyright 2015 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* eslint-env browser */ +'use strict'; + +if ('serviceWorker' in navigator) { + // Delay registration until after the page has loaded, to ensure that our + // precaching requests don't degrade the first visit experience. + // See https://developers.google.com/web/fundamentals/instant-and-offline/service-worker/registration + window.addEventListener('load', function() { + // Your service-worker.js *must* be located at the top-level directory relative to your site. + // It won't be able to control pages unless it's located at the same level or higher than them. + // *Don't* register service worker file in, e.g., a scripts/ sub-directory! + // See https://github.com/slightlyoff/ServiceWorker/issues/468 + navigator.serviceWorker.register('service-worker.js').then(function(reg) { + // updatefound is fired if service-worker.js changes. + reg.onupdatefound = function() { + // The updatefound event implies that reg.installing is set; see + // https://w3c.github.io/ServiceWorker/#service-worker-registration-updatefound-event + var installingWorker = reg.installing; + + installingWorker.onstatechange = function() { + switch (installingWorker.state) { + case 'installed': + if (navigator.serviceWorker.controller) { + // At this point, the old content will have been purged and the fresh content will + // have been added to the cache. + // It's the perfect time to display a "New content is available; please refresh." + // message in the page's interface. + console.log('New or updated content is available.'); + } else { + // At this point, everything has been precached. + // It's the perfect time to display a "Content is cached for offline use." message. + console.log('Content is now available offline!'); + } + break; + + case 'redundant': + console.error('The installing service worker became redundant.'); + break; + } + }; + }; + }).catch(function(e) { + console.error('Error during service worker registration:', e); + }); + }); +} diff --git a/docs/manifest.json b/docs/manifest.json new file mode 100644 index 0000000..6665bed --- /dev/null +++ b/docs/manifest.json @@ -0,0 +1,52 @@ +{ + "name": "Cupper Pattern Library Docs", + "short_name": "Cupper Docs", + "icons": [ + { + "src": "images/android-icon-36x36.png", + "sizes": "36x36", + "type": "image\/png", + "density": "0.75" + }, + { + "src": "images/android-icon-48x48.png", + "sizes": "48x48", + "type": "image\/png", + "density": "1.0" + }, + { + "src": "images/android-icon-72x72.png", + "sizes": "72x72", + "type": "image\/png", + "density": "1.5" + }, + { + "src": "images/android-icon-96x96.png", + "sizes": "96x96", + "type": "image\/png", + "density": "2.0" + }, + { + "src": "images/android-icon-144x144.png", + "sizes": "144x144", + "type": "image\/png", + "density": "3.0" + }, + { + "src": "images/android-icon-192x192.png", + "sizes": "192x192", + "type": "image\/png", + "density": "4.0" + }, + { + "src": "images/android-icon-512x512.png", + "sizes": "512x512", + "type": "image\/png", + "density": "4.0" + } +], + "start_url": "index.html", + "display": "standalone", + "background_color": "#fefefe", + "theme_color": "#111" +} diff --git a/docs/patterns/coding/code-blocks/index.html b/docs/patterns/coding/code-blocks/index.html new file mode 100644 index 0000000..442ee72 --- /dev/null +++ b/docs/patterns/coding/code-blocks/index.html @@ -0,0 +1,565 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Code blocks | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/coding/color-palettes/index.html b/docs/patterns/coding/color-palettes/index.html new file mode 100644 index 0000000..383db84 --- /dev/null +++ b/docs/patterns/coding/color-palettes/index.html @@ -0,0 +1,457 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Color palettes | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/coding/command-line/index.html b/docs/patterns/coding/command-line/index.html new file mode 100644 index 0000000..f409d3e --- /dev/null +++ b/docs/patterns/coding/command-line/index.html @@ -0,0 +1,443 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Command line | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/coding/demo-embedding/index.html b/docs/patterns/coding/demo-embedding/index.html new file mode 100644 index 0000000..6480d0f --- /dev/null +++ b/docs/patterns/coding/demo-embedding/index.html @@ -0,0 +1,513 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Demo embedding | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/coding/file-trees/index.html b/docs/patterns/coding/file-trees/index.html new file mode 100644 index 0000000..acfd589 --- /dev/null +++ b/docs/patterns/coding/file-trees/index.html @@ -0,0 +1,493 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + File trees | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/coding/index.html b/docs/patterns/coding/index.html new file mode 100644 index 0000000..28b4f46 --- /dev/null +++ b/docs/patterns/coding/index.html @@ -0,0 +1,494 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Coding | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/coding/index.xml b/docs/patterns/coding/index.xml new file mode 100644 index 0000000..c095e24 --- /dev/null +++ b/docs/patterns/coding/index.xml @@ -0,0 +1,92 @@ + + + + Coding on Cupper + https://thepaciellogroup.github.io/cupper/patterns/coding/ + Recent content in Coding on Cupper + Hugo -- gohugo.io + en-us + + + + + + Code blocks + https://thepaciellogroup.github.io/cupper/patterns/coding/code-blocks/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/coding/code-blocks/ + Markdown already supports code samples both inline (using single backticks like `some code here`) and in blocks. Cupper will syntax highlight HTML, CSS, and JavaScript if you provide the correct language in the formulation of the block. +So, this&hellip; +```html &lt;button aria-pressed="false"toggle me&lt;/button ``` &hellip; will result in this: +&lt;button aria-pressed=&quot;false&quot;&gt;toggle me&lt;/button&gt; Note that the syntax highlighting uses a greyscale theme. Cupper is careful not to use color as part of its own design, because these colors may clash with those of the design being illustrated and discussed. + + + + Demo embedding + https://thepaciellogroup.github.io/cupper/patterns/coding/demo-embedding/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/coding/demo-embedding/ + Sometimes just pictures of the pattern you&rsquo;re documenting aren&rsquo;t enough. Interactive patterns benefit from live demos, so that readers can test their functionality. +CodePen Cupper offers a couple of ways to do this. The first is by embedding CodePen demos into the content. The codePen shortcode takes just one argument: the codePen&rsquo;s ID. +&#x7b;{% codePen VpVNKW %}} This will embed the identified codePen into the content wherever you placed the shortcode, with the result view showing by default: + + + + Writing inline demos + https://thepaciellogroup.github.io/cupper/patterns/coding/writing-inline-demos/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/coding/writing-inline-demos/ + There are some issues with Demo embedding, like the embeds not working offline. They also come with their own branding, which will clash with the pattern you&rsquo;re trying to illustrate. +Cupper offers another option: a special demo shortcode that allows you to write HTML, CSS, and JavaScript directly into the markdown file. The outputted demo is encapsulated using Shadow DOM, so you don&rsquo;t have to worry about broken styles and global JS. + + + + Color palettes + https://thepaciellogroup.github.io/cupper/patterns/coding/color-palettes/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/coding/color-palettes/ + There&rsquo;s no reason why your Cupper-powered pattern library has to be all about functionality. You can include style guide-like information such as color palettes too. The colors shortcode makes it easy to exhibit colors and their values together. Just supply a comma-separated list of CSS color values. +&#x7b;{% colors "#111111, #cccccc, #ffffff" %}} The result is a one row strip showing each color supplied in order. The colors for Cupper are greyscale: + + + + Command line + https://thepaciellogroup.github.io/cupper/patterns/coding/command-line/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/coding/command-line/ + Your pattern documentation may need to include commands for installing packages or using CLIs. Cupper offers the cmd shortcode for making code blocks look like terminal commands. +Here&rsquo;s how you write it: +&#x7b;{&lt;cmd}} npm run start &#x7b;{&lt;/cmd}} And here&rsquo;s how it looks: +npm run start The cmd shortcode currently only supports single commands. If you want to show multiple, successive commands use separate cmd blocks. + + + + + File trees + https://thepaciellogroup.github.io/cupper/patterns/coding/file-trees/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/coding/file-trees/ + Representing folder/file structures is simple and accessible in Cupper. Which is just as well, because some components may need to conform to a certain folder structure. +The file tree is described using a markdown nested list structure: +&#x7b;{% fileTree %}} * Level 1 folder * Level 2 file * Level 2 folder * Level 3 file * Level 3 folder * Level 4 file * Level 3 folder * Level 4 file * Level 4 file * Level 3 file * Level 2 folder * Level 3 file * Level 3 file * Level 3 file * Level 2 file * Level 1 file &#x7b;{% /fileTree %}} This is drawn in the following fashion, but preserves the underlying nested list structure for assistive technologies such as screen readers: + + + + Tested using... + https://thepaciellogroup.github.io/cupper/patterns/coding/tested/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/coding/tested/ + When you&rsquo;re an inclusive designer, it&rsquo;s pertinent to do some testing. Following specs is one thing, but you need to verify that your component works okay for users. +Cupper provided a tested shortcode that lets you show which browsers and assistive technologies you&rsquo;ve tried your design out in. Here&rsquo;s an example. Note the commas and &ldquo;+&rdquo; signs. +&#x7b;{% tested using="Firefox + JAWS, Chrome, Safari iOS + Voiceover, Edge" %}} This outputs: + + + + \ No newline at end of file diff --git a/docs/patterns/coding/tested/index.html b/docs/patterns/coding/tested/index.html new file mode 100644 index 0000000..0d73d7c --- /dev/null +++ b/docs/patterns/coding/tested/index.html @@ -0,0 +1,501 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tested using... | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/coding/writing-inline-demos/index.html b/docs/patterns/coding/writing-inline-demos/index.html new file mode 100644 index 0000000..eb7f4cb --- /dev/null +++ b/docs/patterns/coding/writing-inline-demos/index.html @@ -0,0 +1,605 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Writing inline demos | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/index.html b/docs/patterns/index.html new file mode 100644 index 0000000..ba19a0c --- /dev/null +++ b/docs/patterns/index.html @@ -0,0 +1,470 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Patterns | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/index.xml b/docs/patterns/index.xml new file mode 100644 index 0000000..fa07ffe --- /dev/null +++ b/docs/patterns/index.xml @@ -0,0 +1,69 @@ + + + + Patterns on Cupper + https://thepaciellogroup.github.io/cupper/patterns/ + Recent content in Patterns on Cupper + Hugo -- gohugo.io + en-us + + + + + + Installation + https://thepaciellogroup.github.io/cupper/patterns/installation/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/installation/ + Cupper is built using the static site engine, Hugo, and NPM. The codebase is available to download on Github. Let&rsquo;s get everything installed step-by-step. +Install Hugo First you need to install Hugo globally. +OSX users If you are a Mac user and have Homebrew on your system, installing Hugo is simple: +brew install hugo Alternatively, you can manually install Hugo from a package. You can verify the installation was successful by typing: + + + + Setup + https://thepaciellogroup.github.io/cupper/patterns/setup/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/setup/ + By now, you should have followed the Installation instructions. You should have Hugo and Node installed, and a local copy of a forked version of Cupper. You should also have run npm install in the root of that codebase. +&ldquo;Cleaning&rdquo; the content folder Before you can start writing documentation, there are a few things still to do in order to get set up. At the moment, your version of Cupper is a facsimile of the original, containing all the content you&rsquo;re reading right now. + + + + Serving + https://thepaciellogroup.github.io/cupper/patterns/serving/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/serving/ + Serving locally While you&rsquo;re creating content for your project, you&rsquo;ll probably want to see what the finished product looks like. Fortunately, Cupper is easy to serve locally using the serve command: +npm run serve This will serve your working project from localhost:1313. Whenever you make changes to your files, the site will automatically rebuild. No need to refresh the web page! +Publishing on Github Pages Cupper creates a /docs folder containing the latest version of your site whenever you do an npm run build or a git commit. + + + + Printing + https://thepaciellogroup.github.io/cupper/patterns/printing/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/printing/ + Cupper&rsquo;s output site includes a one-page Print version of the generated library, available at /print-version. So, if your library base URL is https://yourName.github.io/your-library, you can print the whole library — to PDF if wanted — from the following address: +https://yourName.github.io/your-library/print-version Print styles are also provided for individual pattern pages so, if you wanted to print off a single pattern document, you can! + + + + + Updating Cupper + https://thepaciellogroup.github.io/cupper/patterns/updating/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/updating/ + The core of Cupper&rsquo;s functionality is in its Hugo theme, also called Cupper. This is found in the theme folder. + content docs lib snippets static themes cupper Do not &ldquo;hack the core&rdquo;. If you have any issues with Cupper, please report them to the Cupper Github repository and they will be dealt with ASAP. +Cupper is undergoing constant development, so keep an eye out for new releases. + + + + \ No newline at end of file diff --git a/docs/patterns/installation/index.html b/docs/patterns/installation/index.html new file mode 100644 index 0000000..cc4f0ec --- /dev/null +++ b/docs/patterns/installation/index.html @@ -0,0 +1,510 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Installation | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/media/including-images/index.html b/docs/patterns/media/including-images/index.html new file mode 100644 index 0000000..4e97371 --- /dev/null +++ b/docs/patterns/media/including-images/index.html @@ -0,0 +1,487 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Including images | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/media/including-videos/index.html b/docs/patterns/media/including-videos/index.html new file mode 100644 index 0000000..123b9e0 --- /dev/null +++ b/docs/patterns/media/including-videos/index.html @@ -0,0 +1,423 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Including videos | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/media/index.html b/docs/patterns/media/index.html new file mode 100644 index 0000000..b1832eb --- /dev/null +++ b/docs/patterns/media/index.html @@ -0,0 +1,434 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Media | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/media/index.xml b/docs/patterns/media/index.xml new file mode 100644 index 0000000..3f93555 --- /dev/null +++ b/docs/patterns/media/index.xml @@ -0,0 +1,34 @@ + + + + Media on Cupper + https://thepaciellogroup.github.io/cupper/patterns/media/ + Recent content in Media on Cupper + Hugo -- gohugo.io + en-us + + + + + + Including images + https://thepaciellogroup.github.io/cupper/patterns/media/including-images/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/media/including-images/ + From time to time, you&rsquo;ll be wanting to include images illustrating the documented pattern in hand. Images live in the static folder, which is a sibling of the /content folder you&rsquo;ll be mostly working in. + content static images logo.png menu-button.gif When you first make a copy of Cupper, Cupper&rsquo;s own logo will be included. You should replace this with your own company or project logo. + + + + Including videos + https://thepaciellogroup.github.io/cupper/patterns/media/including-videos/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/media/including-videos/ + Cupper has a lot of its own shortcodes, but you can still use Hugo&rsquo;s built in shortcodes. These include a simple shortcode for including YouTube videos in your content. The shortcode takes just one parameter — the video&rsquo;s id. +&#x7b;{&lt;youtube w7Ft2ymGmfc}} + + + + \ No newline at end of file diff --git a/docs/patterns/printing/index.html b/docs/patterns/printing/index.html new file mode 100644 index 0000000..9ffb42c --- /dev/null +++ b/docs/patterns/printing/index.html @@ -0,0 +1,432 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Printing | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/serving/index.html b/docs/patterns/serving/index.html new file mode 100644 index 0000000..ab019b7 --- /dev/null +++ b/docs/patterns/serving/index.html @@ -0,0 +1,466 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Serving | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/setup/index.html b/docs/patterns/setup/index.html new file mode 100644 index 0000000..3bb27e5 --- /dev/null +++ b/docs/patterns/setup/index.html @@ -0,0 +1,538 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Setup | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/updating/index.html b/docs/patterns/updating/index.html new file mode 100644 index 0000000..d63673f --- /dev/null +++ b/docs/patterns/updating/index.html @@ -0,0 +1,470 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Updating Cupper | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/writing/expandable-sections/index.html b/docs/patterns/writing/expandable-sections/index.html new file mode 100644 index 0000000..19d35f6 --- /dev/null +++ b/docs/patterns/writing/expandable-sections/index.html @@ -0,0 +1,528 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Expandable sections | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/writing/index.html b/docs/patterns/writing/index.html new file mode 100644 index 0000000..f6ccaab --- /dev/null +++ b/docs/patterns/writing/index.html @@ -0,0 +1,494 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Writing | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/writing/index.xml b/docs/patterns/writing/index.xml new file mode 100644 index 0000000..4ebdbdf --- /dev/null +++ b/docs/patterns/writing/index.xml @@ -0,0 +1,85 @@ + + + + Writing on Cupper + https://thepaciellogroup.github.io/cupper/patterns/writing/ + Recent content in Writing on Cupper + Hugo -- gohugo.io + en-us + + + + + + Project structure + https://thepaciellogroup.github.io/cupper/patterns/writing/project-structure/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/project-structure/ + Before you can set about making documentation, you need to know where everything goes. The simplest folder structure looks like this: + content _index.md print-version.md patterns name-of-my-pattern.md name-of-my-other-pattern.md /content - This is where all of your content lives. You won&rsquo;t need to visit any other folders very frequently. _index.md — This is the content file for your home page. print-version.md — This is a placeholder for the single-page / print-friendly version of you library. + + + + Markdown & metadata + https://thepaciellogroup.github.io/cupper/patterns/writing/markdown-and-metadata/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/markdown-and-metadata/ + In Cupper everything is documented using markdown, as a &ldquo;pattern&rdquo;. To create a new pattern file, just add a file with the .md extension to the content/patterns folder. It&rsquo;s recommended you use &ldquo;kebab case&rdquo; to name the file (words separated by hyphens). For example, a pattern with the title &ldquo;Menu button&rdquo; should probably have the filename menu-button. Then you get a nice clean URL: username.github.io/your-library/patterns/menu-button. +If you&rsquo;re not familiar with writing markdown, there are a number of tutorials available. + + + + Expandable sections + https://thepaciellogroup.github.io/cupper/patterns/writing/expandable-sections/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/expandable-sections/ + In some cases, where there is a lot of content, it&rsquo;s helpful to collapse certain sections. That way, readers get an overview of what&rsquo;s in the content and can choose where to focus in. Cupper provides a shortcode method for creating expandable sections which generates accessible markup using aria-expanded. +The expandable shortcode takes three parameters: + label — This is the label for the the section heading. level — This is the heading level (e. + + + + Notes & warnings + https://thepaciellogroup.github.io/cupper/patterns/writing/notes-and-warnings/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/notes-and-warnings/ + Cupper acknowledges that simple markdown is limiting when it comes to writing compelling documentation, so it provides a number of &ldquo;shortcodes&rdquo;. Shortcodes offer a simple syntax for including rich content. For example, Cupper provides shortcodes for including notes and warnings. +Notes You may wish to pick out some content in your pattern&rsquo;s documentation as a note — an aside to the main thrust of the pattern&rsquo;s description. This is possible using the following syntax: + + + + References + https://thepaciellogroup.github.io/cupper/patterns/writing/references/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/references/ + Cross-references Cupper identifies the main content files in your documentation as patterns, and they&rsquo;re kept in the content/ patterns folder. It&rsquo;s easy to cross-reference patterns using the pattern shortcode. For example, I can reference the Notes &amp; warnings pattern. Here&rsquo;s what the markdown looks like, including the shortcode: +I can reference the &#x7b;{% pattern "Notes & warnings" %}} pattern here. This saves you having to worry about pathing and decorates the generated link with a bookmark icon, identifying the link as a pattern reference visually. + + + + Snippets + https://thepaciellogroup.github.io/cupper/patterns/writing/snippets/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/snippets/ + A lot of the time, your larger documentation patterns will share some common techniques and utilities. For this reason, Cupper lets you save snippets of markdown in a snippets folder, alongside the main content folder. +The example visually-hidden.md snippet describes the CSS needed to create content that is visually hidden but still available to screen readers. Since this is a technique/utility you are likely to use often, it&rsquo;s nice to be able to just drop a snippet into your markdown content. + + + + Tables of contents + https://thepaciellogroup.github.io/cupper/patterns/writing/tables-of-contents/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/tables-of-contents/ + Pattern pages in Cupper that have two or more subheadings (&lt;h2&gt;s) automatically get a table of contents: a list of links to the main subsections for the page. This feature is made accessible as a navigation region with the &ldquo;Table of contents&rdquo; label and uses an ordered list. The table of contents markup for the Setup page looks something like this: +&lt;nav class=&quot;toc&quot; aria-labelledby=&quot;toc-heading&quot;&gt; &lt;h2 id=&quot;toc-heading&quot;&gt;Table of contents&lt;/h2&gt; &lt;ol&gt; &lt;li&gt; &lt;a href=&quot;#cleaning-the-content-folder&quot;&gt;“Cleaning” the content folder&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href=&quot;#the-setup-command&quot;&gt;The setup command&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href=&quot;#the-config-file&quot;&gt;The config file&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href=&quot;#including-a-logo&quot;&gt;Including a logo&lt;/a&gt; &lt;/li&gt; &lt;/ol&gt; &lt;/nav&gt; Tables of content are a neat way to break down the content of the page and give users a navigable overview. + + + + \ No newline at end of file diff --git a/docs/patterns/writing/markdown-and-metadata/index.html b/docs/patterns/writing/markdown-and-metadata/index.html new file mode 100644 index 0000000..175a288 --- /dev/null +++ b/docs/patterns/writing/markdown-and-metadata/index.html @@ -0,0 +1,497 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Markdown & metadata | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/writing/notes-and-warnings/index.html b/docs/patterns/writing/notes-and-warnings/index.html new file mode 100644 index 0000000..27a4658 --- /dev/null +++ b/docs/patterns/writing/notes-and-warnings/index.html @@ -0,0 +1,487 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Notes & warnings | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/writing/project-structure/index.html b/docs/patterns/writing/project-structure/index.html new file mode 100644 index 0000000..42fa320 --- /dev/null +++ b/docs/patterns/writing/project-structure/index.html @@ -0,0 +1,497 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Project structure | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/writing/references/index.html b/docs/patterns/writing/references/index.html new file mode 100644 index 0000000..b42d894 --- /dev/null +++ b/docs/patterns/writing/references/index.html @@ -0,0 +1,883 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + References | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/writing/snippets/index.html b/docs/patterns/writing/snippets/index.html new file mode 100644 index 0000000..b1cbcc4 --- /dev/null +++ b/docs/patterns/writing/snippets/index.html @@ -0,0 +1,461 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Snippets | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/patterns/writing/tables-of-contents/index.html b/docs/patterns/writing/tables-of-contents/index.html new file mode 100644 index 0000000..4c41129 --- /dev/null +++ b/docs/patterns/writing/tables-of-contents/index.html @@ -0,0 +1,445 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tables of contents | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/print-version/index.html b/docs/print-version/index.html new file mode 100644 index 0000000..8e09111 --- /dev/null +++ b/docs/print-version/index.html @@ -0,0 +1,2373 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cupper + + + + + + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/service-worker.js b/docs/service-worker.js new file mode 100644 index 0000000..c6430d9 --- /dev/null +++ b/docs/service-worker.js @@ -0,0 +1,268 @@ +/** + * Copyright 2016 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +// DO NOT EDIT THIS GENERATED OUTPUT DIRECTLY! +// This file should be overwritten as part of your build process. +// If you need to extend the behavior of the generated service worker, the best approach is to write +// additional code and include it using the importScripts option: +// https://github.com/GoogleChrome/sw-precache#importscripts-arraystring +// +// Alternatively, it's possible to make changes to the underlying template file and then use that as the +// new base for generating output, via the templateFilePath option: +// https://github.com/GoogleChrome/sw-precache#templatefilepath-string +// +// If you go that route, make sure that whenever you update your sw-precache dependency, you reconcile any +// changes made to this original template file with your modified copy. + +// This generated service worker JavaScript will precache your site's resources. +// The code needs to be saved in a .js file at the top-level of your site, and registered +// from your pages in order to be used. See +// https://github.com/googlechrome/sw-precache/blob/master/demo/app/js/service-worker-registration.js +// for an example of how you can register this script and handle various service worker events. + +/* eslint-env worker, serviceworker */ +/* eslint-disable indent, no-unused-vars, no-multiple-empty-lines, max-nested-callbacks, space-before-function-paren, quotes, comma-spacing */ +'use strict'; + +var precacheConfig = [["404.html","ee6e1ec48728ed7feb540b6646a9c5a7"],["browserconfig.xml","67c3113b1574fecc6015d56d774e1d38"],["categories/index.xml","b7219ca118bac884b575439e179569e2"],["css/fonts/miriamlibre-bold.woff","96496f6f06535d25b3bcba876917ca35"],["css/fonts/miriamlibre-bold.woff2","668defa44d9a74dd709ce0c826a5eb11"],["css/images/arrow_effect.svg","1434d178461f70c16b77acb4bdbc51e3"],["css/images/icon-tick.svg","35d4d4728ea80d254508b2bca4109d70"],["css/images/stripe.svg","fa3f32a026b6a1bb04ee98d963432e15"],["css/prism.css","004029c8c70ed2bbaa5d9debcf14f8c7"],["css/styles.css","4a9f58ade51a0d0093a6380aed62ca44"],["images/android-icon-144x144.png","43e1f47f182b13d0dee15f510213e928"],["images/android-icon-192x192.png","4c07782e52e0ab714074e6d3d69dc3ec"],["images/android-icon-36x36.png","3b2cd8c925a66bf84c89b68bb30e5f62"],["images/android-icon-48x48.png","45dc386eea1d8a46216a8b6de9b156c6"],["images/android-icon-512x512.png","42d6b28cc7eb41810a5392c81368340a"],["images/android-icon-72x72.png","b04c64637efed2b04fa900ddfcbfe75d"],["images/android-icon-96x96.png","bd9c126a4d6baf7ce442122ce0e89e11"],["images/apple-icon-precomposed.png","478755b1c3e0d2c8aea975033cff9ac8"],["images/apple-icon.png","478755b1c3e0d2c8aea975033cff9ac8"],["images/apple-touch-icon-114x114.png","95804b2192b0cea406b54cb31345c47d"],["images/apple-touch-icon-120x120.png","b5da0625c9e876bdf9768875f7dd9cca"],["images/apple-touch-icon-144x144.png","976151c9ecd72311dc6024917292209d"],["images/apple-touch-icon-152x152.png","8bd6a2e592c1c8463b5205ba8436227e"],["images/apple-touch-icon-180x180.png","56a93f4271dea903196794095e9f9ccc"],["images/apple-touch-icon-57x57.png","977183ab3bfb98da8d79e025f1cb4946"],["images/apple-touch-icon-60x60.png","55e9e05103a9b472a52f4c572a73b2b2"],["images/apple-touch-icon-72x72.png","1ef87a2887baab846f2501beb27445ee"],["images/apple-touch-icon-76x76.png","769826cd7526df4db7f4ba1a820158bd"],["images/bad_design_system.png","9c0e87a34e7d842b0e2831dc947249aa"],["images/browser-chrome-android.svg","3100b2a9c5f0e34982c717fc2aa46d73"],["images/browser-chrome.svg","fa39b4be6727525330e928f582fbe80a"],["images/browser-edge.svg","9e8265ab8f6a701587a4271dd3aa6a73"],["images/browser-firefox-android.svg","452df7b9e83c70a07e8e03b4e8dab9c4"],["images/browser-firefox.svg","d3093eda664be3d0cc6d791e1386420f"],["images/browser-ie.svg","13e192cf2b3fe17e7049a49b7d085caa"],["images/browser-opera.svg","95d65630c9f7deef6a3098af8f5baf9f"],["images/browser-safari-ios.svg","f729e629ec998ec40d313495d7257741"],["images/browser-safari.svg","523ee9491f5a937b8975f4d23aa77f62"],["images/favicon-16x16.png","7a99c20d6c00babddd26d03607b8721d"],["images/favicon-32x32.png","129881474a1bf130027bff7a1e89febd"],["images/favicon-96x96.png","bd9c126a4d6baf7ce442122ce0e89e11"],["images/favicon.ico","81c46feedbfcc6c6dc9495e4fd5adfad"],["images/icon-info.svg","53a6c555ce41f818556c71ab0dfc533b"],["images/icon-tag.svg","f067bbbc072941b2a0335679300bfc6c"],["images/icon-warning.svg","2a4322abbee9aed694fadb50e98a1f61"],["images/logo.svg","41f1c1780c2c5efa41d64359dbd651bb"],["images/ms-icon-144x144.png","43e1f47f182b13d0dee15f510213e928"],["images/ms-icon-150x150.png","e73370837ab9060772a18d62aaacd0f0"],["images/ms-icon-310x310.png","8a7143516b929702e3309bb537a99c5c"],["images/ms-icon-70x70.png","d7c6e7368733d53b5f979546d5aa4fe9"],["images/open_in_desktop.png","e899d6679b011aa7b0e783683d90d99b"],["images/samsung_homescreen.png","5ef40e64a18f966ce5c9084a024256db"],["images/serve_from_docs.png","15ae9eac3737a21593ebe00a9312bf9e"],["index.html","811fd597e3046fa1db9501360a5514ac"],["index.xml","49b52f9f52639c158861c0a3a2e63c80"],["js/dom-scripts.js","d1226c17a56c156113ee538031a0b6bf"],["js/prism.js","0c1fb8d3a69ee7c91dbf0f361ded7763"],["js/service-worker-registration.js","d60f01dc1393cbaaf4f7435339074d5e"],["manifest.json","381e6af4fc2816f9a137f1ef30c10ebd"],["patterns/coding/code-blocks/index.html","00f567b0b74e5b68db391c77f65d9d77"],["patterns/coding/color-palettes/index.html","b7a4ae72669d25720257c150bb3de588"],["patterns/coding/command-line/index.html","6a7a4a00948a0f73debbfde5042fb095"],["patterns/coding/demo-embedding/index.html","fed6b51a0941edd18a61f26ed3cafde3"],["patterns/coding/file-trees/index.html","aea1c48d108c3b1dd1aff1a310f2290f"],["patterns/coding/index.html","56de2f3eabe9b16e1a62c386d4b231fa"],["patterns/coding/index.xml","bb560877223964ac60e0b9a1248a6d35"],["patterns/coding/tested/index.html","8bb3f885ada85205e6fd0077321cda7b"],["patterns/coding/writing-inline-demos/index.html","fba5b8ccf6c92290efa3939637acbe15"],["patterns/index.html","c2f70e5eafed21c306e17b67a2f6aa07"],["patterns/index.xml","d5858fce0b97eabfdd83c867eed1375b"],["patterns/installation/index.html","1a0d314777d2f9c67408fe8bf3d4165f"],["patterns/media/including-images/index.html","b47ea408fabb31676d6f40c5f1882957"],["patterns/media/including-videos/index.html","5e35971ff1c5631b3773e75a9ea9bda9"],["patterns/media/index.html","fffca6dae27f4e99f83a6d3952866205"],["patterns/media/index.xml","71e2766a93623611b6b4c31ae4023eb8"],["patterns/printing/index.html","ac9e86c3b1b8b0c93726fbf622d3ae28"],["patterns/serving/index.html","ee7911fefbd2e8864268012dbb5a4aa1"],["patterns/setup/index.html","66d9de7fc0657226c25b5ee45b00ed0c"],["patterns/updating/index.html","454c078cd736890c1e5e41e57cfad35a"],["patterns/writing/expandable-sections/index.html","ccc75c4298881e3721f74e4c4fa42d2b"],["patterns/writing/index.html","b72c129d380ba49d5fa1dc2acae32660"],["patterns/writing/index.xml","4cddff005a675e89bf2677d91ffc3723"],["patterns/writing/markdown-and-metadata/index.html","73aa935074b88a67a766b8f8a64cbba3"],["patterns/writing/notes-and-warnings/index.html","bb8fa90eeb1e9b7c01e2f2f5a4fb8a7a"],["patterns/writing/project-structure/index.html","8bf9cd3e861b0cf9f6e01d464d9d1ffd"],["patterns/writing/references/index.html","1952d2490453773e59a0b99a7e75f33c"],["patterns/writing/snippets/index.html","205d0ce6f5cd376ab5314747fbd69104"],["patterns/writing/tables-of-contents/index.html","1992c28aec483a1b988e936f58497977"],["print-version/index.html","5a2f5a4540f593a2840b45b5ebbf25ab"],["sitemap.xml","3eb68d8dc7012b3f5e73b45320d81868"],["tags/index.xml","f9dcce911a40c37aa7dc4ffd4e623a29"],["tags/markdown/index.html","ab4b8a9ff466bbaface476cf09dcb95f"],["tags/markdown/index.xml","7e7c99e47c7ba81c9f36493e87925bc4"],["tags/metadata/index.html","aed620b8f53c4cd16d7d2e124649a09f"],["tags/metadata/index.xml","39f48a6b0cc323e2c1f24dacb7a11442"]]; +var cacheName = 'sw-precache-v3-sw-precache-' + (self.registration ? self.registration.scope : ''); + + +var ignoreUrlParametersMatching = [/^utm_/]; + + + +var addDirectoryIndex = function (originalUrl, index) { + var url = new URL(originalUrl); + if (url.pathname.slice(-1) === '/') { + url.pathname += index; + } + return url.toString(); + }; + +var cleanResponse = function (originalResponse) { + // If this is not a redirected response, then we don't have to do anything. + if (!originalResponse.redirected) { + return Promise.resolve(originalResponse); + } + + // Firefox 50 and below doesn't support the Response.body stream, so we may + // need to read the entire body to memory as a Blob. + var bodyPromise = 'body' in originalResponse ? + Promise.resolve(originalResponse.body) : + originalResponse.blob(); + + return bodyPromise.then(function(body) { + // new Response() is happy when passed either a stream or a Blob. + return new Response(body, { + headers: originalResponse.headers, + status: originalResponse.status, + statusText: originalResponse.statusText + }); + }); + }; + +var createCacheKey = function (originalUrl, paramName, paramValue, + dontCacheBustUrlsMatching) { + // Create a new URL object to avoid modifying originalUrl. + var url = new URL(originalUrl); + + // If dontCacheBustUrlsMatching is not set, or if we don't have a match, + // then add in the extra cache-busting URL parameter. + if (!dontCacheBustUrlsMatching || + !(url.pathname.match(dontCacheBustUrlsMatching))) { + url.search += (url.search ? '&' : '') + + encodeURIComponent(paramName) + '=' + encodeURIComponent(paramValue); + } + + return url.toString(); + }; + +var isPathWhitelisted = function (whitelist, absoluteUrlString) { + // If the whitelist is empty, then consider all URLs to be whitelisted. + if (whitelist.length === 0) { + return true; + } + + // Otherwise compare each path regex to the path of the URL passed in. + var path = (new URL(absoluteUrlString)).pathname; + return whitelist.some(function(whitelistedPathRegex) { + return path.match(whitelistedPathRegex); + }); + }; + +var stripIgnoredUrlParameters = function (originalUrl, + ignoreUrlParametersMatching) { + var url = new URL(originalUrl); + // Remove the hash; see https://github.com/GoogleChrome/sw-precache/issues/290 + url.hash = ''; + + url.search = url.search.slice(1) // Exclude initial '?' + .split('&') // Split into an array of 'key=value' strings + .map(function(kv) { + return kv.split('='); // Split each 'key=value' string into a [key, value] array + }) + .filter(function(kv) { + return ignoreUrlParametersMatching.every(function(ignoredRegex) { + return !ignoredRegex.test(kv[0]); // Return true iff the key doesn't match any of the regexes. + }); + }) + .map(function(kv) { + return kv.join('='); // Join each [key, value] array into a 'key=value' string + }) + .join('&'); // Join the array of 'key=value' strings into a string with '&' in between each + + return url.toString(); + }; + + +var hashParamName = '_sw-precache'; +var urlsToCacheKeys = new Map( + precacheConfig.map(function(item) { + var relativeUrl = item[0]; + var hash = item[1]; + var absoluteUrl = new URL(relativeUrl, self.location); + var cacheKey = createCacheKey(absoluteUrl, hashParamName, hash, false); + return [absoluteUrl.toString(), cacheKey]; + }) +); + +function setOfCachedUrls(cache) { + return cache.keys().then(function(requests) { + return requests.map(function(request) { + return request.url; + }); + }).then(function(urls) { + return new Set(urls); + }); +} + +self.addEventListener('install', function(event) { + event.waitUntil( + caches.open(cacheName).then(function(cache) { + return setOfCachedUrls(cache).then(function(cachedUrls) { + return Promise.all( + Array.from(urlsToCacheKeys.values()).map(function(cacheKey) { + // If we don't have a key matching url in the cache already, add it. + if (!cachedUrls.has(cacheKey)) { + var request = new Request(cacheKey, {credentials: 'same-origin'}); + return fetch(request).then(function(response) { + // Bail out of installation unless we get back a 200 OK for + // every request. + if (!response.ok) { + throw new Error('Request for ' + cacheKey + ' returned a ' + + 'response with status ' + response.status); + } + + return cleanResponse(response).then(function(responseToCache) { + return cache.put(cacheKey, responseToCache); + }); + }); + } + }) + ); + }); + }).then(function() { + + // Force the SW to transition from installing -> active state + return self.skipWaiting(); + + }) + ); +}); + +self.addEventListener('activate', function(event) { + var setOfExpectedUrls = new Set(urlsToCacheKeys.values()); + + event.waitUntil( + caches.open(cacheName).then(function(cache) { + return cache.keys().then(function(existingRequests) { + return Promise.all( + existingRequests.map(function(existingRequest) { + if (!setOfExpectedUrls.has(existingRequest.url)) { + return cache.delete(existingRequest); + } + }) + ); + }); + }).then(function() { + + return self.clients.claim(); + + }) + ); +}); + + +self.addEventListener('fetch', function(event) { + if (event.request.method === 'GET') { + // Should we call event.respondWith() inside this fetch event handler? + // This needs to be determined synchronously, which will give other fetch + // handlers a chance to handle the request if need be. + var shouldRespond; + + // First, remove all the ignored parameters and hash fragment, and see if we + // have that URL in our cache. If so, great! shouldRespond will be true. + var url = stripIgnoredUrlParameters(event.request.url, ignoreUrlParametersMatching); + shouldRespond = urlsToCacheKeys.has(url); + + // If shouldRespond is false, check again, this time with 'index.html' + // (or whatever the directoryIndex option is set to) at the end. + var directoryIndex = 'index.html'; + if (!shouldRespond && directoryIndex) { + url = addDirectoryIndex(url, directoryIndex); + shouldRespond = urlsToCacheKeys.has(url); + } + + // If shouldRespond is still false, check to see if this is a navigation + // request, and if so, whether the URL matches navigateFallbackWhitelist. + var navigateFallback = ''; + if (!shouldRespond && + navigateFallback && + (event.request.mode === 'navigate') && + isPathWhitelisted([], event.request.url)) { + url = new URL(navigateFallback, self.location).toString(); + shouldRespond = urlsToCacheKeys.has(url); + } + + // If shouldRespond was set to true at any point, then call + // event.respondWith(), using the appropriate cache key. + if (shouldRespond) { + event.respondWith( + caches.open(cacheName).then(function(cache) { + return cache.match(urlsToCacheKeys.get(url)).then(function(response) { + if (response) { + return response; + } + throw Error('The cached response that was expected is missing.'); + }); + }).catch(function(e) { + // Fall back to just fetch()ing the request if some unexpected error + // prevented the cached response from being valid. + console.warn('Couldn\'t serve response for "%s" from cache: %O', event.request.url, e); + return fetch(event.request); + }) + ); + } + } +}); + + + + + + + diff --git a/docs/sitemap.xml b/docs/sitemap.xml new file mode 100644 index 0000000..5f5c0a9 --- /dev/null +++ b/docs/sitemap.xml @@ -0,0 +1,136 @@ + + + + + https://thepaciellogroup.github.io/cupper/patterns/coding/code-blocks/ + + + + https://thepaciellogroup.github.io/cupper/patterns/installation/ + + + + https://thepaciellogroup.github.io/cupper/patterns/writing/project-structure/ + + + + https://thepaciellogroup.github.io/cupper/patterns/writing/ + + + + https://thepaciellogroup.github.io/cupper/patterns/coding/demo-embedding/ + + + + https://thepaciellogroup.github.io/cupper/patterns/media/ + + + + https://thepaciellogroup.github.io/cupper/patterns/setup/ + + + + https://thepaciellogroup.github.io/cupper/patterns/writing/markdown-and-metadata/ + + + + https://thepaciellogroup.github.io/cupper/patterns/serving/ + + + + https://thepaciellogroup.github.io/cupper/patterns/coding/writing-inline-demos/ + + + + https://thepaciellogroup.github.io/cupper/patterns/printing/ + + + + https://thepaciellogroup.github.io/cupper/patterns/updating/ + + + + https://thepaciellogroup.github.io/cupper/patterns/writing/expandable-sections/ + + + + https://thepaciellogroup.github.io/cupper/print-version/ + 2017-07-29T22:48:43+01:00 + + + + https://thepaciellogroup.github.io/cupper/ + 2017-06-26T18:27:58+01:00 + + + + https://thepaciellogroup.github.io/cupper/categories/ + 0 + + + + https://thepaciellogroup.github.io/cupper/patterns/coding/ + + + + https://thepaciellogroup.github.io/cupper/patterns/coding/color-palettes/ + + + + https://thepaciellogroup.github.io/cupper/patterns/coding/command-line/ + + + + https://thepaciellogroup.github.io/cupper/patterns/coding/file-trees/ + + + + https://thepaciellogroup.github.io/cupper/patterns/media/including-images/ + + + + https://thepaciellogroup.github.io/cupper/patterns/media/including-videos/ + + + + https://thepaciellogroup.github.io/cupper/tags/markdown/ + 0 + + + + https://thepaciellogroup.github.io/cupper/tags/metadata/ + 0 + + + + https://thepaciellogroup.github.io/cupper/patterns/writing/notes-and-warnings/ + + + + https://thepaciellogroup.github.io/cupper/patterns/ + 0 + + + + https://thepaciellogroup.github.io/cupper/patterns/writing/references/ + + + + https://thepaciellogroup.github.io/cupper/patterns/writing/snippets/ + + + + https://thepaciellogroup.github.io/cupper/patterns/writing/tables-of-contents/ + + + + https://thepaciellogroup.github.io/cupper/tags/ + 0 + + + + https://thepaciellogroup.github.io/cupper/patterns/coding/tested/ + + + \ No newline at end of file diff --git a/docs/tags/index.xml b/docs/tags/index.xml new file mode 100644 index 0000000..ec674e5 --- /dev/null +++ b/docs/tags/index.xml @@ -0,0 +1,32 @@ + + + + Tags on Cupper + https://thepaciellogroup.github.io/cupper/tags/ + Recent content in Tags on Cupper + Hugo -- gohugo.io + en-us + + + + + + Markdown + https://thepaciellogroup.github.io/cupper/tags/markdown/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/tags/markdown/ + + + + + Metadata + https://thepaciellogroup.github.io/cupper/tags/metadata/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/tags/metadata/ + + + + + \ No newline at end of file diff --git a/docs/tags/markdown/index.html b/docs/tags/markdown/index.html new file mode 100644 index 0000000..ed37030 --- /dev/null +++ b/docs/tags/markdown/index.html @@ -0,0 +1,425 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Patterns tagged Markdown | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/tags/markdown/index.xml b/docs/tags/markdown/index.xml new file mode 100644 index 0000000..89f831b --- /dev/null +++ b/docs/tags/markdown/index.xml @@ -0,0 +1,24 @@ + + + + Markdown on Cupper + https://thepaciellogroup.github.io/cupper/tags/markdown/ + Recent content in Markdown on Cupper + Hugo -- gohugo.io + en-us + + + + + + Markdown & metadata + https://thepaciellogroup.github.io/cupper/patterns/writing/markdown-and-metadata/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/markdown-and-metadata/ + In Cupper everything is documented using markdown, as a &ldquo;pattern&rdquo;. To create a new pattern file, just add a file with the .md extension to the content/patterns folder. It&rsquo;s recommended you use &ldquo;kebab case&rdquo; to name the file (words separated by hyphens). For example, a pattern with the title &ldquo;Menu button&rdquo; should probably have the filename menu-button. Then you get a nice clean URL: username.github.io/your-library/patterns/menu-button. +If you&rsquo;re not familiar with writing markdown, there are a number of tutorials available. + + + + \ No newline at end of file diff --git a/docs/tags/metadata/index.html b/docs/tags/metadata/index.html new file mode 100644 index 0000000..36d236e --- /dev/null +++ b/docs/tags/metadata/index.html @@ -0,0 +1,425 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Patterns tagged Metadata | Cupper + + + + + + + skip to content + + + + + + + + + + W3C + SVG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + diff --git a/docs/tags/metadata/index.xml b/docs/tags/metadata/index.xml new file mode 100644 index 0000000..7d453c2 --- /dev/null +++ b/docs/tags/metadata/index.xml @@ -0,0 +1,24 @@ + + + + Metadata on Cupper + https://thepaciellogroup.github.io/cupper/tags/metadata/ + Recent content in Metadata on Cupper + Hugo -- gohugo.io + en-us + + + + + + Markdown & metadata + https://thepaciellogroup.github.io/cupper/patterns/writing/markdown-and-metadata/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://thepaciellogroup.github.io/cupper/patterns/writing/markdown-and-metadata/ + In Cupper everything is documented using markdown, as a &ldquo;pattern&rdquo;. To create a new pattern file, just add a file with the .md extension to the content/patterns folder. It&rsquo;s recommended you use &ldquo;kebab case&rdquo; to name the file (words separated by hyphens). For example, a pattern with the title &ldquo;Menu button&rdquo; should probably have the filename menu-button. Then you get a nice clean URL: username.github.io/your-library/patterns/menu-button. +If you&rsquo;re not familiar with writing markdown, there are a number of tutorials available. + + + + \ No newline at end of file diff --git a/lib/build.js b/lib/build.js index 39478ab..bfd032f 100644 --- a/lib/build.js +++ b/lib/build.js @@ -1,10 +1,10 @@ var exec = require('child_process').exec; var path = require('path'); +console.log('Building...'); exec('rm -rfv ' + path.join(path.resolve('.'), 'docs', '*') + ' && hugo && sw-precache --root=docs && git add -A', function(error, stdout, stderr) { - console.log('Building...'); if (error !== null) { - console.error('Error building site.'); + console.error(error); return; } console.log('Site built at /docs.'); diff --git a/lib/clean.js b/lib/clean.js index 7afcbcf..d7239fb 100644 --- a/lib/clean.js +++ b/lib/clean.js @@ -1,8 +1,8 @@ var exec = require('child_process').exec; var path = require('path'); +console.log('Initializing new project...'); exec('rm -rf ' + path.join(path.resolve('.'), 'content') + ' && mkdir content && mkdir ' + path.join('content', 'patterns'), function(error, stdout, stderr) { - console.log('Initializing new project...'); if (error !== null) { console.error('Error creating folder structure.'); return; diff --git a/lib/update.js b/lib/update.js index 43d14e3..accfe1f 100755 --- a/lib/update.js +++ b/lib/update.js @@ -4,8 +4,8 @@ var path = require('path'); var themeFolder = path.join(path.resolve('.'), 'themes'); var oldTheme = path.join(themeFolder, 'cupper'); +console.log('Updating...'); exec('mv '+oldTheme+' '+oldTheme+'-old-'+Date.now(), function(error, stdout, stderr) { - console.log('Updating...'); if (error !== null) { console.error('Error saving old cupper version.'); return;