Skip to content

Commit 3baca0a

Browse files
author
juhasch
committed
2 parents e4dfe72 + 882fbb0 commit 3baca0a

File tree

13 files changed

+84
-11
lines changed

13 files changed

+84
-11
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ Unreleased (aka. GitHub master)
2121
This is where each new PR to the project should add a summary of its changes,
2222
which makes it much easier to fill in each release's changelog :)
2323

24+
0.5.1
25+
-----
26+
27+
- Fix for navigation hotkeys [#1378](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/pull/1378)
28+
- `gist_it` Making github endpoint configurable to support publishing gists to Github Enterprise [#1364](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/pull/1364)
29+
- Fix treefilter [#1359](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/pull/1359)
30+
- Enable ruler extension in editor [#1296](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/pull/1296)
31+
- Several spelling fixes
32+
33+
Travis/AppVeyor testing is currently broken due to outdated configuration. Will hopefully be working in 0.5.2 again.
2434

2535
0.5.0
2636
-----

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
We are super happy that you intend to contribute to the nbextensions! You can discuss improvements in issues and implement them in pull requests.
44

5+
Because this is a volunteer effort, we cannot provide support for all of the extensions.
6+
So if you contribute a new extension, please stick around and help others using it.
7+
58
## Create an issue
69

710
Do not hesitate to open up an issue, you can discuss bugs, improvements or new extensions in them. Creating an issue is a good starting point for code contributions. The community can support you with experience of similar extensions, pros and cons, what to look for etc.

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
# built documents.
4242
#
4343
# The short X.Y version.
44-
version = '0.5.0'
44+
version = '0.5.1'
4545
# The full version, including alpha/beta/rc tags.
46-
release = '0.5.0'
46+
release = '0.5.1'
4747

4848
# The suffix(es) of source filenames.
4949
# You can specify multiple suffix as a list of strings

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ def main():
4242
`the repository issues page <https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues>`_
4343
if you encounter any problems, and create a new issue if needed!
4444
""", # noqa: E501
45-
version='0.5.0',
45+
version='0.5.1',
4646
author='ipython-contrib and jupyter-contrib developers',
4747
author_email='[email protected]',
4848
url=('https://github.com/'
4949
'ipython-contrib/jupyter_contrib_nbextensions.git'),
5050
download_url=('https://github.com/'
5151
'ipython-contrib/jupyter_contrib_nbextensions'
52-
'/tarball/0.5.0'),
52+
'/tarball/0.5.1'),
5353
keywords=['IPython', 'Jupyter', 'notebook'],
5454
license='BSD',
5555
platforms=['Any'],

src/jupyter_contrib_nbextensions/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import jupyter_nbextensions_configurator
66

7-
__version__ = '0.5.0'
7+
__version__ = '0.5.1'
88

99

1010
def _jupyter_server_extension_paths():

src/jupyter_contrib_nbextensions/nbextensions/code_prettify/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,20 @@ to use [autopep8] instead of [yapf] to reformat the python code.
239239
But, if you want two alternative prettifiers available for the same kernel
240240
language, we need to define separate plugins.
241241

242+
Custom Yapf Styles
243+
------------------
244+
245+
Using the default `yapf` engine, one may define a custom formatting style according to the [package documentation](https://github.com/google/yapf#formatting-style).
246+
247+
The `code_prettify` extension is configured to follow the default `yapf` ordering (minus the command line option) and will search for the formatting style in the following manner:
248+
249+
> 1. In the [style] section of a .style.yapf file in either the current directory or one of its parent directories.
250+
> 2. In the [yapf] section of a setup.cfg file in either the current directory or one of its parent directories.
251+
> 3. In the ~/.config/yapf/style file in your home directory.
252+
>
253+
> If none of those files are found, the default style is used (PEP8).
254+
255+
This means that one can set up a globa custom yapf style using `~/.config/yapf/style` or a project-specific one using the project directory.
242256

243257
History
244258
-------
@@ -267,6 +281,9 @@ History
267281
- [@jfbercher], january 2017
268282
- updated documentation
269283
- added autopep8 nbextension as a plugin using the shared library
284+
- [@artificialsoph], Jan 2018
285+
- updated documentation
286+
- changed default behavior to load custom yapf styles
270287

271288

272289
[2to3]: README_2to3.md

src/jupyter_contrib_nbextensions/nbextensions/code_prettify/code_prettify.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ define(['./kernel_exec_on_cell'], function(kernel_exec_on_cell) {
2626
"library": ["import json",
2727
"def yapf_reformat(cell_text):",
2828
" import yapf.yapflib.yapf_api",
29+
" from yapf import file_resources",
30+
" import os",
2931
" import re",
32+
" style_config = file_resources.GetDefaultStyleForDir(os.getcwd())",
3033
" cell_text = re.sub('^%', '#%#', cell_text, flags=re.M)",
31-
" reformated_text = yapf.yapflib.yapf_api.FormatCode(cell_text)[0]",
34+
" reformated_text = yapf.yapflib.yapf_api.FormatCode(cell_text, style_config=style_config)[0]",
3235
" return re.sub('^#%#', '%', reformated_text, flags=re.M)"].join("\n"),
3336
"prefix": "print(json.dumps(yapf_reformat(u",
3437
"postfix": ")))"

src/jupyter_contrib_nbextensions/nbextensions/codefolding/readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Three different folding modes are supported:
1717

1818
### Indent Folding
1919

20-
Python-style code folding, detetects indented code.
20+
In the image below, the Codefolding extension detects unfolded, Python-style indentations:
21+
2122
![Unfolded](codefolding_indent_unfolded.png)
2223

2324
The unfolded code above can be folded like this:

src/jupyter_contrib_nbextensions/nbextensions/gist_it/gist_it.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ Link: readme.md
77
Icon: icon.png
88
Parameters:
99
- name: gist_it_personal_access_token
10-
description: (optional) Github personal access token.
10+
description: Github personal access token. To write gists on a user's behalf, you need a token with the <a href="https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/">gist OAuth scope</a>.
1111
input_type: text
1212
- name: gist_it_default_to_public
1313
description: Gists default to public. If using a personal access token, gists will default to private. Set this to have them default to being public instead.
1414
input_type: checkbox
15+
- name: github_endpoint
16+
description: Github endpoint. Defaults to 'github.com'. Change this to publish to your enterprise github endpoint.
17+
input_type: text
18+
default: 'github.com'

src/jupyter_contrib_nbextensions/nbextensions/gist_it/main.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ define([
3939
var params = {
4040
gist_it_default_to_public: false,
4141
gist_it_personal_access_token: '',
42+
github_endpoint: 'github.com'
4243
};
4344

4445
var initialize = function () {
@@ -170,8 +171,10 @@ define([
170171
.addClass('fa-circle-o-notch fa-spin');
171172
// List commits as a way of checking whether the gist exists.
172173
// Listing commits appears to give the most concise response.
174+
var github_endpoint = params.github_endpoint !== '' ? params.github_endpoint : 'github.com';
175+
173176
$.ajax({
174-
url: 'https://api.github.com/gists/' + id + '/commits',
177+
url: 'https://api.'+ github_endpoint +'/gists/' + id + '/commits',
175178
dataType: 'json',
176179
beforeSend: add_auth_token,
177180
error: function(jqXHR, textStatus, errorThrown) {
@@ -190,7 +193,7 @@ define([
190193
help_block_html += '<p>' +
191194
'<i class="fa fa-pencil-square"></i>' +
192195
' gist ' +
193-
'<a href="https://gist.github.com/' + id +
196+
'<a href="https://'+ github_endpoint + '/gist/' + id +
194197
'" target="_blank">' + id + '</a> will be updated' +
195198
' (' + jqXHR.responseJSON.length +
196199
' revision' + (single ? '' : 's') +
@@ -440,9 +443,10 @@ define([
440443
var id = params.gist_it_personal_access_token !== '' ? id_input.val() : '';
441444
var method = id ? 'PATCH' : 'POST';
442445

446+
var github_endpoint = params.github_endpoint !== '' ? params.github_endpoint : 'github.com';
443447
// Create/edit the Gist
444448
$.ajax({
445-
url: 'https://api.github.com/gists' + (id ? '/' + id : ''),
449+
url: 'https://api.'+ github_endpoint +'/gists' + (id ? '/' + id : ''),
446450
type: method,
447451
dataType: 'json',
448452
data: JSON.stringify(data),

0 commit comments

Comments
 (0)