diff options
-rw-r--r-- | 03-lexical-syntax.md | 32 | ||||
-rw-r--r-- | 04-identifiers-names-and-scopes.md | 3 | ||||
-rw-r--r-- | 05-types.md | 21 | ||||
-rw-r--r-- | 06-basic-declarations-and-definitions.md | 3 | ||||
-rw-r--r-- | 07-classes-and-objects.md | 7 | ||||
-rw-r--r-- | 08-expressions.md | 5 | ||||
-rw-r--r-- | 09-implicit-parameters-and-views.md | 5 | ||||
-rw-r--r-- | 10-pattern-matching.md | 3 | ||||
-rw-r--r-- | 11-top-level-definitions.md | 1 | ||||
-rw-r--r-- | 12-xml-expressions-and-patterns.md | 1 | ||||
-rw-r--r-- | 13-user-defined-annotations.md | 1 | ||||
-rw-r--r-- | 14-the-scala-standard-library.md | 3 | ||||
-rw-r--r-- | 15-syntax-summary.md | 1 | ||||
-rw-r--r-- | 16-references.md | 1 | ||||
-rw-r--r-- | _includes/numbering.css | 56 | ||||
-rw-r--r-- | _layouts/default.yml | 306 | ||||
-rw-r--r-- | resources/github.css | 349 |
17 files changed, 468 insertions, 330 deletions
diff --git a/03-lexical-syntax.md b/03-lexical-syntax.md index a64877e0ee..503445da3f 100644 --- a/03-lexical-syntax.md +++ b/03-lexical-syntax.md @@ -1,7 +1,7 @@ --- title: Lexical Syntax layout: default -tag: lexical +chapter: 1 --- # Lexical Syntax @@ -100,7 +100,7 @@ _ : = => <- <: <% >: # @ The Unicode operators `\u21D2 $\Rightarrow$` and `\u2190 $\leftarrow$`, which have the ASCII equivalents `=>` and `<-`, are also reserved. -###### Example: here are some identifiers: +### Example: ``` x Object maxIndex p2p empty_? @@ -108,7 +108,7 @@ equivalents `=>` and `<-`, are also reserved. __system _MAX_LEN_ ``` -###### Example: backquote-enclosed strings +### Example: When one needs to access Java identifiers that are reserved words in Scala, use backquote-enclosed strings. For instance, the statement `Thread.yield()` is illegal, since `yield` is a reserved word in Scala. However, here's a @@ -207,7 +207,7 @@ A single new line token is accepted - in front of a [parameter clause](06-basic-declarations-and-definitions.html#function-declarations-and-definitions), and - after an [annotation](13-user-defined-annotations.html#user-defined-annotations). -###### Example: four well-formed statements, each on two lines +### Example: The newline tokens between the two lines are not treated as statement separators. @@ -226,7 +226,7 @@ type IntList = List[Int] ``` -###### Example: an anonymous class +### Example: ``` new Iterator[Int] @@ -250,7 +250,7 @@ new Iterator[Int] } ``` -###### Example: a single expression +### Example: ``` x < 0 || @@ -266,7 +266,7 @@ two expressions: x > 10 ``` -###### Example: a single, curried function definition +### Example: ``` def func(x: Int) @@ -282,7 +282,7 @@ def func(x: Int) (y: Int) = x + y ``` -###### Example: an attributed definition +### Example: ``` @serializable @@ -356,7 +356,7 @@ is _pt_. The numeric ranges given by these types are: |`Char` | $0$ to $2^{16}-1$ | -###### Example: some integer literals +### Example: ``` 0 21 0xFFFFFFFF -42L @@ -385,18 +385,18 @@ If a floating point literal in a program is followed by a token starting with a letter, there must be at least one intervening whitespace character between the two tokens. -###### Example: some floating point literals +### Example: ``` 0.0 1e30f 3.14159f 1.0e-100 .1 ``` -###### Example: tokenizing +### Example: The phrase `1.toString` parses as three different tokens: the integer literal `1`, a `.`, and the identifier `toString`. -###### Example: invalid floating point literal +### Example: `1.` is not a valid floating point literal because the mandatory digit after the `.` is missing. @@ -420,7 +420,7 @@ A character literal is a single character enclosed in quotes. The character is either a printable unicode character or is described by an [escape sequence](#escape-sequences). -###### Example: some character literals +### Example: ``` 'a' '\u0041' '\n' '\t' @@ -447,7 +447,7 @@ contains a double quote character, it must be escaped, i.e. `"\""`. The value of a string literal is an instance of class `String`. -###### Example: some string literals +### Example: ``` "Hello,\nWorld!" @@ -469,7 +469,7 @@ must not necessarily be printable; newlines or other control characters are also permitted. Unicode escapes work as everywhere else, but none of the escape sequences [here](#escape-sequences) are interpreted. -###### Example: a multi-line string literal: +### Example: ``` """the present string @@ -600,7 +600,7 @@ The scanner switches from XML mode to Scala mode if either Note that no Scala tokens are constructed in XML mode, and that comments are interpreted as text. -###### Example: XML literals +### Example: The following value definition uses an XML literal with two embedded Scala expressions: diff --git a/04-identifiers-names-and-scopes.md b/04-identifiers-names-and-scopes.md index a9985d1340..96b4f283e9 100644 --- a/04-identifiers-names-and-scopes.md +++ b/04-identifiers-names-and-scopes.md @@ -1,6 +1,7 @@ --- title: Identifiers, Names and Scopes layout: default +chapter: 2 --- # Identifiers, Names and Scopes @@ -70,7 +71,7 @@ namespace as the identifier. It is an error if $T$ is not a [value type](05-type The type of $e.x$ is the member type of the referenced entity in $T$. -###### Example: bindings +### Example: Assume the following two definitions of a objects named `X` in packages `P` and `Q`. diff --git a/05-types.md b/05-types.md index b54e9b983b..c2996ddb4b 100644 --- a/05-types.md +++ b/05-types.md @@ -1,6 +1,7 @@ --- title: Types layout: default +chapter: 3 --- # Types @@ -148,7 +149,7 @@ A qualified type designator has the form `p.t` where `p` is a [path](#paths) and _t_ is a type name. Such a type designator is equivalent to the type projection `p.type#t`. -###### Example: fully qualified type designators +### Example: Some type designators and their expansions are listed below. We assume a local type parameter $t$, a value `maintable` @@ -181,7 +182,7 @@ well-formed if each actual type parameter _conforms to its bounds_, i.e. $\sigma L_i <: T_i <: \sigma U_i$ where $\sigma$ is the substitution $[ a_1 := T_1 , \ldots , a_n := T_n ]$. -###### Example: parameterized types +### Example: Given the partial type definitions: ``` @@ -205,7 +206,7 @@ F[List, Int] G[S, String] ``` -###### Example: ill-formed types +### Example: Given the [above type definitions](example-parameterized-types), the following types are ill-formed: @@ -261,7 +262,7 @@ An annotated type $T$ `$a_1 , \ldots , a_n$` attaches [annotations](13-user-defined-annotations.html#user-defined-annotations) $a_1 , \ldots , a_n$ to the type $T$. -###### Example: annotated type +### Example: The following type adds the `@suspendable` annotation to the type `String`: @@ -309,7 +310,7 @@ A compound type may also consist of just a refinement `{ $R$ }` with no preceding component types. Such a type is equivalent to `AnyRef{ R }`. -###### Example: structural refinement in a method's parameter type +### Example: The following example shows how to declare and use a method which a parameter type that contains a refinement with structural declarations. @@ -509,7 +510,7 @@ or [tuple types](#tuple-types). Their expansion is then the expansion in the equivalent parameterized type. -###### Example: existential types +### Example: Assume the class definitions @@ -533,7 +534,7 @@ An alternative formulation of the first type above using wildcard syntax is: Ref[_ <: java.lang.Number] ``` -###### Example: abbreviating an existential type with the underscore +### Example: The type `List[List[_]]` is equivalent to the existential type @@ -541,7 +542,7 @@ The type `List[List[_]]` is equivalent to the existential type List[List[t] forSome { type t }] . ``` -###### Example: existential type equivalence +### Example: Assume a covariant type @@ -670,7 +671,7 @@ same name, we model An overloaded type consisting of type alternatives $T_1 \commadots T_n (n \geq 2)$ is denoted internally $T_1 \overload \ldots \overload T_n$. -###### Example: The definitions +### Example: ``` def println: Unit def println(s: String): Unit = $\ldots$ @@ -688,7 +689,7 @@ println: => Unit $\overload$ [A] (A) (A => String) Unit ``` -###### Example: The definitions +### Example: ``` def f(x: T): T = $\ldots$ val f = 0 diff --git a/06-basic-declarations-and-definitions.md b/06-basic-declarations-and-definitions.md index 0d00857366..4507dab63f 100644 --- a/06-basic-declarations-and-definitions.md +++ b/06-basic-declarations-and-definitions.md @@ -1,6 +1,7 @@ --- title: Basic Declarations and Definitions layout: default +chapter: 4 --- # Basic Declarations and Definitions @@ -573,7 +574,7 @@ abstract class Sequence[+A] { } ``` -###### Example: Here is a case where a contravariant type parameter is useful. +### Example: ``` abstract class OutputChannel[-A] { diff --git a/07-classes-and-objects.md b/07-classes-and-objects.md index 84c1ca82b1..d16be19586 100644 --- a/07-classes-and-objects.md +++ b/07-classes-and-objects.md @@ -1,6 +1,7 @@ --- title: Classes and Objects layout: default +chapter: 5 --- # Classes and Objects @@ -377,7 +378,7 @@ it is possible to add new defaults (if the corresponding parameter in the superclass does not have a default) or to override the defaults of the superclass (otherwise). -###### Example: compound types +### Example: Consider the definitions: @@ -759,7 +760,7 @@ which when applied to parameters conforming to types $\mathit{ps}$ initializes instances of type `$c$[$\mathit{tps}\,$]` by evaluating the template $t$. -###### Example: private constructor +### Example: The following example illustrates `val` and `var` parameters of a class `C`: ``` @@ -1009,7 +1010,7 @@ it is not statically known at the time the trait is defined. If $D$ is not a trait, then its actual supertype is simply its least proper supertype (which is statically known). -###### Example: `Comparable` +### Example: The following trait defines the property of being comparable to objects of some type. It contains an abstract method `<` and default implementations of the other diff --git a/08-expressions.md b/08-expressions.md index 4f3d6a4636..1c72e4734e 100644 --- a/08-expressions.md +++ b/08-expressions.md @@ -1,6 +1,7 @@ --- title: Expressions layout: default +chapter: 6 --- # Expressions @@ -209,7 +210,7 @@ to the type or method of $x$ in the parent trait of $C$ whose simple name is $T$. That member must be uniquely defined. If it is a method, it must be concrete. -###### Example: `super` +### Example: Consider the following class definitions ``` @@ -824,7 +825,7 @@ Here are some assignment expressions and their equivalent expansions. `x.f(i, j) = e` x.f.update(i, j, e) -------------------------- --------------------- -###### Example: imperative matrix multiplication +### Example: Here is the usual imperative code for matrix multiplication. diff --git a/09-implicit-parameters-and-views.md b/09-implicit-parameters-and-views.md index b55109636a..8cd54897c9 100644 --- a/09-implicit-parameters-and-views.md +++ b/09-implicit-parameters-and-views.md @@ -1,6 +1,7 @@ --- title: Implicit Parameters and Views layout: default +chapter: 7 --- # Implicit Parameters and Views @@ -18,7 +19,7 @@ and can be used as implicit conversions called [views](#views). The `implicit` modifier is illegal for all type members, as well as for [top-level objects](11-top-level-definitions.html#packagings). -###### Example: `Monoid` +### Example: The following code defines an abstract class of monoids and two concrete implementations, `StringMonoid` and `IntMonoid`. The two implementations are marked implicit. @@ -289,7 +290,7 @@ As for implicit parameters, overloading resolution is applied if there are several possible candidates (of either the call-by-value or the call-by-name category). -###### Example: `Ordered` +### Example: Class `scala.Ordered[A]` contains a method ``` diff --git a/10-pattern-matching.md b/10-pattern-matching.md index 042873e05b..cb20a81823 100644 --- a/10-pattern-matching.md +++ b/10-pattern-matching.md @@ -1,6 +1,7 @@ --- title: Pattern Matching layout: default +chapter: 8 --- # Pattern Matching @@ -596,7 +597,7 @@ the compilation of pattern matching can emit warnings which diagnose that a given set of patterns is not exhaustive, i.e. that there is a possibility of a `MatchError` being raised at run-time. -###### Example: `eval` +### Example: Consider the following definitions of arithmetic terms: diff --git a/11-top-level-definitions.md b/11-top-level-definitions.md index 8d08081262..2c65e35898 100644 --- a/11-top-level-definitions.md +++ b/11-top-level-definitions.md @@ -1,6 +1,7 @@ --- title: Top-Level Definitions layout: default +chapter: 9 --- # Top-Level Definitions diff --git a/12-xml-expressions-and-patterns.md b/12-xml-expressions-and-patterns.md index 5290e9e6c5..735349cb90 100644 --- a/12-xml-expressions-and-patterns.md +++ b/12-xml-expressions-and-patterns.md @@ -1,6 +1,7 @@ --- title: XML Expressions and Patterns layout: default +chapter: 10 --- # XML Expressions and Patterns diff --git a/13-user-defined-annotations.md b/13-user-defined-annotations.md index 3011d91134..621b55928d 100644 --- a/13-user-defined-annotations.md +++ b/13-user-defined-annotations.md @@ -1,6 +1,7 @@ --- title: User-Defined Annotations layout: default +chapter: 11 --- # User-Defined Annotations diff --git a/14-the-scala-standard-library.md b/14-the-scala-standard-library.md index 662207be05..db68edd32f 100644 --- a/14-the-scala-standard-library.md +++ b/14-the-scala-standard-library.md @@ -1,6 +1,7 @@ --- title: The Scala Standard Library layout: default +chapter: 12 --- # The Scala Standard Library @@ -234,7 +235,7 @@ for type `Int` and for all subrange types. The `toString` method displays its receiver as an integer or floating point number. -###### Example: +### Example: This is the signature of the numeric value type `Int`: diff --git a/15-syntax-summary.md b/15-syntax-summary.md index 2aa4e94778..ac24e1e14a 100644 --- a/15-syntax-summary.md +++ b/15-syntax-summary.md @@ -1,6 +1,7 @@ --- title: Syntax Summary layout: default +chapter: 13 --- # Syntax Summary diff --git a/16-references.md b/16-references.md index aab189dc3f..d0410e748a 100644 --- a/16-references.md +++ b/16-references.md @@ -1,6 +1,7 @@ --- title: References layout: default +chapter: 14 --- diff --git a/_includes/numbering.css b/_includes/numbering.css new file mode 100644 index 0000000000..e8404652dc --- /dev/null +++ b/_includes/numbering.css @@ -0,0 +1,56 @@ +// based on http://philarcher.org/css/numberheadings.css, +h1 { + /* must reset here */ + counter-reset: chapter {{ page.chapter }}; +} +h1:before { + /* and must reset again here */ + counter-reset: chapter {{ page.chapter }}; + content: "Chapter " counter(chapter); + display: block; +} + +h2 { + /* must increment here */ + counter-increment: section; + counter-reset: subsection; +} +h2:before { + /* and must reset again here */ + counter-reset: chapter {{ page.chapter }}; + + content: counter(chapter) "." counter(section) ; + display: inline; + margin-right: 1em; +} +h2:after { + /* can only have one counter-reset per tag, so can't do it in h2/h2:before... */ + counter-reset: example; +} + +h3 { + /* must increment here */ + counter-increment: subsection; +} +h3:before { + /* and must reset again here */ + counter-reset: chapter {{ page.chapter }}; + + content: counter(chapter) "." counter(section) "." counter(subsection); + display: inline; + margin-right: 1em; +} + +h3[id*='example:'] { + /* must increment here */ + counter-increment: example; + display: inline; +} +h3[id*='example:']:before { + /* and must reset again here */ + counter-reset: chapter {{ page.chapter }}; + + content: "Example " counter(chapter) "." counter(section) "." counter(example); + display: inline; + margin-right: 1em; +} diff --git a/_layouts/default.yml b/_layouts/default.yml index 8eef38c959..cb9f8623be 100644 --- a/_layouts/default.yml +++ b/_layouts/default.yml @@ -11,302 +11,22 @@ } }); </script> - <script type="text/javascript" src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> - </script> - <style type="text/css" media="screen"> - // based on http://philarcher.org/css/numberheadings.css -/* body {counter-reset: h2} - h2 {counter-reset: h3} - h3 {counter-reset: h4} - h4 {counter-reset: h5} - h5 {counter-reset: h6} - h2:before {counter-increment: h2; content: counter(h2) ". "} - h3:before {counter-increment: h3; content: counter(h2) "." counter(h3) ". "} - h4:before {counter-increment: h4; content: counter(h2) "." counter(h3) "." counter(h4) ". "} - h5:before {counter-increment: h5; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "} - h6:before {counter-increment: h6; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ". "} - h2.nocount:before, h3.nocount:before, h4.nocount:before, h5.nocount:before, h6.nocount:before {content: ""; counter-increment: none} */ - - - body { - font-family: Helvetica, arial, sans-serif; - font-size: 14px; - line-height: 1.6; - padding-top: 10px; - padding-bottom: 10px; - background-color: white; - padding: 30px; } - - body > *:first-child { - margin-top: 0 !important; } - body > *:last-child { - margin-bottom: 0 !important; } - - a { - color: #4183C4; } - a.absent { - color: #cc0000; } - a.anchor { - display: block; - padding-left: 30px; - margin-left: -30px; - cursor: pointer; - position: absolute; - top: 0; - left: 0; - bottom: 0; } - - h1, h2, h3, h4, h5, h6 { - margin: 20px 0 10px; - padding: 0; - font-weight: bold; - -webkit-font-smoothing: antialiased; - cursor: text; - position: relative; } - - h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor { - background: url("../../images/modules/styleguide/para.png") no-repeat 10px center; - text-decoration: none; } - - h1 tt, h1 code { - font-size: inherit; } - - h2 tt, h2 code { - font-size: inherit; } - - h3 tt, h3 code { - font-size: inherit; } - - h4 tt, h4 code { - font-size: inherit; } - - h5 tt, h5 code { - font-size: inherit; } - - h6 tt, h6 code { - font-size: inherit; } - - h1 { - font-size: 28px; - color: black; } - - h2 { - font-size: 24px; - border-bottom: 1px solid #cccccc; - color: black; } - - h3 { - font-size: 18px; } - - h4 { - font-size: 16px; } - - h5 { - font-size: 14px; } - - h6 { - color: #777777; - font-size: 14px; } + <script type="text/javascript" src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> - p, blockquote, ul, ol, dl, li, table, pre { - margin: 15px 0; } - - hr { - background: transparent url("../../images/modules/pulls/dirty-shade.png") repeat-x 0 0; - border: 0 none; - color: #cccccc; - height: 4px; - padding: 0; } - - body > h2:first-child { - margin-top: 0; - padding-top: 0; } - body > h1:first-child { - margin-top: 0; - padding-top: 0; } - body > h1:first-child + h2 { - margin-top: 0; - padding-top: 0; } - body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child { - margin-top: 0; - padding-top: 0; } - - a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { - margin-top: 0; - padding-top: 0; } - - h1 p, h2 p, h3 p, h4 p, h5 p, h6 p { - margin-top: 0; } - - li p.first { - display: inline-block; } - - ul, ol { - padding-left: 30px; } - - ul :first-child, ol :first-child { - margin-top: 0; } - - ul :last-child, ol :last-child { - margin-bottom: 0; } - - dl { - padding: 0; } - dl dt { - font-size: 14px; - font-weight: bold; - font-style: italic; - padding: 0; - margin: 15px 0 5px; } - dl dt:first-child { - padding: 0; } - dl dt > :first-child { - margin-top: 0; } - dl dt > :last-child { - margin-bottom: 0; } - dl dd { - margin: 0 0 15px; - padding: 0 15px; } - dl dd > :first-child { - margin-top: 0; } - dl dd > :last-child { - margin-bottom: 0; } - - blockquote { - border-left: 4px solid #dddddd; - padding: 0 15px; - color: #777777; } - blockquote > :first-child { - margin-top: 0; } - blockquote > :last-child { - margin-bottom: 0; } - - table { - padding: 0; } - table tr { - border-top: 1px solid #cccccc; - background-color: white; - margin: 0; - padding: 0; } - table tr:nth-child(2n) { - background-color: #f8f8f8; } - table tr th { - font-weight: bold; - border: 1px solid #cccccc; - text-align: left; - margin: 0; - padding: 6px 13px; } - table tr td { - border: 1px solid #cccccc; - text-align: left; - margin: 0; - padding: 6px 13px; } - table tr th :first-child, table tr td :first-child { - margin-top: 0; } - table tr th :last-child, table tr td :last-child { - margin-bottom: 0; } - - img { - max-width: 100%; } - - span.frame { - display: block; - overflow: hidden; } - span.frame > span { - border: 1px solid #dddddd; - display: block; - float: left; - overflow: hidden; - margin: 13px 0 0; - padding: 7px; - width: auto; } - span.frame span img { - display: block; - float: left; } - span.frame span span { - clear: both; - color: #333333; - display: block; - padding: 5px 0 0; } - span.align-center { - display: block; - overflow: hidden; - clear: both; } - span.align-center > span { - display: block; - overflow: hidden; - margin: 13px auto 0; - text-align: center; } - span.align-center span img { - margin: 0 auto; - text-align: center; } - span.align-right { - display: block; - overflow: hidden; - clear: both; } - span.align-right > span { - display: block; - overflow: hidden; - margin: 13px 0 0; - text-align: right; } - span.align-right span img { - margin: 0; - text-align: right; } - span.float-left { - display: block; - margin-right: 13px; - overflow: hidden; - float: left; } - span.float-left span { - margin: 13px 0 0; } - span.float-right { - display: block; - margin-left: 13px; - overflow: hidden; - float: right; } - span.float-right > span { - display: block; - overflow: hidden; - margin: 13px auto 0; - text-align: right; } - - code, tt { - margin: 0 2px; - padding: 0 5px; - white-space: nowrap; - border: 1px solid #eaeaea; - background-color: #f8f8f8; - border-radius: 3px; } - - pre code { - margin: 0; - padding: 0; - white-space: pre; - border: none; - background: transparent; } + <!-- need to use include to see value of page.chapter variable --> + <style type="text/css"> + {% include numbering.css %} + </style> + <script type="text/javascript"> + // clear content of H3 nodes that start with "Example:" + // the content is only there to determine ID of the H3 element (redcarpet doesn't let us set css id) + $( document ).ready(function(){ $("h3[id*='example:']").text("") }) + </script> - .highlight pre { - background-color: #f8f8f8; - border: 1px solid #cccccc; - font-size: 13px; - line-height: 19px; - overflow: auto; - padding: 6px 10px; - border-radius: 3px; } + <link rel="stylesheet" type="text/css" href="resources/style.css"> + <link rel="stylesheet" type="text/css" href="resources/github.css"> - pre { - background-color: #f8f8f8; - border: 1px solid #cccccc; - font-size: 13px; - line-height: 19px; - overflow: auto; - padding: 6px 10px; - border-radius: 3px; } - pre code, pre tt { - background-color: transparent; - border: none; } - - </style> </head> <body> diff --git a/resources/github.css b/resources/github.css new file mode 100644 index 0000000000..bf8df4bb03 --- /dev/null +++ b/resources/github.css @@ -0,0 +1,349 @@ +body { + font-family: Helvetica, arial, sans-serif; + font-size: 14px; + line-height: 1.6; + padding-top: 10px; + padding-bottom: 10px; + background-color: white; + padding: 30px; +} + +body > *:first-child { + margin-top: 0 !important; +} +body > *:last-child { + margin-bottom: 0 !important; +} + +a { + color: #4183C4; +} +a.absent { + color: #cc0000; +} +a.anchor { + display: block; + padding-left: 30px; + margin-left: -30px; + cursor: pointer; + position: absolute; + top: 0; + left: 0; + bottom: 0; +} + +h1, h2, h3, h4, h5, h6 { + margin: 20px 0 10px; + padding: 0; + font-weight: bold; + -webkit-font-smoothing: antialiased; + cursor: text; + position: relative; +} + +h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor { + background: url("../../images/modules/styleguide/para.png") no-repeat 10px center; + text-decoration: none; +} + +h1 tt, h1 code { + font-size: inherit; +} + +h2 tt, h2 code { + font-size: inherit; +} + +h3 tt, h3 code { + font-size: inherit; +} + +h4 tt, h4 code { + font-size: inherit; +} + +h5 tt, h5 code { + font-size: inherit; +} + +h6 tt, h6 code { + font-size: inherit; +} + +h1 { + font-size: 28px; + color: black; +} + +h2 { + font-size: 24px; + border-bottom: 1px solid #cccccc; + color: black; +} + +h3 { + font-size: 18px; +} + +h4 { + font-size: 16px; +} + +h5 { + font-size: 14px; +} + +h6 { + color: #777777; + font-size: 14px; +} + +p, blockquote, ul, ol, dl, li, table, pre { + margin: 15px 0; +} +<script type="text/javascript" src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> +<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> + +hr { + background: transparent url("../../images/modules/pulls/dirty-shade.png") repeat-x 0 0; + border: 0 none; + color: #cccccc; + height: 4px; + padding: 0; +} + +body > h2:first-child { + margin-top: 0; + padding-top: 0; +} +body > h1:first-child { + margin-top: 0; + padding-top: 0; +} +body > h1:first-child + h2 { + margin-top: 0; + padding-top: 0; +} +body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child { + margin-top: 0; + padding-top: 0; +} + +a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { + margin-top: 0; + padding-top: 0; +} + +h1 p, h2 p, h3 p, h4 p, h5 p, h6 p { + margin-top: 0; +} + +li p.first { + display: inline-block; +} + +ul, ol { + padding-left: 30px; +} + +ul :first-child, ol :first-child { + margin-top: 0; +} + +ul :last-child, ol :last-child { + margin-bottom: 0; +} + +dl { + padding: 0; +} +dl dt { + font-size: 14px; + font-weight: bold; + font-style: italic; + padding: 0; + margin: 15px 0 5px; +} +dl dt:first-child { + padding: 0; +} +dl dt > :first-child { + margin-top: 0; +} +dl dt > :last-child { + margin-bottom: 0; +} +dl dd { + margin: 0 0 15px; + padding: 0 15px; +} +dl dd > :first-child { + margin-top: 0; +} +dl dd > :last-child { + margin-bottom: 0; +} + +blockquote { + border-left: 4px solid #dddddd; + padding: 0 15px; + color: #777777; +} +blockquote > :first-child { + margin-top: 0; +} +blockquote > :last-child { + margin-bottom: 0; +} + +table { + padding: 0; +} +table tr { + border-top: 1px solid #cccccc; + background-color: white; + margin: 0; + padding: 0; +} +table tr:nth-child(2n) { + background-color: #f8f8f8; +} +table tr th { + font-weight: bold; + border: 1px solid #cccccc; + text-align: left; + margin: 0; + padding: 6px 13px; +} +table tr td { + border: 1px solid #cccccc; + text-align: left; + margin: 0; + padding: 6px 13px; +} +table tr th :first-child, table tr td :first-child { + margin-top: 0; +} +table tr th :last-child, table tr td :last-child { + margin-bottom: 0; +} + +img { + max-width: 100%; +} + +span.frame { + display: block; + overflow: hidden; +} +span.frame > span { + border: 1px solid #dddddd; + display: block; + float: left; + overflow: hidden; + margin: 13px 0 0; + padding: 7px; + width: auto; +} +span.frame span img { + display: block; + float: left; +} +span.frame span span { + clear: both; + color: #333333; + display: block; + padding: 5px 0 0; +} +span.align-center { + display: block; + overflow: hidden; + clear: both; +} +span.align-center > span { + display: block; + overflow: hidden; + margin: 13px auto 0; + text-align: center; +} +span.align-center span img { + margin: 0 auto; + text-align: center; +} +span.align-right { + display: block; + overflow: hidden; + clear: both; +} +span.align-right > span { + display: block; + overflow: hidden; + margin: 13px 0 0; + text-align: right; +} +span.align-right span img { + margin: 0; + text-align: right; +} +span.float-left { + display: block; + margin-right: 13px; + overflow: hidden; + float: left; +} +span.float-left span { + margin: 13px 0 0; +} +span.float-right { + display: block; + margin-left: 13px; + overflow: hidden; + float: right; +} +span.float-right > span { + display: block; + overflow: hidden; + margin: 13px auto 0; + text-align: right; +} + +code, tt { + margin: 0 2px; + padding: 0 5px; + white-space: nowrap; + border: 1px solid #eaeaea; + background-color: #f8f8f8; + border-radius: 3px; +} + +pre code { + margin: 0; + padding: 0; + white-space: pre; + border: none; + background: transparent; +} + +.highlight pre { + background-color: #f8f8f8; + border: 1px solid #cccccc; + font-size: 13px; + line-height: 19px; + overflow: auto; + padding: 6px 10px; + border-radius: 3px; +} +pre { + background-color: #f8f8f8; + border: 1px solid #cccccc; + font-size: 13px; + line-height: 19px; + overflow: auto; + padding: 6px 10px; + border-radius: 3px; +} +pre code, pre tt { + background-color: transparent; + border: none; +} + |