Skip to content

Commit d92a59d

Browse files
authored
Merge pull request #5711 from plotly/improve-readme-sync-packages
Improve readme sync packages
2 parents c80644e + f2d11cd commit d92a59d

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,16 @@ To learn and build more with plotly.js please visit [plotly.js documentation](ht
7979
### Un-minified versions are also available on CDN
8080
While non-minified source files may contain characters outside UTF-8, it is recommended that you specify the `charset` when loading those bundles.
8181
```html
82-
<script src="https://cdn.plot.ly/plotly-2.0.0-rc.3.js" charset="utf-8"></script>
82+
<script src="https://cdn.plot.ly/plotly-2.0.0-rc.3.js" charset="utf-8"></script>
8383
```
8484

8585
> Please note that as of v2 the "plotly-latest" outputs (e.g. https://cdn.plot.ly/plotly-latest.min.js) will no longer be updated on the CDN, and will stay at the last v1 patch v1.58.4. Therefore, to use the CDN with plotly.js v2 and higher, you must specify an exact plotly.js version.
8686
8787
### To support MathJax
8888
Load relevant MathJax (v2) files *Before* the plotly.js script tag:
8989
```html
90-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG.js"></script>
91-
<script src="https://cdn.plot.ly/plotly-2.0.0-rc.3.min.js"></script>
90+
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG.js"></script>
91+
<script src="https://cdn.plot.ly/plotly-2.0.0-rc.3.min.js"></script>
9292
```
9393

9494
## Bundles

tasks/sync_packages.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function syncPartialBundlePkg(d) {
116116
'',
117117
'Contains trace modules ' + common.formatEnumeration(d.traceList) + '.',
118118
'',
119-
'For more info on plotly.js, go to https://github.com/plotly/plotly.js',
119+
'For more info on plotly.js, go to https://github.com/plotly/plotly.js#readme',
120120
'',
121121
'## Installation',
122122
'',
@@ -127,13 +127,14 @@ function syncPartialBundlePkg(d) {
127127
'',
128128
'```js',
129129
'// ES6 module',
130-
'import Plotly from \'' + d.name + '\';',
130+
'import Plotly from \'' + d.name + '\'',
131131
'',
132132
'// CommonJS',
133-
'var Plotly = require(\'' + d.name + '\');',
133+
'var Plotly = require(\'' + d.name + '\')',
134134
'```',
135135
'',
136-
copyrightAndLicense
136+
copyrightAndLicense,
137+
'Please visit [complete list of dependencies](https://www.npmjs.com/package/plotly.js/v/' + pkg.version + '?activeTab=dependencies).'
137138
];
138139

139140
fs.writeFile(
@@ -209,7 +210,7 @@ function syncLocalesPkg(d) {
209210
'',
210211
d.desc,
211212
'',
212-
'For more info on plotly.js, go to https://github.com/plotly/plotly.js',
213+
'For more info on plotly.js, go to https://github.com/plotly/plotly.js#readme',
213214
'',
214215
'## Installation',
215216
'',
@@ -222,15 +223,15 @@ function syncLocalesPkg(d) {
222223
'',
223224
'```js',
224225
'// ES6 module',
225-
'import Plotly from \'plotly.js\';',
226-
'import locale from \'' + d.name + '/fr' + '\';',
226+
'import Plotly from \'plotly.js\'',
227+
'import locale from \'' + d.name + '/fr' + '\'',
227228
'',
228229
'// CommonJS',
229-
'var Plotly = require(\'plotly.js\');',
230-
'var locale = require(\'' + d.name + '/fr\');',
230+
'var Plotly = require(\'plotly.js\')',
231+
'var locale = require(\'' + d.name + '/fr\')',
231232
'',
232233
'// then',
233-
'Plotly.register(locale);',
234+
'Plotly.register(locale)',
234235
'Plotly.setPlotConfig({locale: \'fr\'})',
235236
'```',
236237
'',
@@ -248,7 +249,7 @@ function syncLocalesPkg(d) {
248249
var cnt = [constants.licenseDist, ''];
249250
localeFiles.forEach(function(f) {
250251
var n = path.basename(f, '.js');
251-
cnt.push('exports[\'' + n + '\'] = require(\'./' + n + '.js\');');
252+
cnt.push('exports[\'' + n + '\'] = require(\'./' + n + '.js\')');
252253
});
253254
cnt.push('');
254255

0 commit comments

Comments
 (0)