NPT-JPT
This vscode extension adds two buttons to the notebook toolbar.
When clicking on the Renumber
button, the extension finds all functions send(obj, N)
in the notebook and renumber them in increasing order starting from 0.
When clicking on the Create Student Version
button, the extension finds all code matching specific patterns described below and either hides it or replaces it with a given string.
It creates a new notebook and saves it in the same folder with the suffix "_init_student_version".
The patterns can be:
# HIDE + [CELL|BLOCK|LINE|OPERAND]
# TODO + [BLOCK|LINE|OPERAND]
For blocks, you need to define the end of the HIDE/TODO with # END TODO BLOCK
or # END HIDE BLOCK
.
Examples:
A = 42
# Compute the square of A
A_square = A**2 # TODO OPERAND
### HIDE BLOCK
# Everything in this block will be removed in the student version
A_square == 42 * 42
### END HIDE BLOCK
Some parameters can be changed in the settings.
Extension Settings
This extension contributes the following settings:
nptjpt.prefix
: Prefix to prepend to the notebook name
nptjpt.suffix
: Suffix to append to the notebook name
nptjpt.replace_text
: Text to replace the TODOs with
nptjpt.clear_outputs
: Clear the outputs when creating the student version