├── README.md ├── demo ├── elements │ └── buttons.less ├── forms │ └── base.less ├── preview.png ├── styleguide.md └── styles.less ├── styleguide ├── index.html ├── public │ ├── github.css │ ├── highlight.pack.js │ ├── html5shiv.js │ ├── jquery-1.10.2.min.js │ ├── kss.css │ ├── kss.js │ ├── kss.less │ ├── style.css │ └── styleguide.js ├── section-1.html └── section-2.html └── template ├── index.html └── public ├── github.css ├── highlight.pack.js ├── html5shiv.js ├── jquery-1.10.2.min.js ├── kss.js ├── kss.less └── styleguide.js /README.md: -------------------------------------------------------------------------------- 1 | #kss-node-template such as github 2 | 3 | This is a template for [kss-node](https://github.com/hughsk/kss-node) styleguide. 4 | 5 | 6 | ##Demo 7 | 8 | **[Example Styleguide](http://1026.github.io/kss-node-template-such-as-github/styleguide/)** 9 | 10 | This demo was created using [kss-node](https://github.com/hughsk/kss-node)'s demo file. 11 | 12 | 13 | ##How to apply this template 14 | 15 | 1. Install kss-node. Type `npm install kss` or `npm install -g kss` for global CLI. 16 | 2. Download and copy the "template" folder into your working directory. 17 | 3. Run `kss-node` command with `--template` option, like below. 18 | 19 | ``` 20 | kss-node --template path/to/template 21 | ``` 22 | 23 | 24 | ##More document 25 | 26 | [kss-node](https://github.com/hughsk/kss-node). 27 | -------------------------------------------------------------------------------- /demo/elements/buttons.less: -------------------------------------------------------------------------------- 1 | // Buttons 2 | // 3 | // A majority of buttons in the site are built from the same base class. 4 | // 5 | // Markup: 6 | // Link Button 7 | // 8 | // 9 | // 10 | // .primary - Indicate that the button is the primary feature of this form. 11 | // .remove - Indicate that the button will remove a feature, or other negative connotations. 12 | // :hover - Highlight the button when hovered. 13 | // :disabled - Make the button change appearance to reflect it being disabled. 14 | // :active - "Press" the button down when clicked. 15 | // 16 | // Styleguide 1.1 17 | .button { 18 | @color:#aaa; 19 | 20 | -webkit-appearance:none; 21 | -moz-appearance:none; 22 | appearance:none; 23 | 24 | padding:10px 20px; 25 | 26 | color:#fff; 27 | &:visited, &:hover, &:active { 28 | color:#fff; 29 | } 30 | 31 | font-family:Helvetica, Arial, sans-serif; 32 | font-size:16px; 33 | font-weight:bold; 34 | text-transform:lowercase; 35 | text-decoration:none; 36 | 37 | cursor:pointer; 38 | 39 | border-radius:3px; 40 | .button-colorize(@color); 41 | 42 | &:hover { 43 | .button-colorize(lighten(@color, 8%)); 44 | border:1px solid darken(@color, 20%); 45 | } 46 | &:active { 47 | position:relative; top:3px; 48 | box-shadow:none!important; 49 | } 50 | &.primary { 51 | .button-colorize(#5c4); 52 | } 53 | &:disabled { 54 | .button-colorize(lighten(@color, 20%)); 55 | cursor:default; 56 | } 57 | &.remove { 58 | .button-colorize(#c54); 59 | } 60 | } 61 | 62 | .button-colorize(@color) { 63 | background-color:@color; 64 | border:1px solid darken(@color, 20%); 65 | 66 | text-shadow:0 2px 0 darken(@color, 10%); 67 | box-shadow:0 3px 0 0 darken(@color, 30%), inset 0 1px 3px rgba(255,255,255,0.4); 68 | background-image:-webkit-linear-gradient(top, rgba(255,255,255, 0.125) 0%, rgba(0,0,0, 0.125) 100%); 69 | } -------------------------------------------------------------------------------- /demo/forms/base.less: -------------------------------------------------------------------------------- 1 | // Text Input 2 | // 3 | // Below are the text-oriented form elements used on the site. 4 | // 5 | // Styleguide 2.1 6 | 7 | 8 | // Single-Line Text Boxes 9 | // 10 | // Your standard, everyday text boxes. 11 | // 12 | // :hover - Highlight the text box when hovering 13 | // :focus - Similar to `:hover`, however it should demand more attention than when an input is simply hovered. 14 | // :disabled - When disabled, the input's appearance should reflect as such. 15 | // 16 | // Markup: 17 | // 18 | // Styleguide 2.1.1 19 | input[type='text'] { 20 | -webkit-appearance: none; 21 | -moz-appearance: none; 22 | appearance: none; 23 | 24 | box-sizing:border-box; 25 | 26 | font-size:14px; 27 | line-height:1.5em; 28 | padding:8px; 29 | 30 | border:1px solid #aaa; 31 | background-color:#eee; 32 | outline:0; 33 | 34 | border-radius:3px; 35 | box-shadow:inset 1px 1px 1px rgba(0, 0, 0, 0.15); 36 | 37 | &:hover { 38 | border-color:#999; 39 | background-color:#f0f0f0; 40 | } 41 | 42 | &:focus { 43 | border-color:#89e; 44 | background-color:#fff; 45 | box-shadow:inset 1px 1px 2px rgba(20, 20, 120, 0.3); 46 | } 47 | 48 | &:disabled { 49 | border-color:#ccc; 50 | background-color:#eee; 51 | color:#999; 52 | } 53 | } 54 | 55 | // Label/Textbox Pairs 56 | // 57 | // All labelled textboxes should be included in a wrapper `
` element for both layout 58 | // convenience and specific styling. 59 | // 60 | // Markup: 61 | //
62 | // 63 | // 64 | //
65 | // 66 | // .disabled - To be used when the text input inside is expected to be disabled. 67 | // .invalid - To be used if the input has failed a validation check. 68 | // .valid - To be used if the input has passed a validation check (intended for live validation in particular). 69 | // 70 | // Styleguide 2.1.2 71 | .mod-input { 72 | position:relative; 73 | display:block; 74 | 75 | &>label { 76 | width:45%; font-weight:bold; 77 | } 78 | 79 | &>input, &>label { 80 | display : -moz-inline-stack; 81 | display : inline-block; 82 | zoom : 1; 83 | *display : inline; 84 | } 85 | 86 | &.disabled { 87 | color:#888; 88 | input { 89 | border-color:#ccc; 90 | background-color:#eee; 91 | color:#999; 92 | } 93 | } 94 | 95 | &.invalid { 96 | label { 97 | color:#911; 98 | } 99 | input { 100 | border-color:#e65; 101 | background-color:#fdd; 102 | } 103 | } 104 | &.valid { 105 | label { 106 | color:#191; 107 | } 108 | input { 109 | border-color:#6e5; 110 | background-color:#dfd; 111 | } 112 | } 113 | } -------------------------------------------------------------------------------- /demo/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1026/kss-node-template-such-as-github/672cf24f835e68ae09b500b30be9da68a76a5c52/demo/preview.png -------------------------------------------------------------------------------- /demo/styleguide.md: -------------------------------------------------------------------------------- 1 | #kss-node-template such as github 2 | 3 | This is a template for [kss-node](https://github.com/hughsk/kss-node) styleguide. 4 | 5 | 6 | ##The following text is a quotation from kss-node demo's overview 7 | 8 | [kss-node](https://github.com/hughsk/kss-node). 9 | 10 | This is a demo of [kss-node](http://github.com/hughsk/kss-node)'s built-in styleguide generator. The module is essentially a reimplementation of the [KSS](http://github.com/kneath/kss) Ruby parser, in Node: 11 | 12 | > Inspired by TomDoc, KSS attempts to provide a methodology for writing maintainable, documented CSS within a team. 13 | > Specifically, KSS is a documentation specification and styleguide format. 14 | > It is **not** a preprocessor, CSS framework, naming convention, or specificity guideline. 15 | > 16 | > KSS is a set of guidelines to help you produce an HTML styleguide tied to CSS documentation that is nice to read in plain text, yet structured enough to be automatically extracted and processed by a machine. 17 | 18 | The upshot of this is that KSS can be used for generating CSS documentation pages. This site is generated with the `kss-node` command-line tool used on this [demo project](https://github.com/hughsk/kss-node/tree/master/demo). 19 | 20 | Check out the [project on Github](https://github.com/hughsk/kss-node) for more information, or read on for details on how to document your stylesheets for KSS. 21 | 22 | # Specification 23 | 24 | The text from here on is mostly taken from the [KSS specification](https://github.com/kneath/kss/blob/master/SPEC.md). 25 | 26 | Unlike TomDoc, not every CSS rule should be documented. You should document a rule declaration when the rule can accurately describe a visual UI element in the styleguide. Each element should have one documentation block describing that particular UI element's various states. 27 | 28 | KSS documentation is hierarchical in nature — any documentation blocks at any point within the styleguide hierarchy apply to the documentation blocks beneath that level. This means that documentation for 2.1 applies to documentation for 2.1.3. 29 | 30 | ## Format 31 | 32 | The basic format for KSS documentation can be best explained in an example: 33 | 34 | ```css 35 | /* 36 | A button suitable for giving stars to someone. 37 | 38 | :hover - Subtle hover highlight. 39 | .stars-given - A highlight indicating you've already given a star. 40 | .stars-given:hover - Subtle hover highlight on top of stars-given styling. 41 | .disabled - Dims the button to indicate it cannot be used. 42 | 43 | Styleguide 2.1.3. 44 | */ 45 | a.button.star{ 46 | ... 47 | } 48 | a.button.star.stars-given{ 49 | ... 50 | } 51 | a.button.star.disabled{ 52 | ... 53 | } 54 | ``` 55 | 56 | When using a preprocessor that supports the functionality, use `//` to prefix your comment sections (SCSS example): 57 | 58 | ```less 59 | // A button suitable for giving stars to someone. 60 | // 61 | // :hover - Subtle hover highlight. 62 | // .stars-given - A highlight indicating you've already given a star. 63 | // .stars-given:hover - Subtle hover highlight on top of stars-given styling. 64 | // .disabled - Dims the button to indicate it cannot be used. 65 | // 66 | // Styleguide 2.1.3. 67 | a.button.star{ 68 | ... 69 | &.star-given{ 70 | ... 71 | } 72 | &.disabled{ 73 | ... 74 | } 75 | } 76 | ``` 77 | 78 | Each KSS documentation block consists of three parts: a description of what the element does or looks like, a list of modifier classes or pseudo-classes and how they modify the element, and a reference to the element's position in the styleguide. 79 | 80 | ## Style Documentation 81 | 82 | The description should be plain sentences of what the CSS rule or hierarchy does and looks like. A good description gives guidance toward the application of elements the CSS rules style. 83 | 84 | CSS rules that depend on specific HTML structures should describe those structures using `` notation. For example: 85 | 86 | ```less 87 | // A feed of activity items. Within each , there should be many 88 | //
s which are the feed items. 89 | ``` 90 | 91 | To describe the status of a set of rules, you should prefix the description with **Experimental** or **Deprecated**. 92 | 93 | **Experimental** indicates CSS rules that apply to experimental styling. This can be useful when testing out new designs before they launch (staff only), alternative layouts in A/B tests, or beta features. 94 | 95 | ```less 96 | // Experimental: An alternative signup button styling used in AB Test #195. 97 | ``` 98 | 99 | **Deprecated** indicates that the rule is slated for removal. Rules that are deprecated should not be used in future development. This description should explain what developers should do when encountering this style. 100 | 101 | ```less 102 | // Deprecated: Styling for legacy wikis. We'll drop support for these wikis on 103 | // July 13, 2007. 104 | ``` 105 | 106 | ## The modifiers section 107 | 108 | If the UI element you are documenting has multiple states or styles depending on added classes or pseudo-classes, you should document them in the modifiers section. 109 | 110 | ```less 111 | // :hover - Subtle hover highlight. 112 | // .stars-given - A highlight indicating you've already given a star. 113 | // .stars-given:hover - Subtle hover highlight on top of stars-given styling. 114 | // .disabled - Dims the button to indicate it cannot be used. 115 | ``` 116 | 117 | ## The styleguide section 118 | 119 | If the UI element you are documenting has an example in the styleguide, you should reference it using the "Styleguide [ref]" syntax. 120 | 121 | ```less 122 | // Styleguide 2.1.3. 123 | ``` 124 | 125 | References should be integer sections separated by periods. Each period denotes a hierarchy of the styleguide. Styleguide references can point to entire sections, a portion of the section, or a specific example. 126 | 127 | If there is no example, then you must note that there is no reference. 128 | 129 | ```less 130 | // No styleguide reference. 131 | ``` 132 | 133 | ## The markup section 134 | 135 | *Note: This section is unofficial, and only implemented in `kss-node`.* 136 | 137 | If you wish to include example HTML for the UI element you are documenting, you should include an additional paragraph with sample markup and prefix it with `Markup:`. You should also note the placement of modifier classes with `{$modifiers}`, like so: 138 | 139 | ```less 140 | // Buttons 141 | // 142 | // :hover - Highlight the button when hovering. 143 | // 144 | // Markup: 145 | // Link 146 | // 147 | // 148 | // Styleguide 2.1.3. 149 | ``` 150 | 151 | If you're using the `kss-node` module or CLI, make sure not to include any double line-breaks, as only the first paragraph prefixed with `Markup:` will be included. 152 | 153 | # Preprocessor Helper Documentation 154 | 155 | If you use a CSS preprocessor like SCSS or LESS, you should document all helper functions (sometimes called mixins). 156 | 157 | ```less 158 | // Creates a linear gradient background, from top to bottom. 159 | // 160 | // $start - The color hex at the top. 161 | // $end - The color hex at the bottom. 162 | // 163 | // Compatible in IE6+, Firefox 2+, Safari 4+. 164 | @mixin gradient($start, $end){ 165 | ... 166 | } 167 | ``` 168 | 169 | Each documentation block should have a description section, parameters section, and compatibility section. The description section follows the same guidelines as style documentation. 170 | 171 | ## The parameters section 172 | 173 | If the mixin takes parameters, you should document each parameter and describe what sort of input it expects (hex, number, etc). 174 | 175 | ```less 176 | // $start - The color hex at the top. 177 | // $end - The color hex at the bottom. 178 | ``` 179 | 180 | ## The compatibility section 181 | 182 | You must list out what browsers this helper method is compatible in. 183 | 184 | ```less 185 | // Compatible in IE6+, Firefox 2+, Safari 4+. 186 | ``` 187 | 188 | If you do not know the compatibility, you should state as such. 189 | 190 | ```less 191 | // Compatibility untested. 192 | ``` 193 | 194 | # Styleguide 195 | 196 | In order to fully take advantage of KSS, you should create a living styleguide. A living styleguide is a *part of your application* and should include all of the CSS, Javascript, and layout the rest of your application does. 197 | 198 | To get started quickly use the CLI tool, which supports custom templates too. If you're feeling game you can (and should) build it up from scratch using the module's API. 199 | 200 | Overall, keep in mind that styleguides should adapt to the application they are referencing and be easy to maintain and as automatic as possible. 201 | 202 | ## Organization 203 | 204 | The styleguide should be organized by numbered sections. These sections can go as deep as you like. Every element should have a numbered section to refer to. For example: 205 | 206 | 1. Buttons 207 | 1.1 Form Buttons 208 | 1.1.1 Generic form button 209 | 1.1.2 Special form button 210 | 1.2 Social buttons 211 | 1.3 Miscelaneous buttons 212 | 2. Form elements 213 | 2.1 Text fields 214 | 2.2 Radio and checkboxes 215 | 3. Text styling 216 | 4. Tables 217 | 4.1 Number tables 218 | 4.2 Diagram tables 219 | 220 | The goal here is to create an organizational structure that is flexible, but rigid enough to be machine processed and referenced inside of documentation. 221 | -------------------------------------------------------------------------------- /demo/styles.less: -------------------------------------------------------------------------------- 1 | // Modules 2 | // 3 | // Reusable elements that can be used across the site. 4 | // So far this just includes buttons. 5 | // 6 | // Styleguide 1. 7 | @import "./elements/buttons.less"; 8 | 9 | // Forms 10 | // 11 | // Covers styles used for forms, such as the `` and ` 82 |
83 | 84 | 85 |
86 | .primary 87 | Link Button 88 | 89 | 90 |
91 | 92 |
93 | .remove 94 | Link Button 95 | 96 | 97 |
98 | 99 |
100 | :hover 101 | Link Button 102 | 103 | 104 |
105 | 106 |
107 | :disabled 108 | Link Button 109 | 110 | 111 |
112 | 113 |
114 | :active 115 | Link Button 116 | 117 | 118 |
119 | 120 | 121 |
122 |
123 |
<a href="#" class="button {$modifiers}">Link Button</a>
124 | <button class="button {$modifiers}">Button Element</button>
125 | <input type="button" class="button {$modifiers}" value="input[type='button']"/>
126 |
127 |
128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /styleguide/section-2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Styleguide Example 6 | 7 | 8 | 11 | 12 | 13 |
14 |
15 |

