Skip to content
The tool implement the creating an html5 outlines algorithm
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
js
test
.gitignore
.gitmodules
README.textile
package.json
version
watchr.me

README.textile

HTML5 Outlines

HTML5 introduces a new outline algorithm. Some elements (header, footer, section, article, nav and aside) are used to divide a document into sections. Titles of sections are set with <H1> header elements nested inside sectioning elements. Working with HTML5 documents it’s sometimes important to check how a browser translates the markup to a document outline. You can use this tool to tell you whether your html is the well-titled structure or not.

Instructions

For use in browser

Just load the script onto a server of your choice and add a bookmarklet with the following code:

javascript:(function(){var s = document.createElement('script'),head = document.getElementsByTagName('head')[0];head.appendChild(s);s.src='https://raw.github.com/mashihua/outlines/master/js/bookmarklet.js';}());

For use in Node.js

git clone https://mashihua@github.com/mashihua/outlines.git
npm link
var HTML5 = require(‘html5’),
    jsdom = require(‘jsdom’);
    window = jsdom.jsdom(null, null, {parser: HTML5}).createWindow(),
    parser = new HTML5.Parser({document: window.document}),
    outlines;
parser.parse('&lt;body&gt;Foo&lt;/body&gt;');

For testing

git clone https://mashihua@github.com/mashihua/outlines.git
cd outlines
git submodule update --init --recursive
node test/spec.js test/spec/outlines_spec.js
Something went wrong with that request. Please try again.