standardise and prettify code snippets in readme.md files

This commit is contained in:
Josh Barnes
2015-09-22 20:53:46 +01:00
parent 7d153c08a4
commit 1b773e0eb3
10 changed files with 39 additions and 8 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ This folder contains the legacy slidemode
Put the following in your custom.js
```
```javascript
// Slidemode
require(['nbextensions/IPython-notebook-extensions/slidemode/main','base/js/events'], function(slidemode, events){
events.on('app_initialized.NotebookApp', function(){
@@ -48,6 +48,7 @@ Installation
Install the master version of the IPython-notebook-extensions repository as explained in the [wiki](https://github.com/ipython-contrib/IPython-notebook-extensions/wiki/).
Then load the extension from within the IPyton notebook:
```javascript
%%javascript
IPython.load_extensions('IPython-notebook-extensions-master/usability/codefolding/codefolding');
@@ -60,9 +61,11 @@ Internals
You need the current master branch from Codemirror in order to get codefolding to work. This is still very much work-in-progress.
The folding information is saved in the metadata of each codecell. The number of the folding start line (beginning with 0) is stored in an array:
```javascript
cell.metadata.code_folding = [ 3, 20, 33 ]
```
When reloading the IPython notebook, the folding status is restored.
+7 -1
View File
@@ -9,16 +9,19 @@ Installation
============
From IPython simply call
```python
import IPython
IPython.html.nbextensions.install_nbextension('https://raw.githubusercontent.com/ipython-contrib/IPython-notebook-extensions/master/nbextensions/usability/dragdrop/main.js')
```
Then load the extension from within the IPyton notebook:
```javascript
%%javascript
IPython.load_extensions('drag-and-drop');
```
Alternatively, you can add the load command to your `custom.js`.
@@ -26,6 +29,9 @@ Internals
=========
The image will be uploaded to the server into the directory where your notebook resides. This means, the image is not copied into the notebook itself, it will only be linked to. The markdown cell in the notebook will contain this tag:
`<img src="http://127.0.0.1:8888/notebooks/myimage.png"/>`
```html
<img src="http://127.0.0.1:8888/notebooks/myimage.png"/>
```
If you run `nbconvert` to generate a HTML file, this image will remain outside of the html file. You can embedd all images by calling `nbconvert` with the option `--post=embed.EmbedPostProcessor`. The file `embed.py`, located in the same directory of this extension needs to be in `PYTHONPATH` to be found.
+13 -6
View File
@@ -37,19 +37,26 @@ You should follow the instructions in the wiki.
the notebook extension directory, usually ~/.local/share/jupyter/nebextensions (Jupyter) or ~/.ipython/nbextensions (IPython 3.x).
Copy the scripts in conversion/ to some directory (preferably in your path).
- Automated installation
An even more simple procedure is to issue
```
jupyter nbextension install https://rawgit.com/jfbercher/latex_envs/master/latex_envs.zip --user
An even more simple procedure is to issue
``` bash
jupyter nbextension install https://rawgit.com/jfbercher/latex_envs/master/latex_envs.zip --user
```
at the command line.
Either load the extension from your `custom.js` or use a code cell with
%%javascript
require("base/js/utils").load_extensions("latex_envs/latex_envs")
```javascript
%%javascript
require("base/js/utils").load_extensions("latex_envs/latex_envs")
```
You can automatically load the extension via
jupyter nbextension enable latex_envs/latex_envs
```bash
jupyter nbextension enable latex_envs/latex_envs
```
Disclaimer, sources and acknowledgments
@@ -3,6 +3,7 @@ This extension limits the number of characters a codecell can output as text. Th
[![Demo Video](http://img.youtube.com/vi/U26ujuPXf00/0.jpg)](https://youtu.be/U26ujuPXf00)
You can set the number of characters using the ConfigManager:
```Python
from IPython.html.services.config import ConfigManager
ip = get_ipython()
@@ -1,14 +1,19 @@
This extension allows dynamically displaying Python variables in markdown cells.
Example:
If you set variable `a` in Python
```Python
a = 1.23
```
and write the following line in a markdown cell:
```Markdown
a = {{a}}
```
It will be displayed as:
```Markdown
a = 1.23
```
@@ -38,6 +43,7 @@ Installation
Install the master version of the IPython-notebook-extensions repository as explained on the main wiki page.
Then load the extension from within the IPyton notebook:
```javascript
%%javascript
IPython.load_extensions('IPython-notebook-extensions-master/usability/python-markdown/main');
@@ -22,9 +22,11 @@ Installation
============
Copy the `rubberband` directory to a new `/nbextensions/usability/rubberband` directory of your user's IPython directory and add
```javascript
IPython.load_extensions('usability/rubberband/main')
```
to your `custom.js` file. Take a look at the general installation instructions in the Wiki if you are unsure how to proceed.
+1
View File
@@ -5,6 +5,7 @@ Configuration
-------------
You can set the number of characters in the notebook extensions configration page or use the ConfigManager:
```Python
from IPython.html.services.config import ConfigManager
ip = get_ipython()
@@ -45,11 +45,14 @@ A IPython notebook with marked cells looks like this:
Installation
============
Copy the `runtools` directory to a new `/nbextensions/usability/runtools` directory of your user's IPython directory and add
```javascript
IPython.load_extensions('usability/runtools/main.js')
```
to your `custom.js` file. Take a look at the general installation instructions in the Wiki if you are unsure how to proceed.
Internals
=========
@@ -12,9 +12,11 @@ Installation
============
Copy the `skip-exceptions` directory to a new `/nbextensions/usability/skip-exceptions` directory of your user's IPython
directory and add
```javascript
IPython.load_extensions('usability/skip-exceptions/main.js')
```
to your `custom.js` file. Alternatively, you might want to use the `nbextensions` UI. Take a look at the general
installation instructions in the Wiki if you are unsure how to proceed.