Styleguide

16 |
17 |
18 |
19 | 29 | 30 |
31 | 32 | 33 | 34 | 35 |
36 |

Forms

37 |
38 | 39 |
40 |

Covers styles used for forms, such as the <input> and <select> 41 | elements.

42 | 43 |
44 | 45 | 46 | 47 | 48 |
49 |

Text Input

50 |
51 | 52 |
53 |

Below are the text-oriented form elements used on the site.

54 | 55 |
56 | 57 | 58 | 59 | 60 |
61 |
62 |

2.1.1 Single-Line Text Boxes

63 |
64 | 65 |
66 |

Your standard, everyday text boxes.

67 | 68 | 69 |
    70 | 71 |
  • :hover -

    Highlight the text box when hovering

    72 |
  • 73 | 74 |
  • :focus -

    Similar to :hover, however it should demand more attention than when an input is simply hovered.

    75 |
  • 76 | 77 |
  • :disabled -

    When disabled, the input's appearance should reflect as such.

    78 |
  • 79 | 80 |
81 |
82 | 83 | 84 |
85 | 86 |
87 | 88 | 89 |
90 | :hover 91 | 92 |
93 | 94 |
95 | :focus 96 | 97 |
98 | 99 |
100 | :disabled 101 | 102 |
103 | 104 | 105 |
106 |
107 |
<input type="text" class="{$modifiers}" value="Text"/>
108 |
109 |
110 |
111 | 112 | 113 | 114 |
115 |
116 |

