nytimes-style 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +4 -2
- data/docco.css +185 -0
- data/index.html +19 -12
- data/lib/nytimes-style/states.yml +4 -0
- data/lib/nytimes-style/version.rb +1 -1
- data/nytimes-style.gemspec +2 -2
- metadata +25 -32
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d67b63a72e3be7cea0a78c9f14c5eb80a81de678
|
4
|
+
data.tar.gz: c03fce233caa03365e035c779fcb390ae61c63ab
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e8aa049e66431b3cadca8f5d9cf2b408687a67c94d35964bb67ea9ecd7a7acd0f58b8a9910cfae36c790689a60bbd8fe01538d65f9783e1db5fc2bb64012bce5
|
7
|
+
data.tar.gz: bd48ab48f850f70bf99a0c26acf8ffd3b92bd1a5d6e5180649e7f2474c8f830d11734f796ebc6481f3d0ee9e0ecbd11efdb4add9945ddb4f098972f8625f061d
|
data/README.rdoc
CHANGED
@@ -28,8 +28,10 @@ Annotated source code: http://ascheink.github.com/nytimes-style
|
|
28
28
|
>> nytimes_state_name '55'
|
29
29
|
# => "Wisconsin"
|
30
30
|
|
31
|
-
==
|
31
|
+
== CONTRIBUTORS
|
32
32
|
|
33
33
|
Andrei Scheinkman, andreischeinkman@gmail.com
|
34
34
|
|
35
|
-
Tyson Evans, tyson.evans@nytimes.com
|
35
|
+
Tyson Evans, tyson.evans@nytimes.com
|
36
|
+
|
37
|
+
Derek Willis, dwillis@nytimes.com
|
data/docco.css
ADDED
@@ -0,0 +1,185 @@
|
|
1
|
+
/*--------------------- Layout and Typography ----------------------------*/
|
2
|
+
body {
|
3
|
+
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
|
4
|
+
font-size: 16px;
|
5
|
+
line-height: 24px;
|
6
|
+
color: #252519;
|
7
|
+
margin: 0; padding: 0;
|
8
|
+
}
|
9
|
+
a {
|
10
|
+
color: #261a3b;
|
11
|
+
}
|
12
|
+
a:visited {
|
13
|
+
color: #261a3b;
|
14
|
+
}
|
15
|
+
p {
|
16
|
+
margin: 0 0 15px 0;
|
17
|
+
}
|
18
|
+
h1, h2, h3, h4, h5, h6 {
|
19
|
+
margin: 40px 0 15px 0;
|
20
|
+
}
|
21
|
+
h3, h4, h5, h6 {
|
22
|
+
margin-top: 20px;
|
23
|
+
}
|
24
|
+
#container {
|
25
|
+
position: relative;
|
26
|
+
}
|
27
|
+
#background {
|
28
|
+
position: fixed;
|
29
|
+
top: 0; left: 580px; right: 0; bottom: 0;
|
30
|
+
background: #f5f5ff;
|
31
|
+
border-left: 1px solid #e5e5ee;
|
32
|
+
z-index: -1;
|
33
|
+
}
|
34
|
+
#jump_to, #jump_page {
|
35
|
+
background: white;
|
36
|
+
-webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
|
37
|
+
-webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
|
38
|
+
font: 10px Arial;
|
39
|
+
text-transform: uppercase;
|
40
|
+
cursor: pointer;
|
41
|
+
text-align: right;
|
42
|
+
}
|
43
|
+
#jump_to, #jump_wrapper {
|
44
|
+
position: fixed;
|
45
|
+
right: 0; top: 0;
|
46
|
+
padding: 5px 10px;
|
47
|
+
}
|
48
|
+
#jump_wrapper {
|
49
|
+
padding: 0;
|
50
|
+
display: none;
|
51
|
+
}
|
52
|
+
#jump_to:hover #jump_wrapper {
|
53
|
+
display: block;
|
54
|
+
}
|
55
|
+
#jump_page {
|
56
|
+
padding: 5px 0 3px;
|
57
|
+
margin: 0 0 25px 25px;
|
58
|
+
}
|
59
|
+
#jump_page .source {
|
60
|
+
display: block;
|
61
|
+
padding: 5px 10px;
|
62
|
+
text-decoration: none;
|
63
|
+
border-top: 1px solid #eee;
|
64
|
+
}
|
65
|
+
#jump_page .source:hover {
|
66
|
+
background: #f5f5ff;
|
67
|
+
}
|
68
|
+
#jump_page .source:first-child {
|
69
|
+
}
|
70
|
+
table td {
|
71
|
+
border: 0;
|
72
|
+
outline: 0;
|
73
|
+
}
|
74
|
+
td.docs, th.docs {
|
75
|
+
max-width: 500px;
|
76
|
+
min-width: 500px;
|
77
|
+
min-height: 5px;
|
78
|
+
padding: 10px 25px 1px 50px;
|
79
|
+
vertical-align: top;
|
80
|
+
text-align: left;
|
81
|
+
}
|
82
|
+
.docs pre {
|
83
|
+
margin: 15px 0 15px;
|
84
|
+
padding-left: 15px;
|
85
|
+
}
|
86
|
+
.docs p tt, .docs p code {
|
87
|
+
background: #f8f8ff;
|
88
|
+
border: 1px solid #dedede;
|
89
|
+
font-size: 12px;
|
90
|
+
padding: 0 0.2em;
|
91
|
+
}
|
92
|
+
.octowrap {
|
93
|
+
position: relative;
|
94
|
+
}
|
95
|
+
.octothorpe {
|
96
|
+
font: 12px Arial;
|
97
|
+
text-decoration: none;
|
98
|
+
color: #454545;
|
99
|
+
position: absolute;
|
100
|
+
top: 3px; left: -20px;
|
101
|
+
padding: 1px 2px;
|
102
|
+
opacity: 0;
|
103
|
+
-webkit-transition: opacity 0.2s linear;
|
104
|
+
}
|
105
|
+
td.docs:hover .octothorpe {
|
106
|
+
opacity: 1;
|
107
|
+
}
|
108
|
+
td.code, th.code {
|
109
|
+
padding: 14px 15px 16px 50px;
|
110
|
+
width: 100%;
|
111
|
+
vertical-align: top;
|
112
|
+
background: #f5f5ff;
|
113
|
+
border-left: 1px solid #e5e5ee;
|
114
|
+
}
|
115
|
+
pre, tt, code {
|
116
|
+
font-size: 12px; line-height: 18px;
|
117
|
+
font-family: Monaco, Consolas, "Lucida Console", monospace;
|
118
|
+
margin: 0; padding: 0;
|
119
|
+
}
|
120
|
+
|
121
|
+
|
122
|
+
/*---------------------- Syntax Highlighting -----------------------------*/
|
123
|
+
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
|
124
|
+
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
|
125
|
+
body .hll { background-color: #ffffcc }
|
126
|
+
body .c { color: #408080; font-style: italic } /* Comment */
|
127
|
+
body .err { border: 1px solid #FF0000 } /* Error */
|
128
|
+
body .k { color: #954121 } /* Keyword */
|
129
|
+
body .o { color: #666666 } /* Operator */
|
130
|
+
body .cm { color: #408080; font-style: italic } /* Comment.Multiline */
|
131
|
+
body .cp { color: #BC7A00 } /* Comment.Preproc */
|
132
|
+
body .c1 { color: #408080; font-style: italic } /* Comment.Single */
|
133
|
+
body .cs { color: #408080; font-style: italic } /* Comment.Special */
|
134
|
+
body .gd { color: #A00000 } /* Generic.Deleted */
|
135
|
+
body .ge { font-style: italic } /* Generic.Emph */
|
136
|
+
body .gr { color: #FF0000 } /* Generic.Error */
|
137
|
+
body .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
138
|
+
body .gi { color: #00A000 } /* Generic.Inserted */
|
139
|
+
body .go { color: #808080 } /* Generic.Output */
|
140
|
+
body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
|
141
|
+
body .gs { font-weight: bold } /* Generic.Strong */
|
142
|
+
body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
143
|
+
body .gt { color: #0040D0 } /* Generic.Traceback */
|
144
|
+
body .kc { color: #954121 } /* Keyword.Constant */
|
145
|
+
body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */
|
146
|
+
body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */
|
147
|
+
body .kp { color: #954121 } /* Keyword.Pseudo */
|
148
|
+
body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */
|
149
|
+
body .kt { color: #B00040 } /* Keyword.Type */
|
150
|
+
body .m { color: #666666 } /* Literal.Number */
|
151
|
+
body .s { color: #219161 } /* Literal.String */
|
152
|
+
body .na { color: #7D9029 } /* Name.Attribute */
|
153
|
+
body .nb { color: #954121 } /* Name.Builtin */
|
154
|
+
body .nc { color: #0000FF; font-weight: bold } /* Name.Class */
|
155
|
+
body .no { color: #880000 } /* Name.Constant */
|
156
|
+
body .nd { color: #AA22FF } /* Name.Decorator */
|
157
|
+
body .ni { color: #999999; font-weight: bold } /* Name.Entity */
|
158
|
+
body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
|
159
|
+
body .nf { color: #0000FF } /* Name.Function */
|
160
|
+
body .nl { color: #A0A000 } /* Name.Label */
|
161
|
+
body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
|
162
|
+
body .nt { color: #954121; font-weight: bold } /* Name.Tag */
|
163
|
+
body .nv { color: #19469D } /* Name.Variable */
|
164
|
+
body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
|
165
|
+
body .w { color: #bbbbbb } /* Text.Whitespace */
|
166
|
+
body .mf { color: #666666 } /* Literal.Number.Float */
|
167
|
+
body .mh { color: #666666 } /* Literal.Number.Hex */
|
168
|
+
body .mi { color: #666666 } /* Literal.Number.Integer */
|
169
|
+
body .mo { color: #666666 } /* Literal.Number.Oct */
|
170
|
+
body .sb { color: #219161 } /* Literal.String.Backtick */
|
171
|
+
body .sc { color: #219161 } /* Literal.String.Char */
|
172
|
+
body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */
|
173
|
+
body .s2 { color: #219161 } /* Literal.String.Double */
|
174
|
+
body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
|
175
|
+
body .sh { color: #219161 } /* Literal.String.Heredoc */
|
176
|
+
body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
|
177
|
+
body .sx { color: #954121 } /* Literal.String.Other */
|
178
|
+
body .sr { color: #BB6688 } /* Literal.String.Regex */
|
179
|
+
body .s1 { color: #219161 } /* Literal.String.Single */
|
180
|
+
body .ss { color: #19469D } /* Literal.String.Symbol */
|
181
|
+
body .bp { color: #954121 } /* Name.Builtin.Pseudo */
|
182
|
+
body .vc { color: #19469D } /* Name.Variable.Class */
|
183
|
+
body .vg { color: #19469D } /* Name.Variable.Global */
|
184
|
+
body .vi { color: #19469D } /* Name.Variable.Instance */
|
185
|
+
body .il { color: #666666 } /* Literal.Number.Integer.Long */
|
data/index.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<head>
|
4
4
|
<meta http-equiv="content-type" content="text/html;charset=utf-8">
|
5
5
|
<title>nytimes-style.rb</title>
|
6
|
-
<link rel="stylesheet" href="
|
6
|
+
<link rel="stylesheet" href="docco.css">
|
7
7
|
</head>
|
8
8
|
<body>
|
9
9
|
<div id='container'>
|
@@ -47,11 +47,13 @@ hosted on <a href="https://github.com/ascheink/nytimes-style">Github</a>.</p>
|
|
47
47
|
<div class="pilwrap">
|
48
48
|
<a class="pilcrow" href="#section-3">¶</a>
|
49
49
|
</div>
|
50
|
-
<blockquote
|
50
|
+
<blockquote>
|
51
|
+
<p>“In general, spell out the first nine cardinal and
|
51
52
|
ordinal numbers [but] spell any number that begins a sentence…”
|
52
|
-
Exceptions include “ages of people
|
53
|
-
and animals,” “sums of money,” “degrees of temperature” and “mentions of the Twelve
|
54
|
-
Apostles and the Ten Commandments.”</p
|
53
|
+
Exceptions include “ages of people
|
54
|
+
and animals,” “sums of money,” “degrees of temperature” and “mentions of the Twelve
|
55
|
+
Apostles and the Ten Commandments.”</p>
|
56
|
+
</blockquote>
|
55
57
|
</td>
|
56
58
|
<td class=code>
|
57
59
|
<div class='highlight'><pre> <span class="k">def</span> <span class="nf">nytimes_number</span><span class="p">(</span><span class="n">n</span><span class="p">)</span>
|
@@ -68,10 +70,12 @@ Apostles and the Ten Commandments.”</p></blockquote>
|
|
68
70
|
<div class="pilwrap">
|
69
71
|
<a class="pilcrow" href="#section-4">¶</a>
|
70
72
|
</div>
|
71
|
-
<blockquote
|
73
|
+
<blockquote>
|
74
|
+
<p>“Abbreviate the names of months from August through
|
72
75
|
February in news copy when they are followed by numerals: Aug. 1; Sept.
|
73
76
|
2; Oct. 3; Nov. 4; Dec. 5; Jan. 6; Feb. 7. Do not abbreviate March,
|
74
|
-
April, May, June and July except as a last resort in a chart or table.”</p
|
77
|
+
April, May, June and July except as a last resort in a chart or table.”</p>
|
78
|
+
</blockquote>
|
75
79
|
</td>
|
76
80
|
<td class=code>
|
77
81
|
<div class='highlight'><pre> <span class="k">def</span> <span class="nf">nytimes_date</span><span class="p">(</span><span class="n">date</span><span class="p">,</span> <span class="n">opts</span><span class="o">=</span><span class="p">{})</span>
|
@@ -98,9 +102,11 @@ April, May, June and July except as a last resort in a chart or table.”</p
|
|
98
102
|
<div class="pilwrap">
|
99
103
|
<a class="pilcrow" href="#section-5">¶</a>
|
100
104
|
</div>
|
101
|
-
<blockquote
|
105
|
+
<blockquote>
|
106
|
+
<p>“Use numerals in giving clock time: 10:30 a.m.; 10:30.
|
102
107
|
Do not use half-past 10 except in a direct quotation.
|
103
|
-
Also avoid the redundant 10:30 a.m. yesterday morning and Monday afternoon at 2 p.m.”</p
|
108
|
+
Also avoid the redundant 10:30 a.m. yesterday morning and Monday afternoon at 2 p.m.”</p>
|
109
|
+
</blockquote>
|
104
110
|
</td>
|
105
111
|
<td class=code>
|
106
112
|
<div class='highlight'><pre> <span class="k">def</span> <span class="nf">nytimes_time</span><span class="p">(</span><span class="n">time</span><span class="p">,</span> <span class="n">opts</span><span class="o">=</span><span class="p">{})</span>
|
@@ -117,12 +123,13 @@ Also avoid the redundant 10:30 a.m. yesterday morning and Monday afternoon at 2
|
|
117
123
|
<div class="pilwrap">
|
118
124
|
<a class="pilcrow" href="#section-6">¶</a>
|
119
125
|
</div>
|
120
|
-
<blockquote
|
126
|
+
<blockquote>
|
127
|
+
<p>“The abbreviation to be used for each state, after the names of cities,
|
121
128
|
towns and counties… Use no
|
122
129
|
spaces between initials like N.H. Do not abbreviate Alaska, Hawaii, Idaho,
|
123
130
|
Iowa, Ohio and Utah. (Do not ordinarily use the Postal Service’s
|
124
|
-
two-letter abbreviations; some are hard to tell apart on quick reading.)”</p
|
125
|
-
|
131
|
+
two-letter abbreviations; some are hard to tell apart on quick reading.)”</p>
|
132
|
+
</blockquote>
|
126
133
|
</td>
|
127
134
|
<td class=code>
|
128
135
|
<div class='highlight'><pre> <span class="k">def</span> <span class="nf">nytimes_state_abbrev</span><span class="p">(</span><span class="n">state_name_or_code</span><span class="p">)</span>
|
data/nytimes-style.gemspec
CHANGED
@@ -6,8 +6,8 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = "nytimes-style"
|
7
7
|
s.version = Nytimes::Style::VERSION
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = ["Andrei Scheinkman", "Tyson Evans"]
|
10
|
-
s.email = ["andrei@nytimes.com", "tyson.evans@nytimes.com"]
|
9
|
+
s.authors = ["Andrei Scheinkman", "Tyson Evans", "Derek Willis"]
|
10
|
+
s.email = ["andrei@nytimes.com", "tyson.evans@nytimes.com", "dwillis@nytimes.com"]
|
11
11
|
s.homepage = "http://github.com/ascheink/nytimes-style"
|
12
12
|
s.summary = %q{New York Times style}
|
13
13
|
s.description = %q{Format numbers and dates according to The New York Times Manual of Style}
|
metadata
CHANGED
@@ -1,33 +1,30 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: nytimes-style
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 0.5.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.0
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
6
|
+
authors:
|
8
7
|
- Andrei Scheinkman
|
9
8
|
- Tyson Evans
|
9
|
+
- Derek Willis
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
|
14
|
-
date: 2011-07-13 00:00:00 Z
|
13
|
+
date: 2013-03-14 00:00:00.000000000 Z
|
15
14
|
dependencies: []
|
16
|
-
|
17
15
|
description: Format numbers and dates according to The New York Times Manual of Style
|
18
|
-
email:
|
16
|
+
email:
|
19
17
|
- andrei@nytimes.com
|
20
18
|
- tyson.evans@nytimes.com
|
19
|
+
- dwillis@nytimes.com
|
21
20
|
executables: []
|
22
|
-
|
23
21
|
extensions: []
|
24
|
-
|
25
22
|
extra_rdoc_files: []
|
26
|
-
|
27
|
-
files:
|
23
|
+
files:
|
28
24
|
- .gitignore
|
29
25
|
- README.rdoc
|
30
26
|
- Rakefile
|
27
|
+
- docco.css
|
31
28
|
- index.html
|
32
29
|
- lib/nytimes-style.rb
|
33
30
|
- lib/nytimes-style/states.yml
|
@@ -36,30 +33,26 @@ files:
|
|
36
33
|
- test/test_nytimes_style.rb
|
37
34
|
homepage: http://github.com/ascheink/nytimes-style
|
38
35
|
licenses: []
|
39
|
-
|
36
|
+
metadata: {}
|
40
37
|
post_install_message:
|
41
38
|
rdoc_options: []
|
42
|
-
|
43
|
-
require_paths:
|
39
|
+
require_paths:
|
44
40
|
- lib
|
45
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: "0"
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ! '>='
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
57
51
|
requirements: []
|
58
|
-
|
59
52
|
rubyforge_project:
|
60
|
-
rubygems_version:
|
53
|
+
rubygems_version: 2.0.3
|
61
54
|
signing_key:
|
62
|
-
specification_version:
|
55
|
+
specification_version: 4
|
63
56
|
summary: New York Times style
|
64
|
-
test_files:
|
57
|
+
test_files:
|
65
58
|
- test/test_nytimes_style.rb
|