0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

Merge pull request #9396 from twbs/docs-html-validation

add HTML5 validation of docs pages to the build
This commit is contained in:
Mark Otto 2013-08-12 21:30:57 -07:00
commit 8aecfb4e3f
7 changed files with 86 additions and 59 deletions

3
.gitignore vendored
View File

@ -33,6 +33,9 @@ nbproject
*.komodoproject *.komodoproject
.komodotools .komodotools
# grunt-html-validation
validation-staus.json
# Folders to ignore # Folders to ignore
.hg .hg
.svn .svn

View File

@ -2,6 +2,7 @@ language: node_js
node_js: node_js:
- 0.8 - 0.8
before_script: before_script:
- gem install jekyll
- npm install -g grunt-cli - npm install -g grunt-cli
env: env:
global: global:

View File

@ -102,6 +102,19 @@ module.exports = function(grunt) {
} }
}, },
jekyll: {
docs: {}
},
validation: {
options: {
reset: true,
},
files: {
src: ["_gh_pages/**/*.html"]
}
},
watch: { watch: {
src: { src: {
files: '<%= jshint.src.src %>', files: '<%= jshint.src.src %>',
@ -127,12 +140,17 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-qunit'); grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-html-validation');
grunt.loadNpmTasks('grunt-jekyll');
grunt.loadNpmTasks('grunt-recess'); grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('browserstack-runner'); grunt.loadNpmTasks('browserstack-runner');
// Docs HTML validation task
grunt.registerTask('validate-docs', ['jekyll', 'validation']);
// Test task. // Test task.
var testSubtasks = ['jshint', 'qunit']; var testSubtasks = ['jshint', 'qunit', 'validate-docs'];
// Only run BrowserStack tests under Travis // Only run BrowserStack tests under Travis
if (process.env.TRAVIS) { if (process.env.TRAVIS) {
// Only run BrowserStack tests if this is a mainline commit in twbs/bootstrap, or you have your own BrowserStack key // Only run BrowserStack tests if this is a mainline commit in twbs/bootstrap, or you have your own BrowserStack key

View File

@ -19,24 +19,25 @@ base_url: "../"
<p>Wrap the dropdown's trigger and the dropdown menu within <code>.dropdown</code>, or another element that declares <code>position: relative;</code>. Then add the menu's HTML.</p> <p>Wrap the dropdown's trigger and the dropdown menu within <code>.dropdown</code>, or another element that declares <code>position: relative;</code>. Then add the menu's HTML.</p>
<div class="bs-example"> <div class="bs-example">
<div class="dropdown clearfix"> <div class="dropdown clearfix">
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu"> <a id="dropdownMenu1" href="#" role="button" class="sr-only dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<li><a tabindex="-1" href="#">Action</a></li> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li><a tabindex="-1" href="#">Another action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li>
<li><a tabindex="-1" href="#">Something else here</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li>
<li class="divider"></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li>
<li><a tabindex="-1" href="#">Separated link</a></li> <li role="presentation" class="divider"></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li>
</ul> </ul>
</div> </div>
</div><!-- /example --> </div><!-- /example -->
{% highlight html %} {% highlight html %}
<div class="dropdown"> <div class="dropdown">
<!-- Link or button to toggle dropdown --> <!-- Link or button to toggle dropdown -->
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu"> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li><a tabindex="-1" href="#">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li>
<li><a tabindex="-1" href="#">Another action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li>
<li><a tabindex="-1" href="#">Something else here</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li>
<li class="divider"></li> <li role="presentation" class="divider"></li>
<li><a tabindex="-1" href="#">Separated link</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li>
</ul> </ul>
</div> </div>
{% endhighlight %} {% endhighlight %}
@ -53,23 +54,24 @@ base_url: "../"
<p>Add a header to label sections of actions in any dropdown menu.</p> <p>Add a header to label sections of actions in any dropdown menu.</p>
<div class="bs-example"> <div class="bs-example">
<div class="dropdown clearfix"> <div class="dropdown clearfix">
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu"> <a id="dropdownMenu2" href="#" role="button" class="sr-only dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<li class="dropdown-header">Dropdown header</li> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu2">
<li><a tabindex="-1" href="#">Action</a></li> <li role="presentation" class="dropdown-header">Dropdown header</li>
<li><a tabindex="-1" href="#">Another action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li>
<li><a tabindex="-1" href="#">Something else here</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li>
<li class="divider"></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li>
<li class="dropdown-header">Dropdown header</li> <li role="presentation" class="divider"></li>
<li><a tabindex="-1" href="#">Separated link</a></li> <li role="presentation" class="dropdown-header">Dropdown header</li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li>
</ul> </ul>
</div> </div>
</div><!-- /example --> </div><!-- /example -->
{% highlight html %} {% highlight html %}
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu"> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu2">
<li class="dropdown-header">Dropdown header</li> <li role="presentation" class="dropdown-header">Dropdown header</li>
... ...
<li class="divider"></li> <li role="presentation" class="divider"></li>
<li class="dropdown-header">Dropdown header</li> <li role="presentation" class="dropdown-header">Dropdown header</li>
... ...
</ul> </ul>
{% endhighlight %} {% endhighlight %}
@ -78,18 +80,19 @@ base_url: "../"
<p>Add <code>.disabled</code> to a <code>&lt;li&gt;</code> in the dropdown to disable the link.</p> <p>Add <code>.disabled</code> to a <code>&lt;li&gt;</code> in the dropdown to disable the link.</p>
<div class="bs-example"> <div class="bs-example">
<div class="dropdown clearfix"> <div class="dropdown clearfix">
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu"> <a id="dropdownMenu3" href="#" role="button" class="sr-only dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<li><a tabindex="-1" href="#">Regular link</a></li> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu3">
<li class="disabled"><a tabindex="-1" href="#">Disabled link</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Regular link</a></li>
<li><a tabindex="-1" href="#">Another link</a></li> <li role="presentation" class="disabled"><a role="menuitem" tabindex="-1" href="#">Disabled link</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another link</a></li>
</ul> </ul>
</div> </div>
</div><!-- /example --> </div><!-- /example -->
{% highlight html %} {% highlight html %}
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu"> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu3">
<li><a tabindex="-1" href="#">Regular link</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Regular link</a></li>
<li class="disabled"><a tabindex="-1" href="#">Disabled link</a></li> <li role="presentation" class="disabled"><a role="menuitem" tabindex="-1" href="#">Disabled link</a></li>
<li><a tabindex="-1" href="#">Another link</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another link</a></li>
</ul> </ul>
{% endhighlight %} {% endhighlight %}
</div> </div>
@ -1819,22 +1822,22 @@ body { padding-bottom: 70px; }
<div class="row"> <div class="row">
<div class="col-lg-3"> <div class="col-lg-3">
<a href="#" class="thumbnail"> <a href="#" class="thumbnail">
<img data-src="holder.js/100%x180" alt="Generic placeholder thumbnail"> <img data-src="holder.js/100%x180" alt="Generic placeholder thumbnail" src="data:image/png;base64,">
</a> </a>
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
<a href="#" class="thumbnail"> <a href="#" class="thumbnail">
<img data-src="holder.js/100%x180" alt="Generic placeholder thumbnail"> <img data-src="holder.js/100%x180" alt="Generic placeholder thumbnail" src="data:image/png;base64,">
</a> </a>
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
<a href="#" class="thumbnail"> <a href="#" class="thumbnail">
<img data-src="holder.js/100%x180" alt="Generic placeholder thumbnail"> <img data-src="holder.js/100%x180" alt="Generic placeholder thumbnail" src="data:image/png;base64,">
</a> </a>
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
<a href="#" class="thumbnail"> <a href="#" class="thumbnail">
<img data-src="holder.js/100%x180" alt="Generic placeholder thumbnail"> <img data-src="holder.js/100%x180" alt="Generic placeholder thumbnail" src="data:image/png;base64,">
</a> </a>
</div> </div>
</div> </div>
@ -1856,7 +1859,7 @@ body { padding-bottom: 70px; }
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<div class="thumbnail"> <div class="thumbnail">
<img data-src="holder.js/300x200" alt=""> <img data-src="holder.js/300x200" alt="Generic placeholder thumbnail" src="data:image/png;base64,">
<div class="caption"> <div class="caption">
<h3>Thumbnail label</h3> <h3>Thumbnail label</h3>
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
@ -1866,7 +1869,7 @@ body { padding-bottom: 70px; }
</div> </div>
<div class="col-lg-4"> <div class="col-lg-4">
<div class="thumbnail"> <div class="thumbnail">
<img data-src="holder.js/300x200" alt=""> <img data-src="holder.js/300x200" alt="Generic placeholder thumbnail" src="data:image/png;base64,">
<div class="caption"> <div class="caption">
<h3>Thumbnail label</h3> <h3>Thumbnail label</h3>
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
@ -1876,7 +1879,7 @@ body { padding-bottom: 70px; }
</div> </div>
<div class="col-lg-4"> <div class="col-lg-4">
<div class="thumbnail"> <div class="thumbnail">
<img data-src="holder.js/300x200" alt=""> <img data-src="holder.js/300x200" alt="Generic placeholder thumbnail" src="data:image/png;base64,">
<div class="caption"> <div class="caption">
<h3>Thumbnail label</h3> <h3>Thumbnail label</h3>
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
@ -1890,7 +1893,7 @@ body { padding-bottom: 70px; }
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<div class="thumbnail"> <div class="thumbnail">
<img data-src="holder.js/300x200" alt=""> <img data-src="holder.js/300x200" alt="...">
<div class="caption"> <div class="caption">
<h3>Thumbnail label</h3> <h3>Thumbnail label</h3>
<p>...</p> <p>...</p>
@ -2148,7 +2151,7 @@ body { padding-bottom: 70px; }
<div class="bs-example"> <div class="bs-example">
<div class="media"> <div class="media">
<a class="pull-left" href="#"> <a class="pull-left" href="#">
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image"> <img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image" src="data:image/png;base64,">
</a> </a>
<div class="media-body"> <div class="media-body">
<h4 class="media-heading">Media heading</h4> <h4 class="media-heading">Media heading</h4>
@ -2157,14 +2160,14 @@ body { padding-bottom: 70px; }
</div> </div>
<div class="media"> <div class="media">
<a class="pull-left" href="#"> <a class="pull-left" href="#">
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image"> <img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image" src="data:image/png;base64,">
</a> </a>
<div class="media-body"> <div class="media-body">
<h4 class="media-heading">Media heading</h4> <h4 class="media-heading">Media heading</h4>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
<div class="media"> <div class="media">
<a class="pull-left" href="#"> <a class="pull-left" href="#">
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image"> <img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image" src="data:image/png;base64,">
</a> </a>
<div class="media-body"> <div class="media-body">
<h4 class="media-heading">Media heading</h4> <h4 class="media-heading">Media heading</h4>
@ -2192,7 +2195,7 @@ body { padding-bottom: 70px; }
<ul class="media-list"> <ul class="media-list">
<li class="media"> <li class="media">
<a class="pull-left" href="#"> <a class="pull-left" href="#">
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image"> <img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image" src="data:image/png;base64,">
</a> </a>
<div class="media-body"> <div class="media-body">
<h4 class="media-heading">Media heading</h4> <h4 class="media-heading">Media heading</h4>
@ -2200,7 +2203,7 @@ body { padding-bottom: 70px; }
<!-- Nested media object --> <!-- Nested media object -->
<div class="media"> <div class="media">
<a class="pull-left" href="#"> <a class="pull-left" href="#">
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image"> <img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image" src="data:image/png;base64,">
</a> </a>
<div class="media-body"> <div class="media-body">
<h4 class="media-heading">Nested media heading</h4> <h4 class="media-heading">Nested media heading</h4>
@ -2208,7 +2211,7 @@ body { padding-bottom: 70px; }
<!-- Nested media object --> <!-- Nested media object -->
<div class="media"> <div class="media">
<a class="pull-left" href="#"> <a class="pull-left" href="#">
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image"> <img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image" src="data:image/png;base64,">
</a> </a>
<div class="media-body"> <div class="media-body">
<h4 class="media-heading">Nested media heading</h4> <h4 class="media-heading">Nested media heading</h4>
@ -2220,7 +2223,7 @@ body { padding-bottom: 70px; }
<!-- Nested media object --> <!-- Nested media object -->
<div class="media"> <div class="media">
<a class="pull-left" href="#"> <a class="pull-left" href="#">
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image"> <img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image" src="data:image/png;base64,">
</a> </a>
<div class="media-body"> <div class="media-body">
<h4 class="media-heading">Nested media heading</h4> <h4 class="media-heading">Nested media heading</h4>
@ -2231,7 +2234,7 @@ body { padding-bottom: 70px; }
</li> </li>
<li class="media"> <li class="media">
<a class="pull-right" href="#"> <a class="pull-right" href="#">
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image"> <img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image" src="data:image/png;base64,">
</a> </a>
<div class="media-body"> <div class="media-body">
<h4 class="media-heading">Media heading</h4> <h4 class="media-heading">Media heading</h4>

View File

@ -2012,9 +2012,9 @@ For example, <code>&lt;section&gt;</code> should be wrapped as inline.
<p>Keep in mind that Internet Explorer 8 lacks support for rounded corners.</p> <p>Keep in mind that Internet Explorer 8 lacks support for rounded corners.</p>
</div> </div>
<div class="bs-example bs-example-images"> <div class="bs-example bs-example-images">
<img data-src="holder.js/140x140" class="img-rounded" alt="A generic square placeholder image with rounded corners"> <img data-src="holder.js/140x140" src="data:image/png;base64," class="img-rounded" alt="A generic square placeholder image with rounded corners">
<img data-src="holder.js/140x140" class="img-circle" alt="A generic square placeholder image where only the portion within the circle circumscribed about said square is visible"> <img data-src="holder.js/140x140" src="data:image/png;base64," class="img-circle" alt="A generic square placeholder image where only the portion within the circle circumscribed about said square is visible">
<img data-src="holder.js/140x140" class="img-thumbnail" alt="A generic square placeholder image with a white border around it, making it resemble a photograph taken with an old instant camera"> <img data-src="holder.js/140x140" src="data:image/png;base64," class="img-thumbnail" alt="A generic square placeholder image with a white border around it, making it resemble a photograph taken with an old instant camera">
</div> </div>
{% highlight html %} {% highlight html %}
<img src="..." alt="..." class="img-rounded"> <img src="..." alt="..." class="img-rounded">

View File

@ -1613,13 +1613,13 @@ $('#myCollapsible').on('hidden.bs.collapse', function () {
</ol> </ol>
<div class="carousel-inner"> <div class="carousel-inner">
<div class="item active"> <div class="item active">
<img data-src="holder.js/900x500/auto/#777:#555/text:First slide" alt="First slide"> <img src="data:image/png;base64," data-src="holder.js/900x500/auto/#777:#555/text:First slide" alt="First slide">
</div> </div>
<div class="item"> <div class="item">
<img data-src="holder.js/900x500/auto/#666:#444/text:Second slide" alt="Second slide"> <img src="data:image/png;base64," data-src="holder.js/900x500/auto/#666:#444/text:Second slide" alt="Second slide">
</div> </div>
<div class="item"> <div class="item">
<img data-src="holder.js/900x500/auto/#555:#333/text:Third slide" alt="Third slide"> <img src="data:image/png;base64," data-src="holder.js/900x500/auto/#555:#333/text:Third slide" alt="Third slide">
</div> </div>
</div> </div>
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"> <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
@ -1675,21 +1675,21 @@ $('#myCollapsible').on('hidden.bs.collapse', function () {
</ol> </ol>
<div class="carousel-inner"> <div class="carousel-inner">
<div class="item active"> <div class="item active">
<img data-src="holder.js/900x500/auto/#777:#777" alt=""> <img data-src="holder.js/900x500/auto/#777:#777" src="data:image/png;base64," alt="First slide image">
<div class="carousel-caption"> <div class="carousel-caption">
<h3>First slide label</h3> <h3>First slide label</h3>
<p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p> <p>Nulla vitae elit libero, a pharetra augue mollis interdum.</p>
</div> </div>
</div> </div>
<div class="item"> <div class="item">
<img data-src="holder.js/900x500/auto/#666:#666" alt=""> <img data-src="holder.js/900x500/auto/#666:#666" src="data:image/png;base64," alt="Second slide image">
<div class="carousel-caption"> <div class="carousel-caption">
<h3>Second slide label</h3> <h3>Second slide label</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div> </div>
</div> </div>
<div class="item"> <div class="item">
<img data-src="holder.js/900x500/auto/#555:#5555" alt=""> <img data-src="holder.js/900x500/auto/#555:#5555" src="data:image/png;base64," alt="Third slide image">
<div class="carousel-caption"> <div class="carousel-caption">
<h3>Third slide label</h3> <h3>Third slide label</h3>
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p> <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p>
@ -1706,7 +1706,7 @@ $('#myCollapsible').on('hidden.bs.collapse', function () {
</div><!-- /example --> </div><!-- /example -->
{% highlight html %} {% highlight html %}
<div class="item active"> <div class="item active">
<img src="..." alt=""> <img src="..." alt="...">
<div class="carousel-caption"> <div class="carousel-caption">
<h3>...</h3> <h3>...</h3>
<p>...</p> <p>...</p>

View File

@ -25,6 +25,8 @@
, "grunt-contrib-uglify": "~0.2.2" , "grunt-contrib-uglify": "~0.2.2"
, "grunt-contrib-qunit": "~0.2.2" , "grunt-contrib-qunit": "~0.2.2"
, "grunt-contrib-watch": "~0.5.1" , "grunt-contrib-watch": "~0.5.1"
, "grunt-html-validation": "git://github.com/praveenvijayan/grunt-html-validation.git"
, "grunt-jekyll": "~0.3.8"
, "grunt-recess": "~0.3.3" , "grunt-recess": "~0.3.3"
, "browserstack-runner": "~0.0.11" , "browserstack-runner": "~0.0.11"
} }