2.1.2 Label/Textbox Pairs

117 |
118 | 119 |
120 |

All labelled textboxes should be included in a wrapper <div> element for both layout 121 | convenience and specific styling.

122 | 123 | 124 |
    125 | 126 |
  • .disabled -

    To be used when the text input inside is expected to be disabled.

    127 |
  • 128 | 129 |
  • .invalid -

    To be used if the input has failed a validation check.

    130 |
  • 131 | 132 |
  • .valid -

    To be used if the input has passed a validation check (intended for live validation in particular).

    133 |
  • 134 | 135 |
136 |
137 | 138 | 139 |
140 |
141 | 142 | 143 |
144 |
145 | 146 | 147 |
148 | .disabled 149 |
150 | 151 | 152 |
153 |
154 | 155 |
156 | .invalid 157 |
158 | 159 | 160 |
161 |
162 | 163 |
164 | .valid 165 |
166 | 167 | 168 |
169 |
170 | 171 | 172 |
173 |
174 |
<div class="mod-input text {$modifiers}">
175 |     <label>Text Label</label>
176 |     <input type="text" value="Text Input"/>
177 | </div>
178 |
179 |
180 |
181 | 182 | 183 | 184 |
185 |
186 | 187 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | -------------------------------------------------------------------------------- /template/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Styleguide Example 6 | 7 | 8 | 11 | 12 | 13 |
14 |
15 |

Styleguide

16 |
17 |
18 |
19 | 27 | 28 |
29 | 30 | {{#if overview}} 31 |
32 | {{{overview}}} 33 |
34 | {{else}} 35 | {{#eachSection rootNumber}} 36 | {{#if markup}} 37 |
38 |
39 |

{{reference}} {{header}}

40 |
41 | {{#if description}} 42 |
43 | {{{description}}} 44 | 45 |
    46 | {{#eachModifier}} 47 |
  • {{name}} - {{{description}}}
  • 48 | {{/eachModifier}} 49 |
50 |
51 | {{/if}} 52 | 53 |
54 | {{modifierMarkup}} 55 |
56 | 57 | {{#eachModifier}} 58 |
59 | {{name}} 60 | {{modifierMarkup}} 61 |
62 | {{/eachModifier}} 63 | 64 |
65 |
66 |
{{markup}}
67 |
68 |
69 |
70 | {{else}} 71 |
72 |

{{header}}

73 |
74 | {{#if description}} 75 |
76 | {{{description}}} 77 |
78 | {{/if}} 79 | {{/if}} 80 | {{/eachSection}} 81 | {{/if}} 82 |
83 |
84 | 85 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /template/public/github.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | github.com style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | pre .comment, 8 | pre .template_comment, 9 | pre .diff .header, 10 | pre .javadoc { 11 | color: #998; 12 | font-style: italic 13 | } 14 | 15 | pre .keyword, 16 | pre .css .rule .keyword, 17 | pre .winutils, 18 | pre .javascript .title, 19 | pre .nginx .title, 20 | pre .subst, 21 | pre .request, 22 | pre .status { 23 | color: #333; 24 | font-weight: bold 25 | } 26 | 27 | pre .number, 28 | pre .hexcolor, 29 | pre .ruby .constant { 30 | color: #099; 31 | } 32 | 33 | pre .string, 34 | pre .tag .value, 35 | pre .phpdoc, 36 | pre .tex .formula { 37 | color: #d14 38 | } 39 | 40 | pre .title, 41 | pre .id, 42 | pre .coffeescript .params, 43 | pre .scss .preprocessor { 44 | color: #900; 45 | font-weight: bold 46 | } 47 | 48 | pre .javascript .title, 49 | pre .lisp .title, 50 | pre .clojure .title, 51 | pre .subst { 52 | font-weight: normal 53 | } 54 | 55 | pre .class .title, 56 | pre .haskell .type, 57 | pre .vhdl .literal, 58 | pre .tex .command { 59 | color: #458; 60 | font-weight: bold 61 | } 62 | 63 | pre .tag, 64 | pre .tag .title, 65 | pre .rules .property, 66 | pre .django .tag .keyword { 67 | color: #000080; 68 | font-weight: normal 69 | } 70 | 71 | pre .attribute, 72 | pre .variable, 73 | pre .lisp .body { 74 | color: #008080 75 | } 76 | 77 | pre .regexp { 78 | color: #009926 79 | } 80 | 81 | pre .class { 82 | color: #458; 83 | font-weight: bold 84 | } 85 | 86 | pre .symbol, 87 | pre .ruby .symbol .string, 88 | pre .lisp .keyword, 89 | pre .tex .special, 90 | pre .prompt { 91 | color: #990073 92 | } 93 | 94 | pre .built_in, 95 | pre .lisp .title, 96 | pre .clojure .built_in { 97 | color: #0086b3 98 | } 99 | 100 | pre .preprocessor, 101 | pre .pragma, 102 | pre .pi, 103 | pre .doctype, 104 | pre .shebang, 105 | pre .cdata { 106 | color: #999; 107 | font-weight: bold 108 | } 109 | 110 | pre .deletion { 111 | background: #fdd 112 | } 113 | 114 | pre .addition { 115 | background: #dfd 116 | } 117 | 118 | pre .diff .change { 119 | background: #0086b3 120 | } 121 | 122 | pre .chunk { 123 | color: #aaa 124 | } 125 | -------------------------------------------------------------------------------- /template/public/highlight.pack.js: -------------------------------------------------------------------------------- 1 | var hljs=new function(){function l(o){return o.replace(/&/gm,"&").replace(//gm,">")}function b(p){for(var o=p.firstChild;o;o=o.nextSibling){if(o.nodeName.toUpperCase()=="CODE"){return o}if(!(o.nodeType==3&&o.nodeValue.match(/\s+/))){break}}}function h(p,o){return Array.prototype.map.call(p.childNodes,function(q){if(q.nodeType==3){return o?q.nodeValue.replace(/\n/g,""):q.nodeValue}if(q.nodeName.toUpperCase()=="BR"){return"\n"}return h(q,o)}).join("")}function a(q){var p=(q.className+" "+(q.parentNode?q.parentNode.className:"")).split(/\s+/);p=p.map(function(r){return r.replace(/^language-/,"")});for(var o=0;o"}function x(z){y+=""}function o(z){(z.event=="start"?t:x)(z.node)}while(p.length||r.length){var w=u();y+=l(v.substr(q,w[0].offset-q));q=w[0].offset;if(w==p){s.reverse().forEach(x);do{o(w.splice(0,1)[0]);w=u()}while(w==p&&w.length&&w[0].offset==q);s.reverse().forEach(t)}else{if(w[0].event=="start"){s.push(w[0].node)}else{s.pop()}o(w.splice(0,1)[0])}}return y+l(v.substr(q))}function f(r){function o(s){return(s&&s.source)||s}function p(t,s){return RegExp(o(t),"m"+(r.cI?"i":"")+(s?"g":""))}function q(z,x){if(z.compiled){return}z.compiled=true;var u=[];if(z.k){var s={};function A(B,t){if(r.cI){t=t.toLowerCase()}t.split(" ").forEach(function(C){var D=C.split("|");s[D[0]]=[B,D[1]?Number(D[1]):1];u.push(D[0])})}z.lR=p(z.l||"\\b"+hljs.IR+"\\b(?!\\.)",true);if(typeof z.k=="string"){A("keyword",z.k)}else{for(var y in z.k){if(!z.k.hasOwnProperty(y)){continue}A(y,z.k[y])}}z.k=s}if(x){if(z.bWK){z.b="\\b("+u.join("|")+")\\b(?!\\.)\\s*"}z.bR=p(z.b?z.b:"\\B|\\b");if(!z.e&&!z.eW){z.e="\\B|\\b"}if(z.e){z.eR=p(z.e)}z.tE=o(z.e)||"";if(z.eW&&x.tE){z.tE+=(z.e?"|":"")+x.tE}}if(z.i){z.iR=p(z.i)}if(z.r===undefined){z.r=1}if(!z.c){z.c=[]}for(var w=0;w'+O[0]+""}else{r+=O[0]}Q=B.lR.lastIndex;O=B.lR.exec(N)}return r+N.substr(Q)}function z(){if(B.sL&&!e[B.sL]){return l(w)}var N=B.subLanguageMode=="continuous"?B.top:undefined;var r=B.sL?d(B.sL,w,true,N):g(w);if(B.r>0){v+=r.keyword_count;A+=r.r}B.top=r.top;return''+r.value+""}function L(){return B.sL!==undefined?z():I()}function K(O,r){var N=O.cN?'':"";if(O.rB){x+=N;w=""}else{if(O.eB){x+=l(r)+N;w=""}else{x+=N;w=r}}B=Object.create(O,{parent:{value:B}})}function D(N,r){w+=N;if(r===undefined){x+=L();return 0}var P=o(r,B);if(P){x+=L();K(P,r);return P.rB?0:r.length}var Q=s(B,r);if(Q){var O=B;if(!(O.rE||O.eE)){w+=r}x+=L();do{if(B.cN){x+=""}A+=B.r;B=B.parent}while(B!=Q.parent);if(O.eE){x+=l(r)}w="";if(Q.starts){K(Q.starts,"")}return O.rE?0:r.length}if(t(r,B)){throw new Error('Illegal lexem "'+r+'" for mode "'+(B.cN||"")+'"')}w+=r;return r.length||1}var H=e[E];if(!H){throw new Error('Unknown language: "'+E+'"')}f(H);var B=M||H;var x="";for(var F=B;F!=H;F=F.parent){if(F.cN){x=''+x}}var w="";var A=0;var v=0;try{var u,q,p=0;while(true){B.t.lastIndex=p;u=B.t.exec(G);if(!u){break}q=D(G.substr(p,u.index-p),u[0]);p=u.index+q}D(G.substr(p));for(var F=B;F.parent;F=F.parent){if(F.cN){x+=""}}return{r:A,keyword_count:v,value:x,language:E,top:B}}catch(J){if(J.message.indexOf("Illegal")!=-1){return{r:0,keyword_count:0,value:l(G)}}else{throw J}}}function g(s){var o={keyword_count:0,r:0,value:l(s)};var q=o;for(var p in e){if(!e.hasOwnProperty(p)){continue}var r=d(p,s,false);r.language=p;if(r.keyword_count+r.r>q.keyword_count+q.r){q=r}if(r.keyword_count+r.r>o.keyword_count+o.r){q=o;o=r}}if(q.language){o.second_best=q}return o}function i(q,p,o){if(p){q=q.replace(/^((<[^>]+>|\t)+)/gm,function(r,v,u,t){return v.replace(/\t/g,p)})}if(o){q=q.replace(/\n/g,"
")}return q}function m(r,u,p){var v=h(r,p);var t=a(r);if(t=="no-highlight"){return}var w=t?d(t,v,true):g(v);t=w.language;var o=c(r);if(o.length){var q=document.createElementNS("http://www.w3.org/1999/xhtml","pre");q.innerHTML=w.value;w.value=j(o,c(q),v)}w.value=i(w.value,u,p);var s=r.className;if(!s.match("(\\s|^)(language-)?"+t+"(\\s|$)")){s=s?(s+" "+t):t}r.innerHTML=w.value;r.className=s;r.result={language:t,kw:w.keyword_count,re:w.r};if(w.second_best){r.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function n(){if(n.called){return}n.called=true;Array.prototype.map.call(document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml","pre"),b).filter(Boolean).forEach(function(o){m(o,hljs.tabReplace)})}function k(){window.addEventListener("DOMContentLoaded",n,false);window.addEventListener("load",n,false)}var e={};this.LANGUAGES=e;this.highlight=d;this.highlightAuto=g;this.fixMarkup=i;this.highlightBlock=m;this.initHighlighting=n;this.initHighlightingOnLoad=k;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gim]*/,i:/\n/,c:[this.BE,{b:/\[/,e:/\]/,r:0,c:[this.BE]}]};this.inherit=function(q,r){var o={};for(var p in q){o[p]=q[p]}if(r){for(var p in r){o[p]=r[p]}}return o}}();hljs.LANGUAGES.bash=function(a){var c={cN:"variable",b:/\$[\w\d#@][\w\d_]*/};var b={cN:"variable",b:/\$\{(.*?)\}/};var e={cN:"string",b:/"/,e:/"/,c:[a.BE,c,b,{cN:"variable",b:/\$\(/,e:/\)/,c:a.BE}],r:0};var d={cN:"string",b:/'/,e:/'/,r:0};return{l:/-?[a-z]+/,k:{keyword:"if then else elif fi for break continue while in do done exit return set declare case esac export exec",literal:"true false",built_in:"printf echo read cd pwd pushd popd dirs let eval unset typeset readonly getopts source shopt caller type hash bind help sudo",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:true,c:[{cN:"title",b:/\w[\w\d_]*/}],r:0},a.HCM,a.NM,e,d,c,b]}}(hljs);hljs.LANGUAGES.cs=function(a){return{k:"abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async await ascending descending from get group into join let orderby partial select set value var where yield",c:[{cN:"comment",b:"///",e:"$",rB:true,c:[{cN:"xmlDocTag",b:"///|"},{cN:"xmlDocTag",b:""}]},a.CLCM,a.CBLCLM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},a.ASM,a.QSM,a.CNM]}}(hljs);hljs.LANGUAGES.ruby=function(e){var a="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?";var j="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var g={keyword:"and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include"};var c={cN:"yardoctag",b:"@[A-Za-z]+"};var k=[{cN:"comment",b:"#",e:"$",c:[c]},{cN:"comment",b:"^\\=begin",e:"^\\=end",c:[c],r:10},{cN:"comment",b:"^__END__",e:"\\n$"}];var d={cN:"subst",b:"#\\{",e:"}",l:a,k:g};var i=[e.BE,d];var b=[{cN:"string",b:"'",e:"'",c:i,r:0},{cN:"string",b:'"',e:'"',c:i,r:0},{cN:"string",b:"%[qw]?\\(",e:"\\)",c:i},{cN:"string",b:"%[qw]?\\[",e:"\\]",c:i},{cN:"string",b:"%[qw]?{",e:"}",c:i},{cN:"string",b:"%[qw]?<",e:">",c:i,r:10},{cN:"string",b:"%[qw]?/",e:"/",c:i,r:10},{cN:"string",b:"%[qw]?%",e:"%",c:i,r:10},{cN:"string",b:"%[qw]?-",e:"-",c:i,r:10},{cN:"string",b:"%[qw]?\\|",e:"\\|",c:i,r:10},{cN:"string",b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}];var h={cN:"function",bWK:true,e:" |$|;",k:"def",c:[{cN:"title",b:j,l:a,k:g},{cN:"params",b:"\\(",e:"\\)",l:a,k:g}].concat(k)};var f=k.concat(b.concat([{cN:"class",bWK:true,e:"$|;",k:"class module",c:[{cN:"title",b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",r:0},{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]}].concat(k)},h,{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:b.concat([{b:j}]),r:0},{cN:"symbol",b:a+":",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:k.concat([{cN:"regexp",b:"/",e:"/[a-z]*",i:"\\n",c:[e.BE,d]},{cN:"regexp",b:"%r{",e:"}[a-z]*",i:"\\n",c:[e.BE,d]},{cN:"regexp",b:"%r\\(",e:"\\)[a-z]*",i:"\\n",c:[e.BE,d]},{cN:"regexp",b:"%r!",e:"![a-z]*",i:"\\n",c:[e.BE,d]},{cN:"regexp",b:"%r\\[",e:"\\][a-z]*",i:"\\n",c:[e.BE,d]}]),r:0}]));d.c=f;h.c[1].c=f;return{l:a,k:g,c:f}}(hljs);hljs.LANGUAGES.diff=function(a){return{c:[{cN:"chunk",b:"^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$",r:10},{cN:"chunk",b:"^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$",r:10},{cN:"chunk",b:"^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$",r:10},{cN:"header",b:"Index: ",e:"$"},{cN:"header",b:"=====",e:"=====$"},{cN:"header",b:"^\\-\\-\\-",e:"$"},{cN:"header",b:"^\\*{3} ",e:"$"},{cN:"header",b:"^\\+\\+\\+",e:"$"},{cN:"header",b:"\\*{5}",e:"\\*{5}$"},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}}(hljs);hljs.LANGUAGES.javascript=function(a){return{k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const",literal:"true false null undefined NaN Infinity"},c:[a.ASM,a.QSM,a.CLCM,a.CBLCLM,a.CNM,{b:"("+a.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[a.CLCM,a.CBLCLM,a.REGEXP_MODE,{b:/;/,sL:"xml"}],r:0},{cN:"function",bWK:true,e:/{/,k:"function",c:[{cN:"title",b:/[A-Za-z$_][0-9A-Za-z$_]*/},{cN:"params",b:/\(/,e:/\)/,c:[a.CLCM,a.CBLCLM],i:/["'\(]/}],i:/\[|%/}]}}(hljs);hljs.LANGUAGES.xml=function(a){var c="[A-Za-z0-9\\._:-]+";var b={eW:true,r:0,c:[{cN:"attribute",b:c,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"|$)",e:">",k:{title:"style"},c:[b],starts:{e:"",rE:true,sL:"css"}},{cN:"tag",b:"|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"",r:0,c:[{cN:"title",b:"[^ /><]+"},b]}]}}(hljs);hljs.LANGUAGES.markdown=function(a){return{c:[{cN:"header",b:"^#{1,3}",e:"$"},{cN:"header",b:"^.+?\\n[=-]{2,}$"},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",b:"\\*.+?\\*"},{cN:"emphasis",b:"_.+?_",r:0},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",b:"`.+?`"},{cN:"code",b:"^ ",e:"$",r:0},{cN:"horizontal_rule",b:"^-{3,}",e:"$"},{b:"\\[.+?\\]\\(.+?\\)",rB:true,c:[{cN:"link_label",b:"\\[.+\\]"},{cN:"link_url",b:"\\(",e:"\\)",eB:true,eE:true}]}]}}(hljs);hljs.LANGUAGES.css=function(a){var b="[a-zA-Z-][a-zA-Z0-9_-]*";var c={cN:"function",b:b+"\\(",e:"\\)",c:["self",a.NM,a.ASM,a.QSM]};return{cI:true,i:"[=/|']",c:[a.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:true,eE:true,r:0,c:[c,a.ASM,a.QSM,a.NM]}]},{cN:"tag",b:b,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[a.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[c,a.NM,a.QSM,a.ASM,a.CBLCLM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]}]}]}}(hljs);hljs.LANGUAGES.http=function(a){return{i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:true,e:"$",c:[{cN:"string",b:" ",e:" ",eB:true,eE:true}]},{cN:"attribute",b:"^\\w",e:": ",eE:true,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:true}}]}}(hljs);hljs.LANGUAGES.java=function(a){return{k:"false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws",c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"(^|\\s)@[A-Za-z]+"}],r:10},a.CLCM,a.CBLCLM,a.ASM,a.QSM,{cN:"class",bWK:true,e:"{",k:"class interface",eE:true,i:":",c:[{bWK:true,k:"extends implements",r:10},{cN:"title",b:a.UIR}]},a.CNM,{cN:"annotation",b:"@[A-Za-z]+"}]}}(hljs);hljs.LANGUAGES.php=function(a){var e={cN:"variable",b:"\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"};var b=[a.inherit(a.ASM,{i:null}),a.inherit(a.QSM,{i:null}),{cN:"string",b:'b"',e:'"',c:[a.BE]},{cN:"string",b:"b'",e:"'",c:[a.BE]}];var c=[a.BNM,a.CNM];var d={cN:"title",b:a.UIR};return{cI:true,l:a.UIR,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return implements parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try this switch continue endfor endif declare unset true false namespace trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[a.CLCM,a.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"}]},{cN:"comment",b:"__halt_compiler.+?;",eW:true,k:"__halt_compiler",l:a.UIR},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[a.BE]},{cN:"preprocessor",b:"<\\?php",r:10},{cN:"preprocessor",b:"\\?>"},e,{cN:"function",bWK:true,e:"{",k:"function",i:"\\$|\\[|%",c:[d,{cN:"params",b:"\\(",e:"\\)",c:["self",e,a.CBLCLM].concat(b).concat(c)}]},{cN:"class",bWK:true,e:"{",k:"class",i:"[:\\(\\$]",c:[{bWK:true,eW:true,k:"extends",c:[d]},d]},{b:"=>"}].concat(b).concat(c)}}(hljs);hljs.LANGUAGES.python=function(a){var f={cN:"prompt",b:/^(>>>|\.\.\.) /};var c=[{cN:"string",b:/(u|b)?r?'''/,e:/'''/,c:[f],r:10},{cN:"string",b:/(u|b)?r?"""/,e:/"""/,c:[f],r:10},{cN:"string",b:/(u|r|ur)'/,e:/'/,c:[a.BE],r:10},{cN:"string",b:/(u|r|ur)"/,e:/"/,c:[a.BE],r:10},{cN:"string",b:/(b|br)'/,e:/'/,c:[a.BE]},{cN:"string",b:/(b|br)"/,e:/"/,c:[a.BE]}].concat([a.ASM,a.QSM]);var e={cN:"title",b:a.UIR};var d={cN:"params",b:/\(/,e:/\)/,c:["self",a.CNM,f].concat(c)};var b={bWK:true,e:/:/,i:/[${=;\n]/,c:[e,d],r:10};return{k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:c.concat([f,a.HCM,a.inherit(b,{cN:"function",k:"def"}),a.inherit(b,{cN:"class",k:"class"}),a.CNM,{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}])}}(hljs);hljs.LANGUAGES.sql=function(a){return{cI:true,c:[{cN:"operator",b:"(begin|end|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant)\\b(?!:)",e:";",eW:true,k:{keyword:"all partial global month current_timestamp using go revoke smallint indicator end-exec disconnect zone with character assertion to add current_user usage input local alter match collate real then rollback get read timestamp session_user not integer bit unique day minute desc insert execute like ilike|2 level decimal drop continue isolation found where constraints domain right national some module transaction relative second connect escape close system_user for deferred section cast current sqlstate allocate intersect deallocate numeric public preserve full goto initially asc no key output collation group by union session both last language constraint column of space foreign deferrable prior connection unknown action commit view or first into float year primary cascaded except restrict set references names table outer open select size are rows from prepare distinct leading create only next inner authorization schema corresponding option declare precision immediate else timezone_minute external varying translation true case exception join hour default double scroll value cursor descriptor values dec fetch procedure delete and false int is describe char as at in varchar null trailing any absolute current_time end grant privileges when cross check write current_date pad begin temporary exec time update catalog user sql date on identity timezone_hour natural whenever interval work order cascade diagnostics nchar having left call do handler load replace truncate start lock show pragma exists number trigger if before after each row",aggregate:"count sum min max avg"},c:[{cN:"string",b:"'",e:"'",c:[a.BE,{b:"''"}],r:0},{cN:"string",b:'"',e:'"',c:[a.BE,{b:'""'}],r:0},{cN:"string",b:"`",e:"`",c:[a.BE]},a.CNM]},a.CBLCLM,{cN:"comment",b:"--",e:"$"}]}}(hljs);hljs.LANGUAGES.ini=function(a){return{cI:true,i:"[^\\s]",c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:true,k:"on off true false yes no",c:[a.QSM,a.NM],r:0}]}]}}(hljs);hljs.LANGUAGES.perl=function(e){var a="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when";var d={cN:"subst",b:"[$@]\\{",e:"\\}",k:a,r:10};var b={cN:"variable",b:"\\$\\d"};var i={cN:"variable",b:"[\\$\\%\\@\\*](\\^\\w\\b|#\\w+(\\:\\:\\w+)*|[^\\s\\w{]|{\\w+}|\\w+(\\:\\:\\w*)*)"};var f=[e.BE,d,b,i];var h={b:"->",c:[{b:e.IR},{b:"{",e:"}"}]};var g={cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5};var c=[b,i,e.HCM,g,{cN:"comment",b:"^\\=\\w",e:"\\=cut",eW:true},h,{cN:"string",b:"q[qwxr]?\\s*\\(",e:"\\)",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\[",e:"\\]",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\{",e:"\\}",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\|",e:"\\|",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\<",e:"\\>",c:f,r:5},{cN:"string",b:"qw\\s+q",e:"q",c:f,r:5},{cN:"string",b:"'",e:"'",c:[e.BE],r:0},{cN:"string",b:'"',e:'"',c:f,r:0},{cN:"string",b:"`",e:"`",c:[e.BE]},{cN:"string",b:"{\\w+}",r:0},{cN:"string",b:"-?\\w+\\s*\\=\\>",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"("+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,g,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"sub",bWK:true,e:"(\\s*\\(.*?\\))?[;{]",k:"sub",r:5},{cN:"operator",b:"-\\w\\b",r:0}];d.c=c;h.c[1].c=c;return{k:a,c:c}}(hljs);hljs.LANGUAGES.objectivec=function(a){var b={keyword:"int float while private char catch export sizeof typedef const struct for union unsigned long volatile static protected bool mutable if public do return goto void enum else break extern asm case short default double throw register explicit signed typename try this switch continue wchar_t inline readonly assign property self synchronized end synthesize id optional required nonatomic super unichar finally dynamic IBOutlet IBAction selector strong weak readonly",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"NSString NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController UINavigationBar UINavigationController UITabBarController UIPopoverController UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor UIFont UIApplication NSNotFound NSNotificationCenter NSNotification UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection UIInterfaceOrientation MPMoviePlayerController dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"};return{k:b,i:""}]},{cN:"preprocessor",b:"#",e:"$"},{cN:"class",bWK:true,e:"({|$)",k:"interface class protocol implementation",c:[{cN:"id",b:a.UIR}]},{cN:"variable",b:"\\."+a.UIR,r:0}]}}(hljs);hljs.LANGUAGES.coffeescript=function(c){var b={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",reserved:"case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf",built_in:"npm require console print module exports global window document"};var a="[A-Za-z$_][0-9A-Za-z$_]*";var f={cN:"title",b:a};var e={cN:"subst",b:"#\\{",e:"}",k:b,};var d=[c.BNM,c.inherit(c.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",b:"'''",e:"'''",c:[c.BE]},{cN:"string",b:"'",e:"'",c:[c.BE],r:0},{cN:"string",b:'"""',e:'"""',c:[c.BE,e]},{cN:"string",b:'"',e:'"',c:[c.BE,e],r:0},{cN:"regexp",b:"///",e:"///",c:[c.HCM]},{cN:"regexp",b:"//[gim]*",r:0},{cN:"regexp",b:"/\\S(\\\\.|[^\\n])*?/[gim]*(?=\\s|\\W|$)"},{cN:"property",b:"@"+a},{b:"`",e:"`",eB:true,eE:true,sL:"javascript"}];e.c=d;return{k:b,c:d.concat([{cN:"comment",b:"###",e:"###"},c.HCM,{cN:"function",b:"("+a+"\\s*=\\s*)?(\\(.*\\))?\\s*[-=]>",e:"[-=]>",rB:true,c:[f,{cN:"params",b:"\\(",rB:true,c:[{b:/\(/,e:/\)/,k:b,c:["self"].concat(d)}]}]},{cN:"class",bWK:true,k:"class",e:"$",i:"[:\\[\\]]",c:[{bWK:true,k:"extends",eW:true,i:":",c:[f]},f]},{cN:"attribute",b:a+":",e:":",rB:true,eE:true}])}}(hljs);hljs.LANGUAGES.nginx=function(b){var c=[{cN:"variable",b:"\\$\\d+"},{cN:"variable",b:"\\${",e:"}"},{cN:"variable",b:"[\\$\\@]"+b.UIR}];var a={eW:true,l:"[a-z/_]+",k:{built_in:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[b.HCM,{cN:"string",b:'"',e:'"',c:[b.BE].concat(c),r:0},{cN:"string",b:"'",e:"'",c:[b.BE].concat(c),r:0},{cN:"url",b:"([a-z]+):/",e:"\\s",eW:true,eE:true},{cN:"regexp",b:"\\s\\^",e:"\\s|{|;",rE:true,c:[b.BE].concat(c)},{cN:"regexp",b:"~\\*?\\s+",e:"\\s|{|;",rE:true,c:[b.BE].concat(c)},{cN:"regexp",b:"\\*(\\.[a-z\\-]+)+",c:[b.BE].concat(c)},{cN:"regexp",b:"([a-z\\-]+\\.)+\\*",c:[b.BE].concat(c)},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0}].concat(c)};return{c:[b.HCM,{b:b.UIR+"\\s",e:";|{",rB:true,c:[{cN:"title",b:b.UIR,starts:a}],r:0}],i:"[^\\s\\}]"}}(hljs);hljs.LANGUAGES.json=function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}}(hljs);hljs.LANGUAGES.apache=function(a){var b={cN:"number",b:"[\\$%]\\d+"};return{cI:true,c:[a.HCM,{cN:"tag",b:""},{cN:"keyword",b:/\w+/,r:0,k:{common:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"sqbracket",b:"\\s\\[",e:"\\]$"},{cN:"cbracket",b:"[\\$%]\\{",e:"\\}",c:["self",b]},b,a.QSM]}}],i:/\S/}}(hljs);hljs.LANGUAGES.cpp=function(a){var b={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long throw volatile static protected bool template mutable if public friend do return goto auto void enum else break new extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr"};return{k:b,i:"",i:"\\n"},a.CLCM]},{cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:b,r:10,c:["self"]}]}}(hljs);hljs.LANGUAGES.makefile=function(a){var b={cN:"variable",b:/\$\(/,e:/\)/,c:a.BE};return{c:[a.HCM,{b:/^\w+\s*\W*=/,rB:true,r:0,starts:{cN:"constant",e:/\s*\W*=/,eE:true,starts:{e:/$/,r:0,c:[b],}}},{cN:"title",b:/^[\w]+:\s*$/},{cN:"phony",b:/^\.PHONY:/,e:/$/,k:".PHONY",l:/[\.\w]+/},{b:/^\t+/,e:/$/,c:[a.QSM,b]}]}}(hljs); -------------------------------------------------------------------------------- /template/public/html5shiv.js: -------------------------------------------------------------------------------- 1 | /* 2 | HTML5 Shiv v3.6.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); 5 | a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x"; 6 | c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| 7 | "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video",version:"3.6.2",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment(); 8 | for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d *:first-child { 306 | margin-top: 0 !important; 307 | } 308 | 309 | & > *:last-child { 310 | margin-bottom: 0 !important; 311 | } 312 | 313 | pre { 314 | background-color: #f8f8f8; 315 | border: 1px solid #ddd; 316 | font-size: 13px; 317 | line-height: 19px; 318 | overflow: auto; 319 | padding: 6px 10px; 320 | border-radius: 3px; 321 | word-wrap:normal; 322 | 323 | code,tt { 324 | background-color:transparent; 325 | border:none; 326 | word-wrap:normal; 327 | margin:0; 328 | padding:0; 329 | } 330 | } 331 | 332 | code,tt { 333 | margin: 0 2px; 334 | padding: 0px 5px; 335 | border: 1px solid #ddd; 336 | background-color: #f8f8f8; 337 | border-radius: 3px; 338 | } 339 | 340 | h1 { 341 | font-size: 2.5em; 342 | border-bottom: 1px solid #ddd; 343 | } 344 | 345 | h2 { 346 | font-size: 2em; 347 | border-bottom: 1px solid #eee; 348 | } 349 | 350 | h3 { 351 | font-size: 1.5em; 352 | } 353 | 354 | h4 { 355 | font-size: 1em; 356 | } 357 | 358 | } 359 | 360 | 361 | 362 | .styleguide-example { 363 | margin: 15px auto; 364 | background: rgba(255,255,255,0.5); 365 | border: 1px solid #ddd; 366 | box-shadow: 0 0 5px rgba(0,0,0,0.1); 367 | 368 | &:first-child { 369 | margin-top: 0; 370 | } 371 | 372 | & > .styleguide-example-header { 373 | h3 { 374 | margin: -1px -1px 0; 375 | padding: 10px; 376 | color: #fff; 377 | font-size: 12px; 378 | text-transform: uppercase; 379 | background: #333; 380 | border-top: 1px solid #000; 381 | 382 | em { 383 | float: right; 384 | text-transform: none; 385 | font-style: normal; 386 | font-weight: normal; 387 | color: #999; 388 | line-height: 1; 389 | } 390 | } 391 | } 392 | 393 | .styleguide-description { 394 | padding: 15px 10px; 395 | background: #f1f1f1; 396 | border-bottom: 1px solid #ddd; 397 | 398 | p:first-child { 399 | margin-top: 0; 400 | } 401 | 402 | p:last-child { 403 | margin-bottom: 0; 404 | } 405 | 406 | code, tt { 407 | margin: 0 2px; 408 | padding: 0px 5px; 409 | border: 1px solid #ddd; 410 | background-color: #f8f8f8; 411 | border-radius: 3px; 412 | } 413 | } 414 | 415 | .styleguide-element { 416 | position: relative; 417 | padding: 20px; 418 | 419 | & + .styleguide-element { 420 | margin-top: -5px; 421 | padding-top: 15px; 422 | border-top: 1px solid #eee; 423 | } 424 | 425 | .styleguide-modifier-name { 426 | display: block; 427 | position: absolute; 428 | top: 0; 429 | right: 0; 430 | padding: 5px 15px; 431 | margin: 0; 432 | font-size: 11px; 433 | color: #999; 434 | background: #f9f9f9; 435 | border: 1px solid #eee; 436 | border-top: none; 437 | } 438 | } 439 | 440 | .styleguide-html { 441 | padding: 15px 15px; 442 | background: #edf6f8; 443 | border-top: 1px solid #dde7ea; 444 | overflow: auto; 445 | 446 | .styleguide-html-highlight { 447 | background: none; 448 | } 449 | } 450 | } 451 | 452 | ul.styleguide-modifier { 453 | list-style-type: disc; 454 | li { 455 | strong { 456 | font-weight: bold; 457 | } 458 | p { 459 | display: inline; 460 | margin: 0; 461 | } 462 | } 463 | } 464 | 465 | .styleguide-footer { 466 | position: relative; 467 | margin-top: 40px; 468 | padding-top: 40px; 469 | padding-bottom: 40px; 470 | font-size: 12px; 471 | line-height: 1.5; 472 | color: #777; 473 | border-top: 1px solid #eee; 474 | 475 | p{ 476 | margin: 0; 477 | 478 | &:first-child { 479 | float: left; 480 | } 481 | &:last-child { 482 | float: right; 483 | } 484 | } 485 | } 486 | } 487 | 488 | @import "github.css"; -------------------------------------------------------------------------------- /template/public/styleguide.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | hljs.initHighlightingOnLoad(); 3 | 4 | var ref = $('.styleguide-menu').find('.styleguide-menu-list').data('kss-ref'); 5 | $('.styleguide-menu').find('a').eq(ref).addClass('selected'); 6 | }); --------------------------------------------------------------------------------