Skip to content

Commit

Permalink
Add data file dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-brett committed Jun 30, 2024
1 parent ac47dcd commit 1c116bf
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions source/generate-ninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,15 @@ def replace_ext(fn, new_ext):
Rmd_chapters = quarto_conf['book']['chapters']
nb_dir = quarto_conf['noteout']['nb-dir']

# Data files generated by notebook build
data_files = glob(f'data/*.csv')
# Data files needed to run output notebooks.
data_files = glob('data/*.csv')

for lang in languages:
data_out_files = []
for data_file in data_files:
w.build(f'../{lang}-book/{nb_dir}/{data_file}', 'copy', data_file)
data_out_file = f'../{lang}-book/{nb_dir}/{data_file}'
w.build(data_out_file, 'copy', data_file)
data_out_files.append(data_out_file)

for fmt in ('html', 'pdf'):
# HTML builds use PNG images; PDF builds use PDF images
Expand All @@ -96,7 +99,9 @@ def replace_ext(fn, new_ext):
f'{lang}-book{target_postfix}',
'quarto-render-project',
"",
implicit=[f'_quarto-{lang}.yml', 'simon_refs.bib'] + built_diagrams[image_fmt],
implicit=([f'_quarto-{lang}.yml', 'simon_refs.bib'] +
built_diagrams[image_fmt] +
data_out_files),
variables={'lang': lang, 'format': fmt}
)

Expand Down

0 comments on commit 1c116bf

Please sign in to comment.