standardize cdn links in docs (#2416)

- consistently use @next and explicit path
This commit is contained in:
Daniel Loomer 2019-05-27 11:58:11 -04:00 committed by Isiah Meadows
parent 61af23de24
commit 9b38e41fd6
4 changed files with 6 additions and 6 deletions

View file

@ -58,7 +58,7 @@ Let's create an HTML file to follow along:
```markup
<body>
<script src="https://unpkg.com/mithril/mithril.js"></script>
<script src="https://unpkg.com/mithril@next/mithril.js"></script>
<script>
var root = document.body

View file

@ -10,7 +10,7 @@
If you're new to JavaScript or just want a very simple setup to get your feet wet, you can get Mithril from a [CDN](https://en.wikipedia.org/wiki/Content_delivery_network):
```markup
<script src="https://unpkg.com/mithril/mithril.js"></script>
<script src="https://unpkg.com/mithril@next/mithril.js"></script>
```
---
@ -247,7 +247,7 @@ If you don't have the ability to run a bundler script due to company security po
<title>Hello world</title>
</head>
<body>
<script src="https://cdn.rawgit.com/MithrilJS/mithril.js/master/mithril.js"></script>
<script src="https://unpkg.com/mithril@next/mithril.js"></script>
<script src="index.js"></script>
</body>
</html>

View file

@ -46,7 +46,7 @@ var Stream = require("mithril/stream")
You can also download the module directly if your environment does not support a bundling toolchain:
```markup
<script src="https://unpkg.com/mithril@next/stream"></script>
<script src="https://unpkg.com/mithril@next/stream/stream.js"></script>
```
When loaded directly with a `<script>` tag (rather than required), the stream library will be exposed as `window.m.stream`. If `window.m` is already defined (e.g. because you also use the main Mithril script), it will attach itself to the existing object. Otherwise it creates a new `window.m`. If you want to use streams in conjunction with Mithril as raw script tags, you should include Mithril in your page before `mithril/stream`, because `mithril` will otherwise overwrite the `window.m` object defined by `mithril/stream`. This is not a concern when the libraries are consumed as CommonJS modules (using `require(...)`).