-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,157 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,48 @@ | ||
doctype html | ||
html(lang="en") | ||
mixin doctoc(args) | ||
mixin doctoc(args, inner) | ||
//- NOTE parameter validation | ||
- | ||
var pages = args.pages || [] | ||
var classes = args.classes || {} | ||
var depth = +args.depth || 0 | ||
ol(class=classes.listclasses) | ||
ol(class=classes.listclasses)&attributes(inner ? {} : { role: 'directory' }) | ||
each item in pages | ||
unless item.isHidden() | ||
li(class=classes.itemclasses) | ||
a(class=classes.linkclasses href=item.url())= item.name() | ||
if item.description() | ||
= ': ' + item.description() | ||
if item.findAll().length && depth > 0 | ||
+doctoc({pages: item.findAll(), classes: (classes.sub || {}), depth: depth-1}) | ||
mixin newSection(hn, page) | ||
- | ||
var text = page.name() | ||
var id = page.url().split('#')[1] | ||
li(class=classes.itemclasses) | ||
a(class=classes.linkclasses href=item.url())= item.name() | ||
if item.description() | ||
= ': ' + item.description() | ||
if item.findAll().length && depth > 0 | ||
+doctoc({pages: item.findAll(), classes: (classes.sub || {}), depth: depth-1}, true) | ||
mixin newSection(n, page) | ||
- var id = page.url().split('#')[1] | ||
section(id=id) | ||
if hn === 1 | ||
h1 #{text} #[a.docs-_fragid(href='#' + id)] | ||
else if hn === 2 | ||
h2 #{text} #[a.docs-_fragid(href='#' + id)] | ||
else if hn === 3 | ||
h3 #{text} #[a.docs-_fragid(href='#' + id)] | ||
else | ||
p #{text} | ||
| <h#{n}>#{page.name()} <a class="docs-_fragid" href="##{id}" aria-label="permalink"></a></h#{n}> | ||
block | ||
block vars | ||
head | ||
title= page.title() || (page.name() + ' | ' + Xmeter.DOCS.name()) | ||
meta(charset="utf-8") | ||
meta(name="description" content=Xmeter.DOCS.description()) | ||
meta(name="viewport" content="width=device-width, initial-scale=1") | ||
link(rel="stylesheet" href="../xmeter.css") | ||
link(rel="stylesheet" href="styles/docs.css") | ||
block styles | ||
link(rel="stylesheet" href="https://cdn.rawgit.com/chharvey/bangs/v0.9.0/bangs.min.css") | ||
link(rel="stylesheet" href="../xmeter.css") | ||
link(rel="stylesheet" href="styles/docs.css") | ||
body.docs-body | ||
main.docs-main | ||
a.h-Hidden(href="#main") skip to main content | ||
header | ||
h1= Xmeter.DOCS.name() | ||
p= Xmeter.DOCS.description() | ||
nav#sitemap | ||
h1.h-Hidden Sitemap | ||
+doctoc({pages: Xmeter.DOCS.findAll()}) | ||
main.docs-main#main | ||
block main | ||
header | ||
//- h1= page.title() || (Xmeter.DOCS.name() + ' — ' + page.name()) | ||
if page.title() | ||
h1= page.title() | ||
else | ||
h1 #[a(href=Xmeter.DOCS.url())= Xmeter.DOCS.name()] — #{page.name()} | ||
block mainIntro | ||
p= page.description() | ||
nav | ||
h2 Table of Contents | ||
block toc | ||
h1= page.name() | ||
p= page.description() | ||
block toc | ||
nav#table-contents | ||
h2 Table of Contents | ||
+doctoc({pages: page.findAll(), depth: Infinity}) | ||
block footer | ||
footer: nav | ||
h1 Sitemap | ||
+doctoc({pages: Xmeter.DOCS.findAll()}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
p. | ||
The Hidden helper visually hides an element while keeping it accessible to non-visual | ||
media such as screen readers. A #[b skip link] is a common example. | ||
figure.docs-figure | ||
a.h-Hidden(href="#0") skip to main content | ||
pre.docs-pre. | ||
<a class="#[u h-Hidden]" href="#main">skip to main content</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
var Page = require('sitepage').Page | ||
|
||
/** | ||
* A set of static members used for the site. | ||
* Similar to a utility class. | ||
* @type {Xmeter} | ||
*/ | ||
module.exports = (function () { | ||
// CONSTRUCTOR | ||
function Xmeter() {} | ||
|
||
// METHODS | ||
|
||
// STATIC MEMBERS | ||
/** | ||
* The style guide site for this project. | ||
* @type {Page} | ||
*/ | ||
Xmeter.DOCS = new Page({ name: 'Xmeter Style Guide', url: '/docs/' }) | ||
.title('Xmeter Style Guide') | ||
.description('A demo of Xmeter styles.') | ||
.add(new Page({ name: 'Home', url: 'index.html' }) | ||
.description('Xmeter Homepage') | ||
) | ||
.add(new Page({ name: 'Base Typography', url: 'base.html' }) | ||
.description('Bare, unstyled HTML elements. No classes.') | ||
.add(new Page({ name: 'Grouping Elements', url: 'base.html#grouping-elements' }) | ||
.add(new Page({ name: 'Headings & Paragraphs', url: 'base.html#headings-paragraphs' })) | ||
.add(new Page({ name: 'Lists' , url: 'base.html#lists' })) | ||
.add(new Page({ name: 'Tables' , url: 'base.html#tables' })) | ||
) | ||
.add(new Page({ name: 'Text-Level Elements', url: 'base.html#text-level-elements' }) | ||
.add(new Page({ name: 'Links' , url: 'base.html#links' })) | ||
.add(new Page({ name: 'Stress' , url: 'base.html#stress' })) | ||
.add(new Page({ name: 'Documentation', url: 'base.html#documentation' })) | ||
.add(new Page({ name: 'Data' , url: 'base.html#data' })) | ||
) | ||
.add(new Page({ name: 'Forms' , url: 'base.html#forms' })) | ||
.add(new Page({ name: 'Embedded Elements' , url: 'base.html#embedded-elements' })) | ||
.add(new Page({ name: 'Interactive Elements', url: 'base.html#interactive-elements' })) | ||
) | ||
.add(new Page({ name: 'Objects', url: 'obj.html' }) | ||
.description('Patterns of structure that can be reused many times for many different purposes.') | ||
.add(new Page({ name: 'The List Object' , url: 'obj.html#list-object' })) | ||
.add(new Page({ name: 'The Flex Object' , url: 'obj.html#flex-object' })) | ||
.add(new Page({ name: 'The Grid Object' , url: 'obj.html#grid-object' })) | ||
) | ||
.add(new Page({ name: 'Helpers', url: 'help.html' }) | ||
.description('Somewhat explicit classes used for enhancing default styles.') | ||
.add(new Page({ name: 'Block' , url: 'help.html#block' })) | ||
.add(new Page({ name: 'Inline' , url: 'help.html#inline' })) | ||
.add(new Page({ name: 'Clearfix' , url: 'help.html#clearfix' })) | ||
.add(new Page({ name: 'Hidden' , url: 'help.html#hidden' })) | ||
) | ||
.add(new Page({ name: 'Atoms', url: 'atom.html' }) | ||
.description('Very specific classes used for creating anomalies or fixing broken styles.') | ||
.add(new Page({ name: 'margin-bottom' , url: 'atom.html#margin-bottom' })) | ||
.add(new Page({ name: 'padding-top' , url: 'atom.html#padding-top' })) | ||
.add(new Page({ name: 'font-size' , url: 'atom.html#font-size' })) | ||
) | ||
|
||
return Xmeter | ||
})() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Options and locals for compiling Pug pages. | ||
module.exports = { | ||
Xmeter: require('./classes/Xmeter.class.js') | ||
Xmeter: require('./Xmeter.class.js') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.