From 6d337c6ebbc14b680abc5eac1d597c9f1651597a Mon Sep 17 00:00:00 2001 From: Andre Staltz Date: Wed, 24 Feb 2016 15:00:29 +0200 Subject: [PATCH] docs(esdoc): add playground environment in ESDoc-generated page Add Rx.umd.js script to the ESDoc-generated page, so RxJS can be experimented in the DevTools. Also add a welcome message in the console, and a hint text in index.md. --- doc/asset/devtools-welcome.js | 15 +++++++++++++++ doc/index.md | 2 ++ esdoc.json | 4 ++++ package.json | 2 +- 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 doc/asset/devtools-welcome.js diff --git a/doc/asset/devtools-welcome.js b/doc/asset/devtools-welcome.js new file mode 100644 index 00000000000..6de2322476d --- /dev/null +++ b/doc/asset/devtools-welcome.js @@ -0,0 +1,15 @@ +var welcomeText = ( + ' ____ _ ____ \n'+ + '| _ \\ __ __ | / ___| \n'+ + '| |_) |\\ \\/ / | \\___ \\ \n'+ + '| _ < > < |_| |___) | \n'+ + '|_| \\_\\/_/\\_\\___/|____/ \n'+ + '\nTry this code to get started experimenting with RxJS:\n'+ + '\n Rx.Observable.interval(500).take(4)'+ + '.subscribe(function (x) { console.log(x) });\n' +); +if (console.info) { + console.info(welcomeText); +} else { + console.log(welcomeText); +} diff --git a/doc/index.md b/doc/index.md index 0e3c1452f02..515c179527a 100644 --- a/doc/index.md +++ b/doc/index.md @@ -10,3 +10,5 @@ This is a rewrite of [Reactive-Extensions/RxJS](https://github.com/Reactive-Exte *Read the Manual on Observables, Observer, Subject, etc* ### [ยป Full reference](./identifiers.html) *Read detailed documentation on each operator* + +**Hint: open your DevTools to experiment with RxJS.** \ No newline at end of file diff --git a/esdoc.json b/esdoc.json index 4c8fc685af7..039ac6c64cc 100644 --- a/esdoc.json +++ b/esdoc.json @@ -4,6 +4,10 @@ "undocumentIdentifier": false, "title": "RxJS", "styles": ["./doc/styles/main.css"], + "scripts": [ + "./dist/global/Rx.umd.min.js", + "./doc/asset/devtools-welcome.js" + ], "index": "./doc/index.md", "manual": { "asset": "./doc/asset", diff --git a/package.json b/package.json index c041df97e15..a80b01af69d 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "build_perf": "npm run build_cjs && npm run build_global && webdriver-manager update && npm run perf", "build_test": "rm -rf dist/ && npm run lint && npm run build_cjs && jasmine", "build_cover": "rm -rf dist/ && npm run lint && npm run build_cjs && npm run cover", - "build_docs": "npm run build_es6 && npm run tests2png && esdoc -c esdoc.json", + "build_docs": "npm run build_es6 && npm run build_global && npm run tests2png && esdoc -c esdoc.json", "publish_docs": "./publish_docs.sh", "lint_perf": "eslint perf/", "lint_spec": "eslint spec/",