Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 8fd9899

Browse files
committed
coffeescript coloration
1 parent eceda48 commit 8fd9899

File tree

2 files changed

+11
-23
lines changed

2 files changed

+11
-23
lines changed

extending.rst

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
Extending
55
=========
66

7-
Sometimes it can be convenient to add your own methods to a ``Casper``
8-
object instance; you can easily do so as illustrated in the example
9-
below:
10-
11-
::
7+
Sometimes it can be convenient to add your own methods to a ``Casper`` object instance; you can easily do so as illustrated in the example below::
128

139
var casper = require('casper').create({
1410
verbose: true,
@@ -44,12 +40,7 @@ below:
4440
this.renderJSON(links).exit();
4541
});
4642

47-
But that's just plain old *monkey-patching* the ``casper`` object, and
48-
you may probably want a more OO approach… That's where the
49-
``inherits()`` function from the ``utils`` module and ported from
50-
`nodejs <http://nodejs.org/>`_ comes handy:
51-
52-
::
43+
But that's just plain old *monkey-patching* the ``casper`` object, and you may probably want a more OO approach… That's where the ``inherits()`` function from the ``utils`` module and ported from `nodejs <http://nodejs.org/>`_ comes handy::
5344

5445
var Casper = require('casper').Casper;
5546
var utils = require('utils');
@@ -95,23 +86,20 @@ you may probably want a more OO approach… That's where the
9586
this.renderJSON(links).exit();
9687
});
9788

98-
Note the use of the ``super_`` child class property which becomes
99-
available once its parent has been defined using ``inherits()``; it
100-
contains a reference to the parent constructor. **Don't forget to call
101-
``Casper``'s parent constructor!**
89+
.. note::
90+
91+
The use of the ``super_`` child class property which becomes available once its parent has been defined using ``inherits()``; it contains a reference to the parent constructor.
92+
93+
**Don't forget to call ``Casper``'s parent constructor!**
10294

103-
Note Of course this approach is bit more verbose than the easy
104-
*monkey-patching* one, so please ensure you're not just overengineering
105-
stuff by subclassing the ``Casper`` class.
95+
Note Of course this approach is bit more verbose than the easy *monkey-patching* one, so please ensure you're not just overengineering stuff by subclassing the ``Casper`` class.
10696

10797
Using CoffeeScript
10898
~~~~~~~~~~~~~~~~~~
10999

110-
If you're writing your casper scripts using
111-
`CoffeeScript <http://coffeescript.org/>`_, extending casper is getting
112-
a bit straightforward:
100+
If you're writing your casper scripts using `CoffeeScript <http://coffeescript.org/>`_, extending casper is getting a bit more straightforward:
113101

114-
::
102+
.. code-block:: coffeescript
115103
116104
links =
117105
'http://edition.cnn.com/': 0

quickstart.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ CoffeeScript version
7777

7878
You can also write Casper scripts using the `CoffeeScript syntax <http://jashkenas.github.com/coffee-script/>`_:
7979

80-
.. code-block:: ruby
80+
.. code-block:: coffeescript
8181
8282
getLinks = ->
8383
links = document.querySelectorAll "h3.r a"

0 commit comments

Comments
 (0)