Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* overwrite echo false * force qmd * correct * include * nump * gha * Automated changes * Automated changes Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
eb8f922
commit d068cb6
Showing
3 changed files
with
24 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import glob | ||
import re | ||
|
||
from tweak_markdown import read_file, write_file | ||
|
||
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): | ||
content = read_file(fl) | ||
content = re.sub("#\|echo: false", "", content) | ||
content = re.sub("#\| echo: false", "", content) | ||
content = re.sub("#\|include: false", "", content) | ||
content = re.sub("#\| include: false", "", content) | ||
write_file(fl, content) | ||
|
||
if __name__ == '__main__': | ||
[clean_overwrite_file(fl) for fl in list_files] |
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