diff --git a/CHANGELOG.md b/CHANGELOG.md
index cc4c2e9de..4537b644e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,10 @@
[segiddins](https://github.com/segiddins)
[#196](https://github.com/realm/jazzy/issues/196)
+* Cleaned up front end HTML & CSS.
+ [JP Simard](https://github.com/jpsim)
+ [#95](https://github.com/realm/jazzy/issues/188)
+
##### Bug Fixes
* None.
diff --git a/Gemfile b/Gemfile
index db6b5fe11..4b1936fde 100755
--- a/Gemfile
+++ b/Gemfile
@@ -4,7 +4,7 @@ gemspec
group :development do
# Code style
- gem 'rubocop'
+ gem 'rubocop', '0.26.1'
# Tests
gem 'bacon'
@@ -15,5 +15,5 @@ group :development do
# Integration tests
gem 'diffy'
- gem 'clintegracon'
+ gem 'clintegracon', '0.5.3'
end
diff --git a/Gemfile.lock b/Gemfile.lock
index 544d2a413..3e92192a7 100755
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -21,7 +21,7 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
- addressable (2.3.6)
+ addressable (2.3.8)
ast (2.0.0)
astrolabe (1.3.0)
parser (>= 2.2.0.pre.3, < 3.0)
@@ -30,11 +30,11 @@ GEM
clintegracon (0.5.3)
colored (~> 1.2)
diffy
- cocoapods (0.36.1)
+ cocoapods (0.36.3)
activesupport (>= 3.2.15)
claide (~> 0.8.1)
- cocoapods-core (= 0.36.1)
- cocoapods-downloader (~> 0.8.1)
+ cocoapods-core (= 0.36.3)
+ cocoapods-downloader (~> 0.9.0)
cocoapods-plugins (~> 0.4.1)
cocoapods-trunk (~> 0.6.0)
cocoapods-try (~> 0.4.3)
@@ -44,12 +44,12 @@ GEM
nap (~> 0.8)
open4 (~> 1.3)
xcodeproj (~> 0.23.1)
- cocoapods-core (0.36.1)
+ cocoapods-core (0.36.3)
activesupport (>= 3.2.15)
fuzzy_match (~> 2.0.4)
nap (~> 0.8.0)
- cocoapods-downloader (0.8.1)
- cocoapods-plugins (0.4.1)
+ cocoapods-downloader (0.9.0)
+ cocoapods-plugins (0.4.2)
nap
cocoapods-trunk (0.6.0)
nap (>= 0.8)
@@ -70,21 +70,20 @@ GEM
metaclass (~> 0.0.1)
mocha-on-bacon (0.2.2)
mocha (>= 0.13.0)
- molinillo (0.2.2)
+ molinillo (0.2.3)
mustache (0.99.8)
nap (0.8.0)
netrc (0.7.8)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
open4 (1.3.4)
- parser (2.2.0.pre.5)
+ parser (2.2.0.3)
ast (>= 1.1, < 3.0)
- slop (~> 3.4, >= 3.4.5)
powerpack (0.0.9)
prettybacon (0.0.2)
bacon (~> 1.2)
rainbow (2.0.0)
- rake (10.3.2)
+ rake (10.4.2)
redcarpet (3.2.2)
rouge (1.8.0)
rubocop (0.26.1)
@@ -93,15 +92,14 @@ GEM
powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4)
- ruby-progressbar (1.6.0)
+ ruby-progressbar (1.7.5)
safe_yaml (1.0.4)
sass (3.4.13)
- slop (3.6.0)
sqlite3 (1.3.10)
thread_safe (0.3.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)
- webmock (1.20.0)
+ webmock (1.21.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
xcodeproj (0.23.1)
@@ -114,12 +112,12 @@ PLATFORMS
DEPENDENCIES
bacon
bundler (~> 1.7)
- clintegracon
+ clintegracon (= 0.5.3)
diffy
jazzy!
mocha
mocha-on-bacon
prettybacon
rake (~> 10.3)
- rubocop
+ rubocop (= 0.26.1)
webmock
diff --git a/lib/jazzy/assets/css/jazzy.css.scss b/lib/jazzy/assets/css/jazzy.css.scss
index 410cc8f7f..0657888fc 100644
--- a/lib/jazzy/assets/css/jazzy.css.scss
+++ b/lib/jazzy/assets/css/jazzy.css.scss
@@ -1,925 +1,416 @@
+////////////////////////////////
+// Constants
+////////////////////////////////
+
+$bg_color: #414141;
$doc_coverage_color: #999;
+$code_color: #777;
+$code_bg_color: #eee;
+$link_color: #0088cc;
+$white_color: #fff;
+$light_gray_bg_color: #f2f2f2;
+$declaration_bg_color: #f9f9f9;
+$sidebar_bg_color: #f9f9f9;
+$declaration_lang_title_swift_color: #4b8afb;
+
+$sidebar_width: 230px;
$content_wrapper_width: 980px;
-$code-font: 12px Menlo, monospace;
-$graybox-border: 1px solid rgba(233, 233, 233, 1);
+$content_top_offset: 70px;
+$content_body_margin: 16px;
+$content_body_left_offset: $sidebar_width + $content_body_margin;
+$header_height: 26px;
+$breadcrumb_padding_top: 17px;
+
+$code_font: 0.95em Menlo, monospace;
+
+$gray_border: 1px solid #e2e2e2;
+$declaration_swift_border: 5px solid #cde9f4;
+
+////////////////////////////////
+// Reset
+////////////////////////////////
html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {
background: transparent;
border: 0;
- font-size: 100%;
margin: 0;
outline: 0;
padding: 0;
vertical-align: baseline;
}
-#reference {
- .declaration .Swift pre {
- // Ensure that declarations wrap, as they're a single line
- white-space: pre-wrap;
- font-size: 140%;
- }
+////////////////////////////////
+// Global
+////////////////////////////////
- .x-instance-method.Swift {
- margin-left: 15px;
- }
- .chapter {
- overflow-x: hidden;
- border-top: 0;
- border-left: 1px solid rgba(233, 233, 233, 1);
- border-right: 1px solid rgba(233, 233, 233, 1);
- border-bottom: 1px solid rgba(233, 233, 233, 1);
- }
- .nav-chapters {
- height: 100%;
- }
- .part-name {
- color: #000;
- cursor: default;
- padding: 15px 15px 15px 20px;
- min-height: 61px;
- &.tasks {
- background: #fff;
- overflow: auto;
- }
- }
- .book-parts a {
- display: initial;
- margin-left: 0;
- }
- .nav-chapters li {
- color: rgba(128, 128, 128, 1);
- margin-left: 12px;
- padding-left: 10px;
- text-indent: -10px;
- }
- .chapter-name {
- margin-top: 21px;
- }
+body {
+ background-color: $light_gray_bg_color;
+ font-family: Helvetica, freesans, Arial, sans-serif;
+ font-size: 14px;
+ -webkit-font-smoothing: subpixel-antialiased;
+ word-wrap: break-word;
}
-.rubber-band-gap {
- background: #fff;
- height: 250px;
- position: fixed;
- width: 734px;
- z-index: -1;
- top: 70px;
- margin: 0 0 0 247px;
-}
+// Headers
-#reference {
- .task-name-container {
- background: #fff;
- left: -25px;
- margin-bottom: 0;
- padding: 35px 25px 0;
- position: relative;
- width: 100%;
- }
- .section-name {
- cursor: pointer;
- display: inline-block;
- }
- .section .section {
- margin-top: 0;
- }
- .task-group-section {
- padding: 1px 25px 0;
- }
- .symbol {
- background: #fff;
- left: -25px;
- list-style-type: none;
- padding: 13px 25px 0;
- position: relative;
- width: 100%;
- }
- .task-group-term {
- font-size: 1.4em;
- word-break: break-all;
- > code {
- font: $code-font;
- display: inline-block;
- }
- }
- dl {
- border: $graybox-border;
- @extend .para;
- dt {
- float: left;
- width: 50px;
- @extend em.term;
- font-style: italic;
- text-align: right;
- padding: 7px;
- vertical-align: top;
- }
- dd {
- word-break: break-word;
- margin-left: 64px;
- padding: 7px;
- min-width: 70px;
- border-left: $graybox-border;
- }
- }
- .pointy-thing-container {
- background: #fff;
- border-bottom: 1px solid rgba(233, 233, 233, 1);
- left: -25px;
- padding-left: 25px;
- padding-right: 25px;
- padding-bottom: 13px;
- position: relative;
- width: 100%;
- }
- .pointy-thing {
- background: rgba(249, 249, 249, 1);
- border-left: 1px solid rgba(233, 233, 233, 1);
- border-top: 1px solid rgba(233, 233, 233, 1);
- height: 12px;
- left: 21px;
- top: -7px;
- -webkit-transform: rotate(45deg);
- -moz-transform: rotate(45deg);
- -o-transform: rotate(45deg);
- transform: rotate(45deg);
- position: absolute;
- width: 12px;
- }
- .height-container {
- display: none;
- left: -25px;
- padding: 0 25px;
- position: relative;
- width: 100%;
- overflow: hidden;
- .section {
- background: rgba(249, 249, 249, 1);
- border-bottom: 1px solid rgba(233, 233, 233, 1);
- left: -25px;
- margin: 0;
- padding: 13px 25px 0;
- position: relative;
- width: 100%;
- h4 {
- font-size: 13px;
- line-height: 1.5;
- margin-top: 21px;
- }
- }
- }
- .section .declaration {
- margin-top: 21px;
- code {
- font: $code-font;
- color: rgba(128, 128, 128, 1);
- margin-bottom: 15px;
- padding-bottom: 6px;
- }
- }
- .declaration div .para {
- margin-bottom: 0;
- }
- .task-group .item .graybox {
- margin: 5px 0 26px;
- }
- .symbol .graybox .para:last-of-type {
- margin-bottom: 0;
- padding-bottom: 0;
- }
- .parameters .graybox tr td:first-of-type {
- text-align: right;
- padding: 7px;
- vertical-align: top;
- word-break: normal;
- width: 40px;
- }
- em {
- &.term, &.parameter-name {
- color: rgba(65, 65, 65, 1);
- font-size: 12px;
- line-height: 1.5;
- }
- }
- .height-container .section > div:last-of-type {
- margin-bottom: 15px;
- }
- #footer {
- width: 614px;
- z-index: 1;
- }
- .item .para {
- padding-bottom: 0;
- margin: 0 0 15px;
- }
- a[name] {
- padding-top: 112px;
- margin: -112px 0 0;
- }
- .height-container td {
- max-width: inherit;
- }
- .declaration .n a {
- color: inherit;
- &:hover {
- border-bottom: 1px solid;
- }
- }
- .copyright {
- margin: 10px 0;
- }
+h1, h2, h3, h4, h5, h6 {
+ margin-top: 0.8em;
+ margin-bottom: 0.3em;
+ font-weight: 100;
+ color: #000;
}
-
-.nav-chapters {
- font-weight: 400;
- line-height: 110%;
- list-style-position: outside;
- list-style-type: none;
- margin: 0;
- padding: 8px 0 0;
- height: 100%;
- width: 200px;
- position: relative;
- top: 15px;
+h1 {
+ font-size: 2.5em;
+ border-bottom: $gray_border;
+}
+h2 {
+ font-size: 2em;
+ border-bottom: $gray_border;
+}
+h3 {
+ font-size: 1.5em;
+}
+h4 {
+ font-size: 1.25em;
+}
+h5 {
+ font-size: 1.1em;
+}
+h6 {
+ font-size: 1.1em;
+ color: $code_color;
}
-body {
- background-color: rgba(242, 242, 242, 1);
- color: #000;
- font-family: Helvetica, Arial, sans-serif;
- font-size: 62.5%;
- margin: 0 auto;
- -webkit-font-smoothing: subpixel-antialiased;
+// Code
+
+pre, code {
+ font: $code_font;
+ color: $code_color;
+ word-wrap: normal;
}
+p code, li code {
+ background-color: $code_bg_color;
+ padding: 4px;
+ border-radius: 4px;
+}
+
+// Links
-a[name] {
- display: block;
- padding-top: 85px;
- margin: -85px 0 0;
- width: 0;
- height: 0;
+a {
+ color: $link_color;
+ text-decoration: none;
}
-.content-wrapper {
- background-color: rgba(242, 242, 242, 1);
- margin: 0 auto;
- width: $content_wrapper_width;
+// Lists
+
+ul {
+ padding-left: 15px;
+}
+li {
+ line-height: 1.8em;
}
-.pixel-line {
- background: rgba(233, 233, 233, 1);
- height: 1px;
- position: fixed;
- top: 70px;
- width: 734px;
- z-index: 3;
- top: 70px;
- margin: 0 0 0 247px;
-}
-
-.chapter {
- background-color: #fff;
- border: 1px solid rgba(233, 233, 233, 1);
- border-top: 0;
- box-shadow: 0 0 1px rgba(0, 0, 0, 0.07);
- display: block;
- margin-left: 246px;
- min-height: calc(100% - 173px);
- min-height: -moz-calc(100% - 173px);
- min-height: -webkit-calc(100% - 173px);
- min-height: -o-calc(100% - 173px);
- position: absolute;
- overflow: auto;
- padding-bottom: 100px;
- top: 70px;
- -webkit-overflow-scrolling: touch;
- width: 734px;
+// Images
+
+img {
+ max-width: 100%;
}
-#hierarchial_navigation {
- float: left;
- font-size: 1.4em;
- margin-top: 29px;
- vertical-align: middle;
+// Blockquotes
+
+blockquote {
+ margin-left: 0;
+ padding: 0 10px;
+ border-left: 4px solid #ccc;
}
-.section {
- padding: 15px 25px 0px;
- .section {
- margin: 30px 0 0;
- padding: 0;
- }
+// General Content Wrapper
+
+.content-wrapper {
+ margin: 0 auto;
+ width: $content_wrapper_width;
}
+////////////////////////////////
+// Header & Top Breadcrumbs
+////////////////////////////////
+
header {
- background-color: rgba(65, 65, 65, 1);
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.07);
- color: #fff;
- height: 25px;
- letter-spacing: .05em;
+ font-size: 0.85em;
+ line-height: $header_height;
+ background-color: $bg_color;
position: fixed;
- top: 0;
width: 100%;
- z-index: 4;
-}
-
-.header-text {
- font-size: 1.1em;
- margin: 0 auto;
- padding-top: 6px;
- vertical-align: middle;
- float: left;
- color: $doc_coverage_color;
+ z-index: 1;
+ img {
+ padding-right: 6px;
+ vertical-align: -4px;
+ height: 16px;
+ }
a {
- color: #fff;
- text-decoration: none;
+ color: $white_color;
+ }
+ p {
+ float: left;
+ color: $doc_coverage_color;
+ }
+ .header-right {
+ float: right;
+ margin-left: 16px;
}
}
-#header-icon {
- padding-right: 8px;
- vertical-align: -3px;
-}
-
-#header-links a {
- float: right;
- padding-top: 4px;
- padding-left: 16px;
- font-size: 1.1em;
- vertical-align: middle;
- margin: 0 auto;
- color: #fff;
- text-decoration: none;
-}
-
-#valence {
- background-color: rgba(242, 242, 242, 1);
- display: block;
- height: 60px;
- padding-top: 10px;
+#breadcrumbs {
+ background-color: $light_gray_bg_color;
+ height: $content_top_offset - $header_height - $breadcrumb_padding_top;
+ padding-top: $breadcrumb_padding_top;
position: fixed;
- top: 0;
width: 100%;
- z-index: 3;
+ z-index: 1;
+ margin-top: $header_height;
+ #carat {
+ height: 10px;
+ margin: 0 5px;
+ }
}
-#carat {
- margin: 0 10px;
-}
+////////////////////////////////
+// Side Navigation
+////////////////////////////////
-#design_resources_link {
- color: rgba(0, 136, 204, 1);
- text-decoration: none;
+.sidebar {
+ background-color: $sidebar_bg_color;
+ border: $gray_border;
+ overflow-y: auto;
+ overflow-x: hidden;
+ position: fixed;
+ top: $content_top_offset;
+ bottom: 0;
+ width: $sidebar_width;
+ word-wrap: normal;
}
-.para {
- color: rgba(65, 65, 65, 1);
- font-size: 1.4em;
- line-height: 145%;
- margin-bottom: 15px;
+.nav-groups {
+ list-style-type: none;
+ background: $white_color;
+ padding-left: 0;
}
-.chapter-name {
- color: rgba(0, 0, 0, 1);
- display: block;
- font-family: Helvetica;
- font-size: 2.8em;
+.nav-group-name {
+ border-bottom: $gray_border;
+ font-size: 1.1em;
font-weight: 100;
- margin-bottom: 0;
- padding: 15px 25px;
- width: 63%;
- margin-top: 21px;
+ padding: 15px 0 15px 20px;
+ > a {
+ color: #333;
+ }
}
-.chapter a {
- color: rgba(0, 136, 204, 1);
- text-decoration: none;
+.nav-group-tasks {
+ margin-top: 5px;
}
-h3.section-name:before {
- display: block;
- content: " ";
- margin-top: -85px;
- height: 85px;
- visibility: hidden;
+.nav-group-task {
+ font-size: 0.9em;
+ list-style-type: none;
+ a {
+ color: #888;
+ }
}
-.section-name {
- color: rgba(128, 128, 128, 1);
- display: block;
- font-family: Helvetica;
- font-size: 2.2em;
- font-weight: 100;
- margin-bottom: 15px;
-}
+////////////////////////////////
+// Main Content
+////////////////////////////////
-.copyright {
- clear: both;
- color: rgba(160, 160, 160, 1);
- float: none;
- margin: 70px 25px 10px 0;
+.main-content {
+ background-color: $white_color;
+ border: $gray_border;
+ margin-left: $content_body_left_offset;
+ position: absolute;
+ overflow: hidden;
+ padding-bottom: 60px;
+ top: $content_top_offset;
+ width: $content_wrapper_width - $content_body_left_offset;
+ p, a, code, em, ul, table, blockquote {
+ margin-bottom: 1em;
+ }
+ p {
+ line-height: 1.8em;
+ }
+ section .section :first-child {
+ margin-top: 0;
+ }
}
-.link {
- color: rgba(0, 136, 204, 1);
- text-decoration: none;
+.section {
+ padding: 25px 25px 0;
}
-.item p {
- margin: 0;
- padding-bottom: 6px;
+.highlight {
+ background-color: $code_bg_color;
+ padding: 7px;
+ border: $gray_border;
+ border-radius: 4px;
+ overflow-x: scroll;
}
-.book-parts {
- background-color: rgba(249, 249, 249, 1);
- border-top: 1px solid rgba(233, 233, 233, 1);
- border-left: 1px solid rgba(233, 233, 233, 1);
- border-right: 1px solid rgba(233, 233, 233, 1);
- bottom: 0;
- box-shadow: 0 0 1px rgba(0, 0, 0, 0.07);
- overflow: auto;
- -webkit-overflow-scrolling: touch;
- position: fixed;
- top: 70px;
- width: 230px;
+.aside-title {
+ font-size: 9px;
+ letter-spacing: 2px;
+ text-transform: uppercase;
+ padding-bottom: 0;
}
-.nav-parts {
- color: rgba(128, 128, 128, 1);
- font-weight: 100;
- line-height: 140%;
- list-style-type: none;
- margin: 0;
- -webkit-padding-start: 0;
+.declaration .highlight {
+ overflow-x: scroll;
+ padding: 0 40px 40px 0;
+ margin-bottom: -25px;
+ background-color: transparent;
+ border: none;
}
-.part-name {
- border-bottom: 1px solid rgba(233, 233, 233, 1);
- font-family: Helvetica;
- font-size: 1.6em;
- line-height: 150%;
- list-style-type: none;
+.section-name {
margin: 0;
- padding: 15px 30px 15px 20px;
- cursor: pointer;
+ margin-left: 18px;
}
-.nav-chapters {
- font-weight: 400;
- line-height: 110%;
- list-style-position: outside;
- list-style-type: none;
- margin: 0;
- margin-bottom: 10px;
- padding: 0;
- height: 0;
- overflow: hidden;
- -webkit-transition: height .3s ease-in-out;
- -moz-transition: height .3s ease-in-out;
- -o-transition: height .3s ease-in-out;
- -ms-transition: height .3s ease-in-out;
- transition: height .3s ease-in-out;
+.task-group-section {
+ padding-left: 6px;
+ border-top: $gray_border;
}
-.nav-chapter {
- font-size: .8em;
- list-style-position: outside;
- list-style-type: none;
- margin: 0;
- padding: 0 0 8px;
+.task-group {
+ padding-top: 10px;
}
-.nav-chapters .nav-chapter {
- margin-left: 0;
+.item {
+ padding-top: 8px;
+ width: 100%;
+ list-style-type: none;
+ code {
+ background-color: transparent;
+ padding: 0;
+ }
+ .token {
+ padding-left: 3px;
+ margin-left: 15px;
+ }
}
-.book-parts a {
- color: rgba(128, 128, 128, 1);
- display: block;
- text-decoration: none;
- margin-left: 24px;
+.pointer-container {
+ border-bottom: $gray_border;
+ left: -23px;
+ padding-bottom: 13px;
+ position: relative;
+ width: 110%;
+}
+
+.pointer {
+ background: $declaration_bg_color;
+ border-left: $gray_border;
+ border-top: $gray_border;
+ height: 12px;
+ left: 21px;
+ top: -7px;
+ -webkit-transform: rotate(45deg);
+ -moz-transform: rotate(45deg);
+ -o-transform: rotate(45deg);
+ transform: rotate(45deg);
+ position: absolute;
+ width: 12px;
}
-.aside-title {
- color: rgba(128, 128, 128, 1);
- font-size: 9px;
- letter-spacing: 2px;
- margin-bottom: 8px;
- text-transform: uppercase;
+.height-container {
+ display: none;
+ left: -25px;
+ padding: 0 25px;
+ position: relative;
+ width: 100%;
+ overflow: hidden;
+ .section {
+ background: $declaration_bg_color;
+ border-bottom: $gray_border;
+ left: -25px;
+ position: relative;
+ width: 100%;
+ padding-top: 10px;
+ padding-bottom: 5px;
+ }
}
div.Swift {
padding: 4px 0 2px 10px;
- margin: 10px 0 21px;
- border-left: 5px solid rgba(205, 233, 244, 1);
+ margin-bottom: 1em;
+ border-left: $declaration_swift_border;
+ overflow-y: hidden;
.aside-title {
- color: rgba(75, 138, 251, 1);
+ color: $declaration_lang_title_swift_color;
-webkit-user-select: none;
}
}
-#footer {
- font-size: 1.1em;
- bottom: 0;
- color: rgba(0, 136, 204, 1);
- margin: 0 25px;
- position: absolute;
- width: 684px;
-}
-
.graybox {
- border: $graybox-border;
border-collapse: collapse;
- border-spacing: 0;
- empty-cells: hide;
- margin: 20px 0 36px;
- text-align: left;
width: 100%;
p {
margin: 0;
word-break: break-word;
min-width: 50px;
}
+ td {
+ border: $gray_border;
+ padding: 5px 25px 5px 10px;
+ vertical-align: middle;
+ }
+ tr td:first-of-type {
+ text-align: right;
+ padding: 7px;
+ vertical-align: top;
+ word-break: normal;
+ width: 40px;
+ }
}
-td {
- border: 1px solid rgba(233, 233, 233, 1);
- padding: 5px 25px 5px 10px;
- margin: 0;
- vertical-align: middle;
- max-width: 260px;
-}
-
-#reference .rubber-band-gap {
- background: #fff;
- height: 250px;
- position: fixed;
- width: 734px;
- z-index: -1;
+.slightly-smaller {
+ font-size: 0.9em;
}
-.readme {
- -ms-text-size-adjust: 100%;
- -webkit-text-size-adjust: 100%;
- color: rgba(65, 65, 65, 1);
- overflow: hidden;
- font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
- font-size: 16px;
- line-height: 1.6;
- word-wrap: break-word;
- a {
- background: transparent;
- &:active,
- &:hover {
- outline: 0;
- }
- }
- strong {
- font-weight: bold;
- }
- h1 {
- font-size: 2em;
- margin: 0.67em 0;
- }
- img {
- border: 0;
- }
- hr {
- -moz-box-sizing: content-box;
- box-sizing: content-box;
- height: 0;
- }
- pre {
- overflow: auto;
- }
- code,
- kbd,
- pre {
- font-family: monospace, monospace;
- font-size: 1em;
- }
- table {
- border-collapse: collapse;
- border-spacing: 0;
- }
- td,
- th {
- padding: 0;
- }
- * {
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
- a {
- color: #4183c4;
- text-decoration: none;
- &:hover,
- &:focus,
- &:active {
- text-decoration: underline;
- }
- }
- hr {
- height: 0;
- margin: 15px 0;
- overflow: hidden;
- background: transparent;
- border: 0;
- border-bottom: 1px solid #ddd;
- &:before {
- display: table;
- content: "";
- }
- &:after {
- display: table;
- clear: both;
- content: "";
- }
- }
- h1,
- h2,
- h3,
- h4,
- h5,
- h6 {
- margin-top: 15px;
- margin-bottom: 15px;
- line-height: 1.1;
- }
- h1 {
- font-size: 30px;
- }
- h2 {
- font-size: 21px;
- }
- h3 {
- font-size: 16px;
- }
- h4 {
- font-size: 14px;
- }
- h5 {
- font-size: 12px;
- }
- h6 {
- font-size: 11px;
- }
- blockquote {
- margin: 0;
- }
- ul,
- ol {
- padding: 0;
- margin-top: 0;
- margin-bottom: 0;
- }
- ol ol,
- ul ol {
- list-style-type: lower-roman;
- }
- ul ul ol,
- ul ol ol,
- ol ul ol,
- ol ol ol {
- list-style-type: lower-alpha;
- }
- dd {
- margin-left: 0;
- }
- code {
- font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
- }
- pre {
- margin-top: 0;
- margin-bottom: 0;
- font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
- }
- & > *:first-child {
- margin-top: 0 !important;
- }
- & > *:last-child {
- margin-bottom: 0 !important;
- }
- h1,
- h2,
- h3,
- h4,
- h5,
- h6 {
- position: relative;
- margin-top: 1em;
- margin-bottom: 16px;
- font-weight: bold;
- line-height: 1.4;
- }
- h1 {
- padding-bottom: 0.3em;
- font-size: 2.25em;
- line-height: 1.2;
- border-bottom: 1px solid #eee;
- }
- h2 {
- padding-bottom: 0.3em;
- font-size: 1.75em;
- line-height: 1.225;
- border-bottom: 1px solid #eee;
- }
- h3 {
- font-size: 1.5em;
- line-height: 1.43;
- }
- h4 {
- font-size: 1.25em;
- }
- h5 {
- font-size: 1em;
- }
- h6 {
- font-size: 1em;
- color: #777;
- }
- p,
- blockquote,
- ul,
- ol,
- dl,
- table,
- pre {
- margin-top: 0;
- margin-bottom: 16px;
- }
- hr {
- height: 4px;
- padding: 0;
- margin: 16px 0;
- background-color: #e7e7e7;
- border: 0 none;
- }
- ul,
- ol {
- padding-left: 2em;
- }
- ul ul,
- ul ol,
- ol ol,
- ol ul {
- margin-top: 0;
- margin-bottom: 0;
- }
- li > p {
- margin-top: 16px;
- }
- dl {
- padding: 0;
- dt {
- padding: 0;
- margin-top: 16px;
- font-size: 1em;
- font-style: italic;
- font-weight: bold;
- }
- dd {
- padding: 0 16px;
- margin-bottom: 16px;
- }
- }
- blockquote {
- padding: 0 15px;
- color: #777;
- border-left: 4px solid #ddd;
- & > :first-child {
- margin-top: 0;
- }
- & > :last-child {
- margin-bottom: 0;
- }
- }
- table {
- display: block;
- width: 100%;
- overflow: auto;
- word-break: normal;
- word-break: keep-all;
- th {
- font-weight: bold;
- }
- th, td {
- padding: 6px 13px;
- border: 1px solid #ddd;
- }
- tr {
- background-color: #fff;
- border-top: 1px solid #ccc;
- &:nth-child(2n) {
- background-color: #f8f8f8;
- }
- }
- }
- img {
- max-width: 100%;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
- code {
- padding: 0;
- padding-top: 0.2em;
- padding-bottom: 0.2em;
- margin: 0;
- font-size: 85%;
- background-color: rgba(0, 0, 0, 0.04);
- border-radius: 3px;
- &:after,
- &:before {
- letter-spacing: -0.2em;
- content: "\00a0";
- }
- }
- pre > code {
- padding: 0;
+#footer {
+ position: absolute;
+ bottom: 10px;
+ margin-left: 25px;
+ p {
margin: 0;
- font-size: 100%;
- word-break: normal;
- white-space: pre;
- background: transparent;
- border: 0;
- }
- .highlight {
- margin-bottom: 16px;
- }
- .highlight pre,
- pre {
- padding: 16px;
- overflow: auto;
- font-size: 85%;
- line-height: 1.45;
- background-color: #f7f7f7;
- border-radius: 3px;
- }
- .highlight pre {
- margin-bottom: 0;
- word-break: normal;
- }
- pre {
- word-wrap: normal;
- code {
- display: inline;
- max-width: initial;
- padding: 0;
- margin: 0;
- overflow: initial;
- line-height: inherit;
- word-wrap: normal;
- background-color: transparent;
- border: 0;
- &:before,
- &:after {
- content: normal;
- }
- }
+ color: #aaa;
+ font-size: 0.8em;
}
}
+////////////////////////////////
+// Dash
+////////////////////////////////
+
html.dash {
- body {
- font-size: 65%;
- }
- a.Swift {
- font-size: 110%;
- }
- .book-parts {
+ header, #breadcrumbs, .sidebar {
display: none;
- width: 0;
}
- .chapter {
+ .main-content {
width: $content_wrapper_width;
margin-left: 0;
+ border: none;
+ width: auto;
+ top: 0;
+ padding-bottom: 0;
}
- #reference {
- .height-container {
- display: block;
- }
- .x-instance-method {
- margin-left: 0;
- }
+ .height-container {
+ display: block;
}
- header, section#valence, .pixel-line, .rubber-band-gap {
- display: none;
+ .item .token {
+ margin-left: 0;
}
.content-wrapper {
width: auto;
}
- .chapter {
- border: none;
- width: auto;
- position: static;
- padding-bottom: 50px;
- box-shadow: none;
- }
- #reference .chapter {
- border: none;
- box-shadow: none;
- }
#footer {
position: static;
}
diff --git a/lib/jazzy/assets/js/jazzy.js b/lib/jazzy/assets/js/jazzy.js
index b937c3b2c..a32d4008f 100755
--- a/lib/jazzy/assets/js/jazzy.js
+++ b/lib/jazzy/assets/js/jazzy.js
@@ -1,3 +1,13 @@
+window.jazzy = {'docset': false}
+if (typeof window.dash != 'undefined') {
+ document.documentElement.className += ' dash'
+ window.jazzy.docset = true
+}
+if (navigator.userAgent.match(/xcode/i)) {
+ document.documentElement.className += ' xcode'
+ window.jazzy.docset = true
+}
+
// On doc load, toggle the URL hash discussion if present
$(document).ready(function() {
if (!window.jazzy.docset) {
@@ -6,8 +16,8 @@ $(document).ready(function() {
}
});
-// On x-instance-method click, toggle its discussion and animate token.marginLeft
-$(".x-instance-method").click(function() {
+// On token click, toggle its discussion and animate token.marginLeft
+$(".token").click(function() {
if (window.jazzy.docset) {
return;
}
diff --git a/lib/jazzy/config.rb b/lib/jazzy/config.rb
index 62c9f8e5a..47c200d43 100644
--- a/lib/jazzy/config.rb
+++ b/lib/jazzy/config.rb
@@ -107,7 +107,7 @@ def self.parse!
end
opt.on('-s', '--sourcekitten-sourcefile FILEPATH',
- 'XML doc file generated from sourcekitten to parse') do |s|
+ 'File generated from sourcekitten output to parse') do |s|
config.sourcekitten_sourcefile = Pathname(s)
end
diff --git a/lib/jazzy/doc.mustache b/lib/jazzy/doc.mustache
index 62627a446..843ec685f 100755
--- a/lib/jazzy/doc.mustache
+++ b/lib/jazzy/doc.mustache
@@ -5,54 +5,28 @@
-
-
+
{{#dash_type}}
{{/dash_type}}
-
-
-
-
+ {{> jazzy/partials/header}}
+
+
{{module_name}} Reference
-
+
{{name}} {{kind}} Reference
-
-
-
+
+
{{> jazzy/partials/nav}}
-
-
-
-
- {{name}}
+
+ {{^hide_name}}{{name}}
{{/hide_name}}
{{{overview}}}
{{> jazzy/partials/tasks}}
diff --git a/lib/jazzy/doc_builder.rb b/lib/jazzy/doc_builder.rb
index 3572ee2f8..f557921f1 100644
--- a/lib/jazzy/doc_builder.rb
+++ b/lib/jazzy/doc_builder.rb
@@ -30,16 +30,14 @@ def self.prepare_output_dir(output_dir, clean)
# @return [Array] doc structure comprised of
# section names & child names & URLs
def self.doc_structure_for_docs(docs)
- structure = []
- docs.each do |doc|
- structure << {
+ docs.map do |doc|
+ {
section: doc.name,
children: doc.children.sort_by(&:name).map do |child|
{ name: child.name, url: child.url }
end,
}
end
- structure
end
# Build documentation from the given options
@@ -192,6 +190,7 @@ def self.document_index(source_module, path_to_root)
doc[:github_url] = source_module.github_url.to_s
doc[:dash_url] = source_module.dash_url
doc[:path_to_root] = path_to_root
+ doc[:hide_name] = true
doc.render
end
diff --git a/lib/jazzy/jazzy_markdown.rb b/lib/jazzy/jazzy_markdown.rb
index d1b761b90..2a1b3d914 100755
--- a/lib/jazzy/jazzy_markdown.rb
+++ b/lib/jazzy/jazzy_markdown.rb
@@ -7,10 +7,6 @@ class JazzyHTML < Redcarpet::Render::HTML
include Redcarpet::Render::SmartyPants
include Rouge::Plugins::Redcarpet
- def paragraph(text)
- "#{text}
"
- end
-
def header(text, header_level)
text_slug = text.gsub(/[^a-zA-Z0-9]+/, '_')
.downcase
diff --git a/lib/jazzy/partials/footer.mustache b/lib/jazzy/partials/footer.mustache
index d5da67f40..4f4d32702 100755
--- a/lib/jazzy/partials/footer.mustache
+++ b/lib/jazzy/partials/footer.mustache
@@ -1,4 +1,4 @@
diff --git a/lib/jazzy/partials/header.mustache b/lib/jazzy/partials/header.mustache
new file mode 100644
index 000000000..9d750a7f3
--- /dev/null
+++ b/lib/jazzy/partials/header.mustache
@@ -0,0 +1,11 @@
+
diff --git a/lib/jazzy/partials/nav.mustache b/lib/jazzy/partials/nav.mustache
index e030dd514..5254df39e 100755
--- a/lib/jazzy/partials/nav.mustache
+++ b/lib/jazzy/partials/nav.mustache
@@ -1,11 +1,11 @@
-