Skip to content

Commit cdc7393

Browse files
committed
fix: docs
1 parent d2d9e43 commit cdc7393

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

docs/install.rst

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ So for example:
88

99
.. sourcecode:: html
1010

11-
<script src="jquery.js"></script>
12-
<script src="https://cdn.ravenjs.com/###RAVEN_VERSION###/raven.min.js" crossorigin="anonymous"></script>
13-
<script>Raven.config('___PUBLIC_DSN___').install();</script>
14-
<script src="app.js"></script>
11+
<script src="jquery.js"></script>
12+
<script src="https://cdn.ravenjs.com/###RAVEN_VERSION###/raven.min.js" crossorigin="anonymous"></script>
13+
<script>Raven.config('___PUBLIC_DSN___').install();</script>
14+
<script src="app.js"></script>
1515

1616
This allows the ability for Raven's integrations to instrument themselves. If
1717
included before something like Angular, it'd be impossible to use for
@@ -28,7 +28,7 @@ Our CDN distributes builds with and without :doc:`integrations <integrations/ind
2828

2929
.. sourcecode:: html
3030

31-
<script src="https://cdn.ravenjs.com/###RAVEN_VERSION###/raven.min.js" crossorigin="anonymous"></script>
31+
<script src="https://cdn.ravenjs.com/###RAVEN_VERSION###/raven.min.js" crossorigin="anonymous"></script>
3232

3333
This version does not include any plugins. See `ravenjs.com
3434
<http://ravenjs.com/>`_ for more information about plugins and getting
@@ -45,11 +45,11 @@ add it to ``bower.json``).
4545

4646
.. code-block:: sh
4747
48-
$ bower install raven-js --save
48+
$ bower install raven-js --save
4949
5050
.. code-block:: html
5151

52-
<script src="/bower_components/raven-js/dist/raven.js"></script>
52+
<script src="/bower_components/raven-js/dist/raven.js"></script>
5353

5454
Also note that the file is uncompresed but is ready to pass to any decent
5555
JavaScript compressor like `UglifyJS
@@ -63,11 +63,11 @@ Raven is also available as an npm package, `raven-js
6363

6464
.. code-block:: sh
6565
66-
$ npm install raven-js --save
66+
$ npm install raven-js --save
6767
6868
.. code-block:: html
6969

70-
<script src="/node_modules/raven-js/dist/raven.js"></script>
70+
<script src="/node_modules/raven-js/dist/raven.js"></script>
7171

7272
Note that if you intend to use Raven with Node, `raven-node <https://github.com/getsentry/raven-node>`_ is the client to use.
7373

@@ -79,10 +79,10 @@ To use Raven with CommonJS imports:
7979

8080
.. code-block:: javascript
8181
82-
var Raven = require('raven-js') ;
83-
Raven
84-
.config('___PUBLIC_DSN___')
85-
.install();
82+
var Raven = require('raven-js') ;
83+
Raven
84+
.config('___PUBLIC_DSN___')
85+
.install();
8686
8787
ES2015 (ES6)
8888
~~~~~~~~~~~~
@@ -91,10 +91,10 @@ To use Raven with ES2015 (ES6) imports:
9191

9292
.. code-block:: javascript
9393
94-
import Raven from 'raven-js';
95-
Raven
96-
.config('___PUBLIC_DSN___')
97-
.install();
94+
import Raven from 'raven-js';
95+
Raven
96+
.config('___PUBLIC_DSN___')
97+
.install();
9898
9999
Async Loading
100100
~~~~~~~~~~~~~
@@ -106,26 +106,26 @@ And place the snippet below as soon as possible in your HTML code. For example:
106106

107107
.. code-block:: html
108108

109-
<script>
110-
window.SENTRY_SDK = {
111-
url: 'https://cdn.ravenjs.com/###RAVEN_VERSION###/raven.min.js',
112-
dsn: '___PUBLIC_DSN___',
113-
options: {
114-
release: '1.3.0'
109+
<script>
110+
window.SENTRY_SDK = {
111+
url: 'https://cdn.ravenjs.com/###RAVEN_VERSION###/raven.min.js',
112+
dsn: '___PUBLIC_DSN___',
113+
options: {
114+
release: '1.3.0'
115+
}
115116
}
116-
}
117117
118-
;(function(a,b,g,e,h){var k=a.SENTRY_SDK,f=function(a){f.data.push(a)};f.data=[];var l=a[e];a[e]=function(c,b,e,d,h){f({e:[].slice.call(arguments)});l&&l.apply(a,arguments)};var m=a[h];a[h]=function(c){f({p:c.reason});m&&m.apply(a,arguments)};var n=b.getElementsByTagName(g)[0];b=b.createElement(g);b.src=k.url;b.crossorigin="anonymous";b.addEventListener("load",function(){try{a[e]=l;a[h]=m;var c=f.data,b=a.Raven;b.config(k.dsn,k.options).install();var g=a[e];if(c.length)for(var d=0;d<c.length;d++)c[d].e?g.apply(b.TraceKit,c[d].e):c[d].p&&b.captureException(c[d].p)}catch(p){console.log(p)}});n.parentNode.insertBefore(b,n)})(window,document,"script","onerror","onunhandledrejection");
119-
</script>
118+
;(function(a,b,g,e,h){var k=a.SENTRY_SDK,f=function(a){f.data.push(a)};f.data=[];var l=a[e];a[e]=function(c,b,e,d,h){f({e:[].slice.call(arguments)});l&&l.apply(a,arguments)};var m=a[h];a[h]=function(c){f({p:c.reason});m&&m.apply(a,arguments)};var n=b.getElementsByTagName(g)[0];b=b.createElement(g);b.src=k.url;b.crossorigin="anonymous";b.addEventListener("load",function(){try{a[e]=l;a[h]=m;var c=f.data,b=a.Raven;b.config(k.dsn,k.options).install();var g=a[e];if(c.length)for(var d=0;d<c.length;d++)c[d].e?g.apply(b.TraceKit,c[d].e):c[d].p&&b.captureException(c[d].p)}catch(p){console.log(p)}});n.parentNode.insertBefore(b,n)})(window,document,"script","onerror","onunhandledrejection");
119+
</script>
120120

121121
Or you can place those two things in a separate script tags. This will queue all errors (and promises if the environment supports ``unhandledrejection`` handler) that happened before SDK was loaded and send them once it's configured and installed.
122122

123123
Be aware however, that there are some trade-offs to this solution, as errors might provide less information due to them being "retriggered" instead of being caught from the original source.
124124

125125
NOTE: This won't work when opening ``index.html`` or any other html file from the file system, as it doesn't support anonymous cross-origin scripts.
126-
The same thing can happen for any cross-origin scripts as well. To read more about it, see `What the heck is Script error?<https://blog.sentry.io/2016/05/17/what-is-script-error>`_.
126+
The same thing can happen for any cross-origin scripts as well. To read more about it, see `What the heck is Script error? <https://blog.sentry.io/2016/05/17/what-is-script-error>`_.
127127

128-
To read un-minified source code for this loader, see `loader.js<https://github.com/getsentry/raven-js/blob/master/packages/raven-js/src/loader.js>`_
128+
To read un-minified source code for this loader, see `loader.js <https://github.com/getsentry/raven-js/blob/master/packages/raven-js/src/loader.js>`_
129129

130130
Requirements
131131
~~~~~~~~~~~~

0 commit comments

Comments
 (0)