diff --git a/content/patterns/writing/expandable-sections.md b/content/patterns/writing/expandable-sections.md index a826d7f..7c19a4e 100644 --- a/content/patterns/writing/expandable-sections.md +++ b/content/patterns/writing/expandable-sections.md @@ -35,10 +35,4 @@ Mauris eget elit ut neque venenatis placerat id nec libero. Nunc accumsan cursus Ut vulputate enim ut lorem iaculis, vel faucibus metus iaculis. Aliquam erat volutpat. Aliquam luctus orci vel consectetur dignissim. Nullam et efficitur lorem, et ornare est. Sed tristique porttitor justo, quis malesuada velit. Nullam et elit finibus, sollicitudin velit placerat, ultricies dui. {{% /expandable %}} -Unfortunately, it is not currently possible to include shortcodes inside other shortcodes, using the `{{% %}}` notation (which is designated for markdown content). If you use the angle brackets notation (illustrated below) it is possible, but markdown will no longer be permitted. You will have to code HTML inside such a section manually. - -{{}} -{{<expandable label="Another dummy section" level="2">}} -<p>Here is a nested pattern reference shortcode: {{% pattern "Writing inline demos" %}}.</p> -{{</expandable>}} -{{}} +Unfortunately, it is not currently possible to include shortcodes inside other shortcodes, using the "`%`" notation (which is designated for markdown content). If you use the angle brackets notation (illustrated below) it is possible, but markdown will no longer be permitted. You will have to code HTML inside such a section manually. diff --git a/public/css/styles.css b/public/css/styles.css index ba5b8fe..0d93ccb 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -310,7 +310,7 @@ th:empty { margin: 0; } -.tag { +.tag-icon { height: 1em; width: auto; vertical-align: middle; @@ -423,7 +423,6 @@ pre[class*=language-] code * { } *:not(pre) > code { - padding: 0.125rem 0.25rem; white-space: nowrap; } @@ -462,11 +461,11 @@ pre[class*=language-] code * { } .token.function { - color: #ccc; + color: #888; } .line-numbers code { - padding-left: 2.25rem; + padding-left: 3rem; margin-top: -1rem; overflow-x: auto; overflow-y: hidden; @@ -478,8 +477,10 @@ pre[class*=language-] code * { .line-numbers .line-numbers-rows { margin-left: 2.25rem; + left: -3.5em; top: 1.25rem; color: #111; + border-color: #111; } .line-numbers-rows > span:before { @@ -614,7 +615,6 @@ a .balloon { .intro-and-nav > div { padding: 1.5rem; - padding-bottom: 0; } .logo img { @@ -626,29 +626,11 @@ a .balloon { } .patterns h3 { - margin-top: 0.75rem; + font-size: 1.125rem; } - .patterns li { - margin: 0; - } - - .patterns a { - padding: 0.75rem 0; + .pattern { font-size: 1rem; } - .patterns a[aria-current] { - background: #111; - color: #fff; - padding: 0.75rem; - } - - .patterns a[aria-current] span { - text-decoration: none; - } - - .patterns li + li { - border-top: 1px solid; - } } diff --git a/public/index.html b/public/index.html index b19302e..dbb2905 100644 --- a/public/index.html +++ b/public/index.html @@ -76,7 +76,7 @@
  • - + Library setup @@ -110,6 +110,13 @@
  • +
  • + + + Expandable sections + +
  • +
  • @@ -134,6 +141,34 @@
  • +
  • +

    Exhibiting code

    +
    +
  • + @@ -170,6 +205,16 @@ + + + + + + + + + + diff --git a/public/index.xml b/public/index.xml index 709c55a..f42e312 100644 --- a/public/index.xml +++ b/public/index.xml @@ -31,6 +31,40 @@ If you&rsquo;re not familiar with writing markdown, there are a number of tutorials available. + + Expandable sections + /patterns/writing/expandable-sections/ + Mon, 01 Jan 0001 00:00:00 +0000 + + /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. Infusion 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. + + + + Code blocks + /patterns/code/code-blocks/ + Mon, 01 Jan 0001 00:00:00 +0000 + + /patterns/code/code-blocks/ + Markdown already supports code samples both inline (using single backticks like `some code here`) and in blocks. Infusion 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. Infusion 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. + + + + CodePen embedding + /patterns/code/codepen-embedding/ + Mon, 01 Jan 0001 00:00:00 +0000 + + /patterns/code/codepen-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. +Infusion 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: + + Including images /patterns/writing/including-images/ @@ -55,10 +89,10 @@ brew install hugo Alternatively, you can manually install Hugo from a package. Y Library setup - /patterns/project-setup/ + /patterns/library-setup/ Mon, 01 Jan 0001 00:00:00 +0000 - /patterns/project-setup/ + /patterns/library-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 Infusion. You should also have run npm install in the root of that codebase. &ldquo;Cleaning&rdquo; the content folder Before you can start documenting patterns, there are a few things still to do in order to get set up. At the moment, your version of Infusion is a facsimile of the original, containing all this documentation content. @@ -79,8 +113,8 @@ Notes You may wish to pick out some content in your pattern&rsquo;s document Mon, 01 Jan 0001 00:00:00 +0000 /patterns/writing/references/ - Cross-references Infusion provides an easy mechanism to cross-reference patterns, by name, using the pattern shortcode. For example, I can reference the pattern here. Here&rsquo;s what the markdown looks like, including the shortcode: -I can reference the &#x7b;{% pattern "Notes and 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. + Cross-references Infusion provides an easy mechanism to cross-reference patterns, by title, 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. @@ -94,5 +128,15 @@ npm run serve This will serve your working library on localhost:1313. Whenever y Publishing on Github Pages The easiest way to host your pattern library so you have a link to share is to run the host command. + + Writing inline demos + /patterns/code/writing-inline-demos/ + Mon, 01 Jan 0001 00:00:00 +0000 + + /patterns/code/writing-inline-demos/ + There are some issues with CodePen embedding , like them not working offline. They also come with CodePen branding, which will clash with the pattern you&rsquo;re trying to illustrate. +Infusion 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. + + \ No newline at end of file diff --git a/public/patterns/index.html b/public/patterns/index.html index 1a48883..14595a3 100644 --- a/public/patterns/index.html +++ b/public/patterns/index.html @@ -75,7 +75,7 @@
  • - + Library setup @@ -109,6 +109,13 @@
  • +
  • + + + Expandable sections + +
  • +
  • @@ -133,6 +140,34 @@
  • +
  • +

    Exhibiting code

    +
    +
  • + @@ -161,7 +196,7 @@
  • - + Library setup diff --git a/public/patterns/index.xml b/public/patterns/index.xml index 867643c..ab5e652 100644 --- a/public/patterns/index.xml +++ b/public/patterns/index.xml @@ -24,10 +24,10 @@ brew install hugo Alternatively, you can manually install Hugo from a package. Y Library setup - /patterns/project-setup/ + /patterns/library-setup/ Mon, 01 Jan 0001 00:00:00 +0000 - /patterns/project-setup/ + /patterns/library-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 Infusion. You should also have run npm install in the root of that codebase. &ldquo;Cleaning&rdquo; the content folder Before you can start documenting patterns, there are a few things still to do in order to get set up. At the moment, your version of Infusion is a facsimile of the original, containing all this documentation content. diff --git a/public/patterns/installation/index.html b/public/patterns/installation/index.html index 9e27d93..d16364c 100644 --- a/public/patterns/installation/index.html +++ b/public/patterns/installation/index.html @@ -75,7 +75,7 @@

  • - + Library setup @@ -109,6 +109,13 @@
  • +
  • + + + Expandable sections + +
  • +
  • @@ -133,6 +140,34 @@
  • +
  • +

    Exhibiting code

    +
    +
  • + @@ -220,7 +255,17 @@ - + + + + + + + + + + + diff --git a/public/patterns/serving/index.html b/public/patterns/serving/index.html index ae06ce5..c84fbfd 100644 --- a/public/patterns/serving/index.html +++ b/public/patterns/serving/index.html @@ -75,7 +75,7 @@
  • - + Library setup @@ -109,6 +109,13 @@
  • +
  • + + + Expandable sections + +
  • +
  • @@ -133,6 +140,34 @@
  • +
  • +

    Exhibiting code

    +
    +
  • + diff --git a/public/patterns/writing/including-images/index.html b/public/patterns/writing/including-images/index.html index ac0fd6e..a7c8b10 100644 --- a/public/patterns/writing/including-images/index.html +++ b/public/patterns/writing/including-images/index.html @@ -75,7 +75,7 @@
  • - + Library setup @@ -109,6 +109,13 @@
  • +
  • + + + Expandable sections + +
  • +
  • @@ -133,6 +140,34 @@
  • +
  • +

    Exhibiting code

    +
    +
  • + diff --git a/public/patterns/writing/index.html b/public/patterns/writing/index.html index c559d36..0bdae18 100644 --- a/public/patterns/writing/index.html +++ b/public/patterns/writing/index.html @@ -75,7 +75,7 @@
  • - + Library setup @@ -109,6 +109,13 @@
  • +
  • + + + Expandable sections + +
  • +
  • @@ -133,6 +140,34 @@
  • +
  • +

    Exhibiting code

    +
    +
  • + @@ -169,6 +204,16 @@ +
  • +

    + + + Expandable sections + +

    +
  • + +
  • diff --git a/public/patterns/writing/index.xml b/public/patterns/writing/index.xml index 8625a7b..1ef8836 100644 --- a/public/patterns/writing/index.xml +++ b/public/patterns/writing/index.xml @@ -30,6 +30,17 @@ If you&rsquo;re not familiar with writing markdown, there are a number of tutorials available. + + Expandable sections + /patterns/writing/expandable-sections/ + Mon, 01 Jan 0001 00:00:00 +0000 + + /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. Infusion 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. + + Including images /patterns/writing/including-images/ @@ -56,8 +67,8 @@ Notes You may wish to pick out some content in your pattern&rsquo;s document Mon, 01 Jan 0001 00:00:00 +0000 /patterns/writing/references/ - Cross-references Infusion provides an easy mechanism to cross-reference patterns, by name, using the pattern shortcode. For example, I can reference the pattern here. Here&rsquo;s what the markdown looks like, including the shortcode: -I can reference the &#x7b;{% pattern "Notes and 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. + Cross-references Infusion provides an easy mechanism to cross-reference patterns, by title, 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. diff --git a/public/patterns/writing/library-structure/index.html b/public/patterns/writing/library-structure/index.html index 4d9a264..832c9e8 100644 --- a/public/patterns/writing/library-structure/index.html +++ b/public/patterns/writing/library-structure/index.html @@ -75,7 +75,7 @@

  • - + Library setup @@ -109,6 +109,13 @@
  • +
  • + + + Expandable sections + +
  • +
  • @@ -133,6 +140,34 @@
  • +
  • +

    Exhibiting code

    +
    +
  • + @@ -199,6 +234,8 @@ title = "Popups" + +
  • - + Library setup @@ -109,6 +109,13 @@
  • +
  • + + + Expandable sections + +
  • +
  • @@ -133,6 +140,34 @@
  • +
  • +

    Exhibiting code

    +
    +
  • + diff --git a/public/patterns/writing/notes-and-warnings/index.html b/public/patterns/writing/notes-and-warnings/index.html index 8aa1f35..9762c53 100644 --- a/public/patterns/writing/notes-and-warnings/index.html +++ b/public/patterns/writing/notes-and-warnings/index.html @@ -75,7 +75,7 @@
  • - + Library setup @@ -109,6 +109,13 @@
  • +
  • + + + Expandable sections + +
  • +
  • @@ -133,6 +140,34 @@
  • +
  • +

    Exhibiting code

    +
    +
  • + diff --git a/public/patterns/writing/references/index.html b/public/patterns/writing/references/index.html index 9e46db0..3460d4f 100644 --- a/public/patterns/writing/references/index.html +++ b/public/patterns/writing/references/index.html @@ -75,7 +75,7 @@
  • - + Library setup @@ -109,6 +109,13 @@
  • +
  • + + + Expandable sections + +
  • +
  • @@ -133,6 +140,34 @@
  • +
  • +

    Exhibiting code

    +
    +
  • + @@ -148,7 +183,7 @@

    Cross-references

    -

    Infusion provides an easy mechanism to cross-reference patterns, by name, using the pattern shortcode. For example, I can reference the +

    Infusion provides an easy mechanism to cross-reference patterns, by title, using the pattern shortcode. For example, I can reference the @@ -174,17 +209,43 @@ + + + + Notes & warnings + - pattern here. Here’s what the markdown looks like, including the shortcode:

    + + + + + + + + + + + pattern. Here’s what the markdown looks like, including the shortcode:

    
    -I can reference the {{% pattern "Notes and warnings" %}} pattern here.
    +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.

    + + +

    WCAG References

    WCAG 2.0 is the de facto standard for accessible interfaces. When writing about inclusive design patterns, sometimes you’ll want to refer to WCAG to highlight which success criteria the pattern meets.

    diff --git a/public/sitemap.xml b/public/sitemap.xml index 785a304..ba5a5b4 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -6,10 +6,18 @@ /patterns/writing/library-structure/ + + /patterns/writing/ + + /patterns/writing/markdown-and-metadata/ + + /patterns/writing/expandable-sections/ + + / 2017-06-26T18:27:58+01:00 @@ -20,6 +28,18 @@ 0 + + /patterns/code/code-blocks/ + + + + /patterns/code/codepen-embedding/ + + + + /patterns/code/ + + /patterns/writing/including-images/ @@ -29,7 +49,7 @@ - /patterns/project-setup/ + /patterns/library-setup/ @@ -55,7 +75,7 @@ - /patterns/writing/ + /patterns/code/writing-inline-demos/ \ No newline at end of file