diff options
author | Stephen Finucane <stephen@that.guru> | 2017-12-28 20:45:02 +0000 |
---|---|---|
committer | Stephen Finucane <stephen@that.guru> | 2018-01-11 20:57:03 +0000 |
commit | a83e8bab7d03d209f76cc92ffe29a9b89289cf6f (patch) | |
tree | 23bd2051c8cc805ca1f8e3568014237c4edf8dae /sphinx/application.py | |
parent | b1cea0258924840f8611e0301303fd18bcac82b0 (diff) | |
download | sphinx-git-a83e8bab7d03d209f76cc92ffe29a9b89289cf6f.tar.gz |
builders: Add 'Builder.epilog' option
This allows builders to emit a final epilog message containing
information such as where resulting files can be found. This is only
emitted if the build was successful.
This allows us to remove this content from the 'make_mode' tool and
the legacy 'Makefile' and 'make.bat' templates. There's room for more
dramatic simplification of the former, but this will come later.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Diffstat (limited to 'sphinx/application.py')
-rw-r--r-- | sphinx/application.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sphinx/application.py b/sphinx/application.py index e76f101a3..8a22a9e6d 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -338,6 +338,13 @@ class Sphinx(object): (status, self._warncount))) else: logger.info(bold(__('build %s.') % status)) + + if self.statuscode == 0 and self.builder.epilog: + logger.info('') + logger.info(self.builder.epilog % { + 'outdir': path.relpath(self.outdir), + 'project': self.config.project + }) except Exception as err: # delete the saved env to force a fresh build next time envfile = path.join(self.doctreedir, ENV_PICKLE_FILENAME) |