This commit is contained in:
Paul Masson 2018-04-11 12:52:13 -07:00 committed by GitHub
parent 8d1c92aa44
commit a860b9bd22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,11 +14,11 @@
"One of the main reasons why we developed the current notebook web application \n",
"was to embrace the web technology. \n",
"\n",
"By being a pure web application using HTML, Javascript, and CSS, the Notebook can get \n",
"By being a pure web application using HTML, JavaScript, and CSS, the Notebook can get \n",
"all the web technology improvement for free. Thus, as browser support for different \n",
"media extend, the notebook web app should be able to be compatible without modification. \n",
"\n",
"This is also true with performance of the User Interface as the speed of Javascript VM increases. "
"This is also true with performance of the User Interface as the speed of JavaScript VM increases. "
]
},
{
@ -41,9 +41,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The first tool that is available to you and that you should be aware of are browser \"developers tool\". The exact naming can change across browser and might require the installation of extensions. But basically they can allow you to inspect/modify the DOM, and interact with the javascript code that runs the frontend.\n",
"The first tool that is available to you and that you should be aware of are browser \"developers tool\". The exact naming can change across browser and might require the installation of extensions. But basically they can allow you to inspect/modify the DOM, and interact with the JavaScript code that runs the frontend.\n",
"\n",
" - In Chrome and Safari, Developer tools are in the menu `View > Developer > Javascript Console` \n",
" - In Chrome and Safari, Developer tools are in the menu `View > Developer > JavaScript Console` \n",
" - In Firefox you might need to install [Firebug](http://getfirebug.com/)\n",
" \n",
"Those will be your best friends to debug and try different approaches for your extensions."
@ -67,7 +67,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The above tools can be tedious for editing edit long JavaScript files. Therefore we provide the `%%javascript` magic. This allows you to quickly inject JavaScript into the notebook. Still the javascript injected this way will not survive reloading. Hence, it is a good tool for testing and refining a script.\n",
"The above tools can be tedious for editing edit long JavaScript files. Therefore we provide the `%%javascript` magic. This allows you to quickly inject JavaScript into the notebook. Still the JavaScript injected this way will not survive reloading. Hence, it is a good tool for testing and refining a script.\n",
"\n",
"You might see here and there people modifying css and injecting js into the notebook by reading file(s) and publishing them into the notebook.\n",
"Not only does this often break the flow of the notebook and make the re-execution of the notebook broken, but it also means that you need to execute those cells in the entire notebook every time you need to update the code.\n",
@ -98,8 +98,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"To inject Javascript we provide an entry point: `custom.js` that allows the user to execute and load other resources into the notebook.\n",
"Javascript code in `custom.js` will be executed when the notebook app starts and can then be used to customize almost anything in the UI and in the behavior of the notebook.\n",
"To inject JavaScript we provide an entry point: `custom.js` that allows the user to execute and load other resources into the notebook.\n",
"JavaScript code in `custom.js` will be executed when the notebook app starts and can then be used to customize almost anything in the UI and in the behavior of the notebook.\n",
"\n",
"`custom.js` can be found in the `~/.jupyter/custom/custom.js`. You can share your custom.js with others."
]
@ -503,9 +503,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"`require` is provided by a [javascript library](http://requirejs.org/) that allow you to express dependency. For simple extension like the previous one we directly mute the global namespace, but for more complex extension you could pass a callback to `require([...], <callback>)` call, to allow the user to pass configuration information to your plugin.\n",
"`require` is provided by a [JavaScript library](http://requirejs.org/) that allow you to express dependency. For simple extension like the previous one we directly mute the global namespace, but for more complex extension you could pass a callback to `require([...], <callback>)` call, to allow the user to pass configuration information to your plugin.\n",
"\n",
"In Python lang, \n",
"In Python language, \n",
"\n",
"```javascript\n",
"require(['a/b', 'c/d'], function( e, f){\n",