Skip to content

Commit

Permalink
Add config.yaml dependency to rst files
Browse files Browse the repository at this point in the history
Enables incremental Sphinx builds: an rst file is rebuilt
if a referenced yaml file has changed.

This should remove the need to use "make touchrst" in
A+ course builds because changes in exercise config.yaml files
should be detected even if no rst file has been changed.

Fixes apluslms/gitmanager#25
  • Loading branch information
lainets authored and markkuriekkinen committed Mar 1, 2023
1 parent 6b2de81 commit 1a7d6e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions directives/ae_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ def run(self):
raise SphinxError('Missing config path {}'.format(self.options['config']))
data = yaml_writer.read(path)
config_title = data.get('title', None)

env.note_dependency(path) # Add the config file to the rst file's dependencies
else:
data = { '_external': True }
if 'url' in self.options:
Expand Down
2 changes: 2 additions & 0 deletions directives/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ def run(self):
raise SphinxError('Missing config path {}'.format(self.options['config']))
data = yaml_writer.read(path)
config_title = data.get('title', '')

env.note_dependency(path) # Add the config file to the rst file's dependencies
else:
data = { '_external': True }
if 'url' in self.options:
Expand Down

0 comments on commit 1a7d6e0

Please sign in to comment.