Files
jupyter_contrib_nbextensions/code_prettify.yaml
T

60 lines
2.1 KiB
YAML

Type: Jupyter Notebook Extension
Name: Code prettify
Description: Use kernel-specific code to reformat/prettify the contents of code cells
Link: README.md
Main: code_prettify.js
Compatibility: Jupyter (4.x)
Parameters:
- name: code_prettify.add_toolbar_button
description: Whether to add a toolbar button to prettify the selected cell(s)
input_type: checkbox
default: true
- name: code_prettify.register_hotkey
description: Whether to register a hotkey to prettify the selected cell(s)
input_type: checkbox
default: true
- name: code_prettify.hotkey
description: Hotkey to use to prettify the selected cell(s)
input_type: hotkey
default: 'Ctrl-L'
- name: code_prettify.process_all_hotkey
description: Hotkey to use to prettify the whole notebook
input_type: hotkey
default: 'Ctrl-Shift-L'
- name: code_prettify.show_alerts_for_errors
description: Whether to show alerts for errors in the kernel prettifying calls
input_type: checkbox
default: true
- name: code_prettify.kernel_config_map_json
description: |
json object defining library calls required to load the kernel-specific
prettifying modules, and the prefix & postfix for the json-format string
required to make the prettifying call.
input_type: json_object
default: |
{
"python": {
"library": "import json\nimport yapf.yapflib.yapf_api",
"prefix": "print(json.dumps(yapf.yapflib.yapf_api.FormatCode(u",
"postfix": ")[0]))"
},
"r": {
"library": "library(formatR)\nlibrary(jsonlite)",
"prefix": "cat(paste(tidy_source(text=",
"postfix": ")[['text.tidy']], collapse='\n'))"
},
"javascript": {
"library": "",
"prefix": "console.log(JSON.stringify(require('js-beautify').js_beautify(",
"postfix": ")));"
}
}
- name: code_prettify.button_icon
description: font-awesome class defining the toolbar button icon. See http://fontawesome.io/icons/ for details
input_type: text
default: 'fa-legal'
- name: code_prettify.button_label
description: label for the toolbar button
input_type: text
default: 'Code prettify'