Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modèle de notebooks de correction exécutables (#304)
* dev scripts * dev tools * dev tools * split questions and answers to make nb executable * dev tools * pimp notebooks only for new changes * fix function name * dev tools * test new correction * tweak parameters for correction only in headers * fix quarto project file * fix mistakes * revert gitignore * fix mistake * fix mistake * fix mistake * fix mistake * Automated changes * Automated changes * fix counter * essaie créer équivalence classes entre box * Automated changes * Automated changes * test heading * tweak again * Automated changes * Automated changes * change css * Automated changes * Automated changes * improve app * css * echo false * Automated changes * Automated changes * style * fontaxesome * Automated changes * Automated changes * corrige css Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: linogaliana <linogaliana@yahoo.fr>
- Loading branch information
1 parent
4438433
commit a3eadd4
Showing
10 changed files
with
355 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import glob | ||
import re | ||
|
||
|
||
with open('diff') as f: | ||
lines = f.read().splitlines() | ||
|
||
list_files = [l for l in lines if l.endswith('.qmd')] | ||
|
||
def clean_overwrite_file(fl): | ||
with open(fl, 'r') as file_in: | ||
text_in = file_in.readlines() | ||
|
||
text_out = [] | ||
c = 0 | ||
for line in text_in: | ||
# Delimit header | ||
if "---" in line: | ||
c += 1 | ||
if c < 2: | ||
line = re.sub("echo:\s?false", "echo: true", line) | ||
text_out.append(line) | ||
|
||
with open(fl, 'w') as file_out: | ||
file_out.writelines(text_out) | ||
|
||
|
||
if __name__ == '__main__': | ||
for fl in list_files: | ||
clean_overwrite_file(fl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.