Skip to content

Commit

Permalink
Merge pull request #163 from stefanv/copy-data-files
Browse files Browse the repository at this point in the history
Copy data files as part of build
  • Loading branch information
matthew-brett authored Jun 28, 2024
2 parents 9cc469d + dfd2009 commit 5551749
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/generate-ninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def replace_ext(fn, new_ext):
w.rule('compile-config', f'{clean_cmd}; ../scripts/set_version.py --output=_quarto-$lang.yml $lang')
w.rule('quarto-render', 'quarto render $in --no-clean --to $format --profile $lang')
w.rule('quarto-render-project', 'quarto render --to $format --profile $lang')
w.rule('copy', 'cp $in $out')
w.rule('cleanup', clean_cmd)
w.rule('print-help', 'echo -ne "$$(cat .ninja-usage)"')
w.rule('check-bibliography', 'biber --tool $in')
Expand Down Expand Up @@ -61,8 +62,15 @@ def replace_ext(fn, new_ext):
# --- Build HTML
quarto_conf = yaml.load(open('_quarto.yml.template'), Loader=yaml.FullLoader)
Rmd_chapters = quarto_conf['book']['chapters']
nb_dir = quarto_conf['noteout']['nb-dir']

# Data files generated by notebook build
data_files = glob(f'data/*')

for lang in languages:
for data_file in data_files:
w.build(f'../{lang}-book/{nb_dir}/{data_file}', 'copy', data_file)

for fmt in ('html', 'pdf'):
# HTML builds use PNG images; PDF builds use PDF images
image_fmt = {
Expand Down

0 comments on commit 5551749

Please sign in to comment.