standardize cdn links in docs (#2416)
- consistently use @next and explicit path
This commit is contained in:
parent
61af23de24
commit
9b38e41fd6
4 changed files with 6 additions and 6 deletions
|
|
@ -29,9 +29,9 @@ Mithril supports IE11, Firefox ESR, and the last two versions of Firefox, Edge,
|
||||||
### CDN
|
### CDN
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://unpkg.com/mithril"></script>
|
<script src="https://unpkg.com/mithril@next/mithril.js"></script>
|
||||||
<!-- or -->
|
<!-- or -->
|
||||||
<script src="https://cdn.jsdelivr.net/npm/mithril/mithril.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/mithril@next/mithril.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
### npm
|
### npm
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ Let's create an HTML file to follow along:
|
||||||
|
|
||||||
```markup
|
```markup
|
||||||
<body>
|
<body>
|
||||||
<script src="https://unpkg.com/mithril/mithril.js"></script>
|
<script src="https://unpkg.com/mithril@next/mithril.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var root = document.body
|
var root = document.body
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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):
|
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
|
```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>
|
<title>Hello world</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<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>
|
<script src="index.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -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:
|
You can also download the module directly if your environment does not support a bundling toolchain:
|
||||||
|
|
||||||
```markup
|
```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(...)`).
|
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(...)`).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue