Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 4a0f3d0

Browse files
XhmikosRnschonni
authored andcommitted
docs: README formatting and spelling fixes (#2063)
Fix a couple of typos and minor Markdown tweaks.
1 parent 5392533 commit 4a0f3d0

File tree

1 file changed

+74
-39
lines changed

1 file changed

+74
-39
lines changed

README.md

Lines changed: 74 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ It allows you to natively compile .scss files to css at incredible speed and aut
3030

3131
Find it on npm: <https://www.npmjs.com/package/node-sass>
3232

33-
Follow @nodesass on twitter for release updates: https://twitter.com/nodesass
33+
Follow @nodesass on twitter for release updates: <https://twitter.com/nodesass>
3434

3535
## Install
3636

@@ -40,7 +40,7 @@ npm install node-sass
4040

4141
Some users have reported issues installing on Ubuntu due to `node` being registered to another package. [Follow the official NodeJS docs](https://github.com/nodejs/node-v0.x-archive/wiki/Installing-Node.js-via-package-manager) to install NodeJS so that `#!/usr/bin/env node` correctly resolved.
4242

43-
Compiling on Windows machines requires the [node-gyp prerequisits](https://github.com/nodejs/node-gyp#on-windows).
43+
Compiling on Windows machines requires the [node-gyp prerequisites](https://github.com/nodejs/node-gyp#on-windows).
4444

4545
**Having installation troubles? Check out our [Troubleshooting guide](/TROUBLESHOOTING.md).**
4646

@@ -60,16 +60,21 @@ var result = sass.renderSync({
6060
```
6161

6262
## Options
63+
6364
### file
64-
Type: `String`
65-
Default: `null`
65+
66+
* Type: `String`
67+
* Default: `null`
68+
6669
**Special**: `file` or `data` must be specified
6770

6871
Path to a file for [LibSass] to render.
6972

7073
### data
71-
Type: `String`
72-
Default: `null`
74+
75+
* Type: `String`
76+
* Default: `null`
77+
7378
**Special**: `file` or `data` must be specified
7479

7580
A string to pass to [LibSass] to render. It is recommended that you use `includePaths` in conjunction with this so that [LibSass] can find files when using the `@import` directive.
@@ -78,10 +83,11 @@ A string to pass to [LibSass] to render. It is recommended that you use `include
7883

7984
**This is an experimental LibSass feature. Use with caution.**
8085

81-
Type: `Function | Function[]` signature `function(url, prev, done)`
82-
Default: `undefined`
86+
* Type: `Function | Function[]` signature `function(url, prev, done)`
87+
* Default: `undefined`
8388

8489
Function Parameters and Information:
90+
8591
* `url (String)` - the path in import **as-is**, which [LibSass] encountered
8692
* `prev (String)` - the previously resolved path
8793
* `done (Function)` - a callback function to invoke on async completion, takes an object literal containing
@@ -115,13 +121,16 @@ Starting from v3.0.0:
115121
`functions` is an `Object` that holds a collection of custom functions that may be invoked by the sass files being compiled. They may take zero or more input parameters and must return a value either synchronously (`return ...;`) or asynchronously (`done();`). Those parameters will be instances of one of the constructors contained in the `require('node-sass').types` hash. The return value must be of one of these types as well. See the list of available types below:
116122

117123
#### types.Number(value [, unit = ""])
124+
118125
* `getValue()`/ `setValue(value)` : gets / sets the numerical portion of the number
119126
* `getUnit()` / `setUnit(unit)` : gets / sets the unit portion of the number
120127

121128
#### types.String(value)
129+
122130
* `getValue()` / `setValue(value)` : gets / sets the enclosed string
123131

124132
#### types.Color(r, g, b [, a = 1.0]) or types.Color(argb)
133+
125134
* `getR()` / `setR(value)` : red component (integer from `0` to `255`)
126135
* `getG()` / `setG(value)` : green component (integer from `0` to `255`)
127136
* `getB()` / `setB(value)` : blue component (integer from `0` to `255`)
@@ -136,21 +145,25 @@ var Color = require('node-sass').types.Color,
136145
```
137146

138147
#### types.Boolean(value)
148+
139149
* `getValue()` : gets the enclosed boolean
140150
* `types.Boolean.TRUE` : Singleton instance of `types.Boolean` that holds "true"
141151
* `types.Boolean.FALSE` : Singleton instance of `types.Boolean` that holds "false"
142152

143153
#### types.List(length [, commaSeparator = true])
154+
144155
* `getValue(index)` / `setValue(index, value)` : `value` must itself be an instance of one of the constructors in `sass.types`.
145156
* `getSeparator()` / `setSeparator(isComma)` : whether to use commas as a separator
146157
* `getLength()`
147158

148159
#### types.Map(length)
160+
149161
* `getKey(index)` / `setKey(index, value)`
150162
* `getValue(index)` / `setValue(index, value)`
151163
* `getLength()`
152164

153165
#### types.Null()
166+
154167
* `types.Null.NULL` : Singleton instance of `types.Null`.
155168

156169
#### Example
@@ -174,55 +187,65 @@ sass.renderSync({
174187
```
175188

176189
### includePaths
177-
Type: `Array<String>`
178-
Default: `[]`
190+
191+
* Type: `Array<String>`
192+
* Default: `[]`
179193

180194
An array of paths that [LibSass] can look in to attempt to resolve your `@import` declarations. When using `data`, it is recommended that you use this.
181195

182196
### indentedSyntax
183-
Type: `Boolean`
184-
Default: `false`
197+
198+
* Type: `Boolean`
199+
* Default: `false`
185200

186201
`true` values enable [Sass Indented Syntax](http://sass-lang.com/documentation/file.INDENTED_SYNTAX.html) for parsing the data string or file.
187202

188203
__Note:__ node-sass/libsass will compile a mixed library of scss and indented syntax (.sass) files with the Default setting (false) as long as .sass and .scss extensions are used in filenames.
189204

190205
### indentType (>= v3.0.0)
191-
Type: `String`
192-
Default: `space`
206+
207+
* Type: `String`
208+
* Default: `space`
193209

194210
Used to determine whether to use space or tab character for indentation.
195211

196212
### indentWidth (>= v3.0.0)
197-
Type: `Number`
198-
Default: `2`
199-
Maximum: `10`
213+
214+
* Type: `Number`
215+
* Default: `2`
216+
* Maximum: `10`
200217

201218
Used to determine the number of spaces or tabs to be used for indentation.
202219

203220
### linefeed (>= v3.0.0)
204-
Type: `String`
205-
Default: `lf`
221+
222+
* Type: `String`
223+
* Default: `lf`
206224

207225
Used to determine whether to use `cr`, `crlf`, `lf` or `lfcr` sequence for line break.
208226

209227
### omitSourceMapUrl
210-
Type: `Boolean`
211-
Default: `false`
228+
229+
* Type: `Boolean`
230+
* Default: `false`
231+
212232
**Special:** When using this, you should also specify `outFile` to avoid unexpected behavior.
213233

214234
`true` values disable the inclusion of source map information in the output file.
215235

216236
### outFile
217-
Type: `String | null`
218-
Default: `null`
237+
238+
* Type: `String | null`
239+
* Default: `null`
240+
219241
**Special:** Required when `sourceMap` is a truthy value
220242

221243
Specify the intended location of the output file. Strongly recommended when outputting source maps so that they can properly refer back to their intended files.
222244

223245
**Attention** enabling this option will **not** write the file on disk for you, it's for internal reference purpose only (to generate the map for example).
224246

225247
Example on how to write it on the disk
248+
226249
```javascript
227250
sass.render({
228251
...
@@ -241,60 +264,71 @@ sass.render({
241264
```
242265

243266
### outputStyle
244-
Type: `String`
245-
Default: `nested`
246-
Values: `nested`, `expanded`, `compact`, `compressed`
267+
268+
* Type: `String`
269+
* Default: `nested`
270+
* Values: `nested`, `expanded`, `compact`, `compressed`
247271

248272
Determines the output format of the final CSS style.
249273

250274
### precision
251-
Type: `Integer`
252-
Default: `5`
275+
276+
* Type: `Integer`
277+
* Default: `5`
253278

254279
Used to determine how many digits after the decimal will be allowed. For instance, if you had a decimal number of `1.23456789` and a precision of `5`, the result will be `1.23457` in the final CSS.
255280

256281
### sourceComments
257-
Type: `Boolean`
258-
Default: `false`
282+
283+
* Type: `Boolean`
284+
* Default: `false`
259285

260286
`true` Enables the line number and file where a selector is defined to be emitted into the compiled CSS as a comment. Useful for debugging, especially when using imports and mixins.
261287

262288
### sourceMap
263-
Type: `Boolean | String | undefined`
264-
Default: `undefined`
289+
290+
* Type: `Boolean | String | undefined`
291+
* Default: `undefined`
292+
265293
**Special:** Setting the `sourceMap` option requires also setting the `outFile` option
266294

267295
Enables the outputting of a source map during `render` and `renderSync`. When `sourceMap === true`, the value of `outFile` is used as the target output location for the source map. When `typeof sourceMap === "string"`, the value of `sourceMap` will be used as the writing location for the file.
268296

269297
### sourceMapContents
270-
Type: `Boolean`
271-
Default: `false`
298+
299+
* Type: `Boolean`
300+
* Default: `false`
272301

273302
`true` includes the `contents` in the source map information
274303

275304
### sourceMapEmbed
276-
Type: `Boolean`
277-
Default: `false`
305+
306+
* Type: `Boolean`
307+
* Default: `false`
278308

279309
`true` embeds the source map as a data URI
280310

281311
### sourceMapRoot
282-
Type: `String`
283-
Default: `undefined`
312+
313+
* Type: `String`
314+
* Default: `undefined`
284315

285316
the value will be emitted as `sourceRoot` in the source map information
286317

287318
## `render` Callback (>= v3.0.0)
319+
288320
node-sass supports standard node style asynchronous callbacks with the signature of `function(err, result)`. In error conditions, the `error` argument is populated with the error object. In success conditions, the `result` object is populated with an object describing the result of the render call.
289321

290322
### Error Object
323+
291324
* `message` (String) - The error message.
292325
* `line` (Number) - The line number of error.
293326
* `column` (Number) - The column number of error.
294327
* `status` (Number) - The status code.
295328
* `file` (String) - The filename of error. In case `file` option was not set (in favour of `data`), this will reflect the value `stdin`.
296329

297330
### Result Object
331+
298332
* `css` (Buffer) - The compiled CSS. Write this to a file, or serve it out as needed.
299333
* `map` (Buffer) - The source map
300334
* `stats` (Object) - An object containing information about the compile. It contains the following keys:
@@ -359,7 +393,7 @@ var result = sass.renderSync({
359393
// this.options contains this options hash
360394
someAsyncFunction(url, prev, function(result){
361395
done({
362-
file: result.path, // only one of them is required, see section Sepcial Behaviours.
396+
file: result.path, // only one of them is required, see section Special Behaviours.
363397
contents: result.data
364398
});
365399
});
@@ -474,6 +508,7 @@ The interface for command-line usage is fairly simplistic at this stage, as seen
474508
Output will be sent to stdout if the `--output` flag is omitted.
475509

476510
### Usage
511+
477512
`node-sass [options] <input> [output]`
478513
Or:
479514
`cat <input> | node-sass > output`

0 commit comments

Comments
 (0)