فهرست منبع

false values honored for references

Heydon Pickering 7 سال پیش
والد
کامیت
a3cfd63839

+ 4 - 0
content/patterns/writing/references.md

@@ -46,6 +46,10 @@ Here's the more verbose output:
 
 {{% wcag include="2.1.1, 4.1.2" descriptions="true" %}}
 
+{{% note %}}
+Both omitting the `descriptions` attribute and including it with a "false" value will omit descriptions. If it is included it _must_ have a value. A boolean attribute will break the output.
+{{% /note %}}
+
 ## Inclusive Design Principle references
 
 Some inclusive design concepts are not reducible to success or fail criteria. This is why The Paciello Group wrote the [Inclusive Design Principles](http://inclusivedesignprinciples.org/). These can be listed by name.

+ 13 - 2
docs/patterns/writing/references/index.html

@@ -786,14 +786,25 @@ I can reference the {{% pattern "Notes & warnings" %}} pattern here.
 </ul>
 
 
+<aside aria-label="note" class="note">
+  <div>
+    <svg class="sign" aria-hidden="true" viewBox="0 0 41.667306 41.66729" focusable="false">
+      <use xlink:href="#info"></use>
+    </svg>
+    <p>Both omitting the <code>descriptions</code> attribute and including it with a &ldquo;false&rdquo; value will omit descriptions. If it is included it <em>must</em> have a value. A boolean attribute will break the output.</p>
+
+  </div>
+</aside>
+
+
 <h2 id="inclusive-design-principle-references">Inclusive Design Principle references</h2>
 
 <p>Some inclusive design concepts are not reducible to success or fail criteria. This is why The Paciello Group wrote the <a href="http://inclusivedesignprinciples.org/">Inclusive Design Principles</a>. These can be listed by name.</p>
 
-<p><pre class=""><code  data-codeblock-shortcode>
+<pre class=""><code  data-codeblock-shortcode>
 &#x7b;{% principles include="Add value, Be consistent" descriptions="true" %}}
 </code></pre>
-</p>
+
 
 <p>Here&rsquo;s the output with <code>descriptions=&quot;true&quot;</code>:</p>
 

+ 13 - 2
docs/print-version/index.html

@@ -1402,14 +1402,25 @@ I can reference the &#x7b;{% pattern "Notes & warnings" %}} pattern here.
 </ul>
 
 
+<aside aria-label="note" class="note">
+  <div>
+    <svg class="sign" aria-hidden="true" viewBox="0 0 41.667306 41.66729" focusable="false">
+      <use xlink:href="#info"></use>
+    </svg>
+    <p>Both omitting the <code>descriptions</code> attribute and including it with a &ldquo;false&rdquo; value will omit descriptions. If it is included it <em>must</em> have a value. A boolean attribute will break the output.</p>
+
+  </div>
+</aside>
+
+
 <h2 id="inclusive-design-principle-references">Inclusive Design Principle references</h2>
 
 <p>Some inclusive design concepts are not reducible to success or fail criteria. This is why The Paciello Group wrote the <a href="http://inclusivedesignprinciples.org/">Inclusive Design Principles</a>. These can be listed by name.</p>
 
-<p><pre class=""><code  data-codeblock-shortcode>
+<pre class=""><code  data-codeblock-shortcode>
 &#x7b;{% principles include="Add value, Be consistent" descriptions="true" %}}
 </code></pre>
-</p>
+
 
 <p>Here&rsquo;s the output with <code>descriptions=&quot;true&quot;</code>:</p>
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
docs/service-worker.js


+ 2 - 2
themes/infusion/layouts/shortcodes/principles.html

@@ -2,7 +2,7 @@
 {{ $included := replace (.Get "include") ", " "," }}
 {{ $included := apply (split $included ",") "lower" "." }}
 {{ $descriptions := .Get "descriptions" }}
-<ul class="principles {{ if $descriptions }}with-desc{{ end }}">
+<ul class="principles {{ if and ($descriptions) (ne $descriptions "false") }}with-desc{{ end }}">
   {{ range $JSON.principles }}
     {{ if in $included (lower .title) }}
       <li>
@@ -15,7 +15,7 @@
           </a>:
         </strong>
         <em>{{ .strapline }}</em>
-        {{ if $descriptions }}
+        {{ if and ($descriptions) (ne $descriptions "false") }}
           <p>{{ .description }}</p>
         {{ end }}
       </li>

+ 2 - 2
themes/infusion/layouts/shortcodes/wcag.html

@@ -2,7 +2,7 @@
 {{ $included := replace (.Get "include") ", " "," }}
 {{ $included := split $included "," }}
 {{ $descriptions := .Get "descriptions" }}
-<ul class="wcag {{ if $descriptions }}with-desc{{ end }}">
+<ul class="wcag {{ if and ($descriptions) (ne $descriptions "false") }}with-desc{{ end }}">
   {{ range $JSON }}
     {{ if in $included .ref_id }}
       <li>
@@ -12,7 +12,7 @@
           </svg>
           {{ .ref_id }} {{ .title }}</a> (level {{ .level }}){{ if $descriptions }}:{{ end }}
         </strong>
-        {{ if $descriptions }}
+        {{ if and ($descriptions) (ne $descriptions "false") }}
           {{ .description }}
           {{ if .special_cases }}
             <ul>

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است