]> granicus.if.org Git - jq/commitdiff
Fix some w3c validator complaints
authorDavid Tolnay <dtolnay@gmail.com>
Fri, 14 Aug 2015 06:34:09 +0000 (23:34 -0700)
committerDavid Tolnay <dtolnay@gmail.com>
Fri, 14 Aug 2015 07:01:49 +0000 (00:01 -0700)
docs/Rakefile
docs/templates/index.liquid
docs/templates/manual.liquid
docs/templates/shared/_header.liquid

index 8fba5a9620cad348473a2a3611accb7daae46865..b204dfa9c1631c2f2fc4324e8cf847d704395a0f 100644 (file)
@@ -16,6 +16,10 @@ module ExtraFilters
     input.gsub(/[^a-zA-Z0-9_]/,"")
   end
 
+  def no_paragraph(input)
+    input.gsub('<p>', '').gsub('</p>', '')
+  end
+
   def json(input)
     input.to_json
   end
index 69aa6e34533e38f15fc101ddb7702cc525cff20b..18453d304905cd431891c80b94e8deb1a514c362 100644 (file)
@@ -10,7 +10,7 @@
         <div class="jumbotron">
           <div class="row">
             <div class="col-sm-6">
-              <img src="{{root}}/jq.png" class="img-responsive"
+              <img src="{{root}}/jq.png" class="img-responsive" alt="jq logo"
                   width="400" height="220">
             </div>
             <div class="col-sm-6">
index c34aa21c59c9cc5a25f74898124e6bcd7f4e7927..d464b8016ff067aa99460b9a9e84a2b40d4fbaf8 100644 (file)
               <h2>{{section.title}}</h2>
               {{section.body | markdownify}}
               {% for entry in section.entries %}
-                <section id="{{entry.title | sanitize}}">
-                <h3>
-                  {{entry.title | markdownify}}
-                  {% if entry.subtitle %}<small>{{entry.subtitle}}</small>{% endif %}
-                </h3>
-                {{entry.body | markdownify}}
+                <section>
+                  <h3>
+                    {{entry.title | markdownify | no_paragraph}}
+                    {% if entry.subtitle %}<small>{{entry.subtitle}}</small>{% endif %}
+                  </h3>
+                  {{entry.body | markdownify}}
 
-                {% if entry.examples %}
-                  <div>
-                    {% capture exampleID %}{{ "" | unique }}{% endcapture %}
-                    <a data-toggle="collapse" href="#example{{exampleID}}">
-                      <i class="glyphicon glyphicon-chevron-right"></i>
-                      {% if entry.examples[1] %}Examples{%else%}Example{%endif%}
-                    </a>
-                    <div id="example{{exampleID}}" class="collapse">
-
-                    {% for example in entry.examples %}
-                      <table class="manual-example">
-                        <tr><th></th><td class="jqprogram">jq '{{example.program | escape}}'</td></tr>
-                        <tr><th>Input</th><td>{{example.input | escape}}</td></tr>
-                        {% unless example.output[0] %}
-                          <tr>
-                            <th>Output</th>
-                            <td><i>none</i></td>
-                          </tr>
-                        {% endunless %}
-                        {% for output in example.output %}
-                          <tr>
-                            {% if forloop.index == 1 %}
-                              <th>Output</th>
-                            {% else %}
-                              <th></th>
-                            {% endif %}
-                            <td>{{output | escape}}</td>
-                          </tr>
+                  {% if entry.examples %}
+                    <div>
+                      {% capture exampleID %}{{ "" | unique }}{% endcapture %}
+                      <a data-toggle="collapse" href="#example{{exampleID}}">
+                        <i class="glyphicon glyphicon-chevron-right"></i>
+                        {% if entry.examples[1] %}Examples{%else%}Example{%endif%}
+                      </a>
+                      <div id="example{{exampleID}}" class="collapse">
+                        {% for example in entry.examples %}
+                          <table class="manual-example">
+                            <tr><th></th><td class="jqprogram">jq '{{example.program | escape}}'</td></tr>
+                            <tr><th>Input</th><td>{{example.input | escape}}</td></tr>
+                            {% unless example.output[0] %}
+                              <tr>
+                                <th>Output</th>
+                                <td><i>none</i></td>
+                              </tr>
+                            {% endunless %}
+                            {% for output in example.output %}
+                              <tr>
+                                {% if forloop.index == 1 %}
+                                  <th>Output</th>
+                                {% else %}
+                                  <th></th>
+                                {% endif %}
+                                <td>{{output | escape}}</td>
+                              </tr>
+                            {% endfor %}
+                          </table>
                         {% endfor %}
-
-                      </table>
-                    {% endfor %}
+                      </div>
                     </div>
-                  </div>
-                 {% endif %}
-                 </section>
+                  {% endif %}
+                </section>
               {% endfor %}
             </section>
           {% endfor %}
index 01e8b30ad372860f78477d13054826034becf327..6ba8536eb54343fe8ed8ae22d7cd2a1da2d12931 100644 (file)
@@ -1,7 +1,7 @@
-    <div class="navbar navbar-default navbar-fixed-top">
+    <div class="navbar navbar-default navbar-fixed-top" role="navigation">
       <div class="container">
         <div class="navbar-header">
-          <button aria-expanded="false" type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#nav-collapse">
+          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#nav-collapse">
             <span class="sr-only">Toggle navigation</span>
             <span class="icon-bar"></span>
             <span class="icon-bar"></span>
@@ -10,7 +10,7 @@
           <a class="navbar-brand" href="{{root}}/">jq</a>
         </div>
 
-        <div style="height: 1px;" aria-expanded="false" class="navbar-collapse collapse" id="nav-collapse">
+        <div class="navbar-collapse collapse" id="nav-collapse">
           <ul class="nav navbar-nav">
             {% for item in navigation %}
               <li {% if item.permalink == permalink %} class="active" {% endif %}>