The publication workflows attached to the .github
directory of a *-solution
repo allow to generate the matching *-challenge
repo.
The challenge repo is generated by challengifying the content of the solution repo and is kept in sync whenever new content is pushed to the solution repo. So as content creator, you only need to make changes in the solution repo!
The pull requests created on the solution repo are also challengified and kept in sync in the challenge repo, which allows to verify the impact of a pull request on the challenge repo by, for example, previewing the PR created in the challenge repo.
It is possible to ignore files, directories and patterns so that the corresponding content is not challengified neither published to the challenge repo.
This is done by editing a .challengifyignore
file, which works similarly to a .gitignore
file:
# comment
# ignore `.challengifyignore` files anywhere in the directory structure
**/.challengifyignore
# ignore files ending in `_solution.ipynb` anywhere in the directory structure
**/*_solution.ipynb
# ignore a specific file referenced by relative path
01-Python/02-Data-Sourcing/01-CSV/some_test_file.py
start | end | content usage |
---|---|---|
# $CHALLENGIFY_BEGIN |
# $CHALLENGIFY_END |
replaced by pass comment |
# $CHA_BEGIN |
# $CHA_END |
replaced by pass comment |
# $DELETE_BEGIN |
# $DELETE_END |
deleted |
# $DEL_BEGIN |
# $DEL_END |
deleted |
# $ERASE_BEGIN |
# $ERASE_END |
block newline is consumed |
# $WIPE_BEGIN |
# $WIPE_END |
block newline + following newline are consumed |
# $IMPLODE_BEGIN |
# $IMPLODE_END |
block newline + surrounding newlines are consumed |
challengify
keeps indentation
delete
does not consume the block newline
erase
consumes the block newline
wipe
consumes the block newline and the following one in order to keep outer blocks evenly spaced
implode
consumes the block newline and the surrounding newlines in order to remove outer blocks spacing
The tags can be viewed/enabled using the menu
View > Cell Toolbar > Tags
tag | usage |
---|---|
delete |
the cell is deleted |
delete_begin |
delete all further cells, including this one |
delete_end |
last cell to be deleted by delete_begin |
challengify |
the content of the cell is replaced. See below for replacements. |
steps |
single line comments are kept, everything else after the first comment is replaced |
clear_output |
the output and standard error of the cell are emptied (only valid if the keep_output notebook metadata option is set to True) |
start | end | content |
---|---|---|
$CHALLENGIFY_BEGIN |
$CHALLENGIFY_END |
replaced by pass comment |
$DELETE_BEGIN |
$DELETE_END |
deleted |
The output and standard error of all cells is deleted unless the following conf is added to the notebook metadata:
The notebook metadata can be edited using the menu
Edit > Edit Notebook Metadata
"challengify": {
"keep_output": true
},
Text replacements within code files are linked to the programming language being written, which in turn is defined by the fileβs extension.
Notebook replacements occur depending on the cell type (markdown or code) and on the notebook metadata declared language.
language | replacement |
---|---|
python | pass # YOUR CODE HERE |
notebook markdown | > YOUR ANSWER HERE |
other | # YOUR CODE HERE |