-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#23: Refactor SASS Docs pages to be per group
- Loading branch information
1 parent
905af64
commit 9d1b65b
Showing
12 changed files
with
171 additions
and
99 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,3 +1,5 @@ | ||
/* eslint-env node, mocha */ | ||
|
||
/** | ||
* @module Test helpers | ||
* A suite of test helpers and utility methods | ||
|
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
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,36 @@ | ||
{% extends "./_sass-layout.njk" %} | ||
{% set title = groupName %} | ||
{% set breadcrumbs = [{ title: "SASS", href: "/sass/" }, { title: "Documentation", href: "/sass/docs" }, { title: title }] %} | ||
|
||
{% block sidebar %} | ||
{% include "sass/includes/partials/sidebar.njk" %} | ||
{% endblock %} | ||
|
||
{% block main %} | ||
|
||
<h1>{{ groupName }}</h1> | ||
|
||
{# Loop over the types #} | ||
{% for type, items in byType %} | ||
|
||
{# If items to be displayed in type #} | ||
{% if items.length > 0 %} | ||
<section id="{{ type }}"> | ||
<h2> | ||
{% if type == "css" %} | ||
{# Special case for CSS selectors #} | ||
Selectors | ||
{% else %} | ||
{{ type | pluralize | capitalize }} | ||
{% endif %} | ||
</h2> | ||
|
||
{# Loop over the items #} | ||
{% for item in items %} | ||
{% include "sass/includes/partials/item.njk" %} | ||
{% endfor %} | ||
</section> | ||
{% endif %} | ||
{% endfor %} | ||
|
||
{% endblock %} |
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,46 +1,42 @@ | ||
{% extends "./_sass-layout.njk" %} | ||
{% set title = "SASS Documentation" %} | ||
|
||
{% block sidebar %} | ||
{% include "sass/includes/partials/sidebar.njk" %} | ||
{% endblock %} | ||
|
||
{% set title = "Documentation" %} | ||
|
||
{% block main %} | ||
|
||
<h1>SASS Documentation</h1> | ||
|
||
{# Loop over the groups #} | ||
{% for group_name, group in byGroupAndType %} | ||
<section> | ||
<h2 id="{{ group_name }}"> | ||
{{ groups[group_name] }} | ||
</h2> | ||
|
||
{# Loop over the types #} | ||
{% for type, items in group %} | ||
|
||
{# If items to be displayed in type #} | ||
{% if items.length > 0 %} | ||
<section id="{{ group_name }}-{{ type }}"> | ||
<h3> | ||
{% if type == "css" %} | ||
{# Special case for CSS selectors #} | ||
Selectors | ||
{% else %} | ||
{{ type | pluralize | capitalize }} | ||
{% endif %} | ||
</h3> | ||
|
||
{# Loop over the items #} | ||
{% for item in items %} | ||
{% include "sass/includes/partials/item.njk" %} | ||
{% endfor %} | ||
</section> | ||
{% endif %} | ||
{% endfor %} | ||
|
||
</section> | ||
{% endfor %} | ||
<div class="grid"> | ||
{# Loop over the groups #} | ||
{% for group in groups %} | ||
<div class="grid__item one-whole tablet--one-third desktop--one-quarter"> | ||
<h2 class="h4"> | ||
<a href="/sass/docs/{{ group.id }}"> | ||
{{ group.name }} | ||
</a> | ||
</h2> | ||
<p> | ||
{% for type_name, count in group.types %} | ||
{{ count }} | ||
{% if type_name === "variable" %} | ||
variables | ||
{% elif type_name === "css" %} | ||
selectors | ||
{% elif type_name === "function" %} | ||
functions | ||
{% elif type_name === "mixin" %} | ||
mixins | ||
{% else %} | ||
others | ||
{% endif %} | ||
{% if loop.revindex0 === 1 %} | ||
& | ||
{% elif not loop.last %} | ||
, | ||
{% endif %} | ||
{% endfor %} | ||
</p> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
|
||
{% endblock %} |
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
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
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,50 +1,39 @@ | ||
{# See https://github.com/SassDoc/sassdoc-theme-default/blob/master/views/includes/partials/sidebar.html.swig #} | ||
|
||
{# Loop over the groups #} | ||
{% for group_name, group in byGroupAndType %} | ||
|
||
<h3> | ||
<a href="#{{ group_name }}"> | ||
{{ groups[group_name] }} | ||
</a> | ||
</h3> | ||
|
||
{# Loop over the types #} | ||
{% for type, items in group %} | ||
|
||
{# If items to be displayed in type #} | ||
{% if items.length > 0 %} | ||
|
||
<h4> | ||
<a href="#{{ group_name }}-{{ type }}"> | ||
{% if type == "css" %} | ||
{# Special case for CSS selectors #} | ||
Selectors | ||
{% else %} | ||
{{ type | pluralize | capitalize }} | ||
{# Loop over the types #} | ||
{% for type, items in byType %} | ||
|
||
{# If items to be displayed in type #} | ||
{% if items.length > 0 %} | ||
|
||
<h4> | ||
<a href="#{{ type }}"> | ||
{% if type == "css" %} | ||
{# Special case for CSS selectors #} | ||
Selectors | ||
{% else %} | ||
{{ type | pluralize | capitalize }} | ||
{% endif %} | ||
</a> | ||
</h4> | ||
|
||
{# Loop over the items #} | ||
{% for item in items %} | ||
{% if loop.first %}<ul>{% endif %} | ||
|
||
<li> | ||
<a href="#{{ item.context.type }}-{{ item.context.name }}"> | ||
{% if item.context.type == "variable" %}${% endif %}{{ item.context.name }} | ||
{% if item.access[0] == "private" %} | ||
<small>(private)</small> | ||
{% endif %} | ||
{% if item.property.length > 0 %} | ||
<small>(map)</small> | ||
{% endif %} | ||
</a> | ||
</h4> | ||
|
||
{# Loop over the items #} | ||
{% for item in items %} | ||
{% if loop.first %}<ul>{% endif %} | ||
|
||
<li> | ||
<a href="#{{ group_name }}-{{ item.context.type }}-{{ item.context.name }}"> | ||
{% if item.context.type == "variable" %}${% endif %}{{ item.context.name }} | ||
{% if item.access[0] == "private" %} | ||
<small>(private)</small> | ||
{% endif %} | ||
{% if item.property.length > 0 %} | ||
<small>(map)</small> | ||
{% endif %} | ||
</a> | ||
</li> | ||
|
||
{% if loop.last %}</ul>{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
{% endfor %} | ||
</li> | ||
|
||
{% if loop.last %}</ul>{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
{% endfor %} |