Markdown Commands#
nbrefactor allows the use of Markdown Commands to control the refactoring process. These commands allow you to manipulate the structure of the refactored modules, or to ignore certain parts of the notebook.
Basic Usage#
To use a Markdown command, you may include it in an HTML comment (as to not interfere with your Notebook’s aesthetics 😇) within a Markdown cell.
The format is:
<!-- $command-name=value -->
For example, to rename a package:
<!-- $package=my_custom_package -->
Markdown Command Table#
The following table lists all the possible Markdown commands and their functions.
Command |
Description |
|---|---|
|
Ignores all modules/packages until a header with a depth less than or equal to the current one is reached. |
|
Ignores a single module (may consist of multiple code cells). |
|
Ignores the next code cell regardless of type. |
|
Ignores the current Markdown cell (e.g., when used for instructions only). |
|
|
|
Renames the current package and asserts the node type as ‘package’. |
|
Renames the current module and asserts the node type as ‘module’. |
|
Renames the current node generically, regardless of type. |
|
Declares a new node and asserts its type as ‘package’. |
|
Declares a new node and asserts its type as ‘module’. |
|
Declares a new node with no type (type will be inferred). |