From dbcbc2c1198587ee4b8774e06b64cc48cfcc5ea2 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Thu, 9 Jan 2014 15:19:31 +0100 Subject: [PATCH] Fail and exit on restructuredtext syntax error --- pelican/readers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index d070a19c..198b5a5f 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -155,7 +155,8 @@ class RstReader(BaseReader): def _get_publisher(self, source_path): extra_params = {'initial_header_level': '2', 'syntax_highlight': 'short', - 'input_encoding': 'utf-8'} + 'input_encoding': 'utf-8', + 'exit_status_level': 2} user_params = self.settings.get('DOCUTILS_SETTINGS') if user_params: extra_params.update(user_params) @@ -166,7 +167,7 @@ class RstReader(BaseReader): pub.writer.translator_class = PelicanHTMLTranslator pub.process_programmatic_settings(None, extra_params, None) pub.set_source(source_path=source_path) - pub.publish() + pub.publish(enable_exit_status=True) return pub def read(self, source_path):