Skip to content

Commit

Permalink
separate HIDE_REST_DOCINFO option
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Alsina committed Jun 1, 2017
1 parent 921ae9f commit 885776d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -6,6 +6,7 @@ Features

* Support for reStructured text docinfo metadata with
USE_REST_DOCINFO_METADATA option, defaulting to False (Issue #1923)
* New HIDE_REST_DOCINFO option, defaulting to False.
* Support for Markdown Meta extension for Pelican
compatibility (Issue #1923)
* Support for YAML and TOML metadata (Issue #2801)
Expand Down
3 changes: 3 additions & 0 deletions nikola/conf.py.in
Expand Up @@ -1138,6 +1138,9 @@ MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.c
# If enabled, extract metadata from docinfo fields in reSt documents
# USE_REST_DOCINFO_METADATA = False

# If enabled, hide docinfo fields in reSt document output
# HIDE_REST_DOCINFO = False

# If you hate "Filenames with Capital Letters and Spaces.md", you should
# set this to true.
UNSLUGIFY_TITLES = True
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/compile/rest/__init__.py
Expand Up @@ -116,7 +116,7 @@ def compile_string(self, data, source_path=None, is_two_file=True, post=None, la

from nikola import shortcodes as sc
new_data, shortcodes = sc.extract_shortcodes(data)
if self.site.config.get('USE_REST_DOCINFO_METADATA'):
if self.site.config.get('HIDE_REST_DOCINFO', False):
self.site.rst_transforms.append(RemoveDocinfo)
output, error_level, deps, _ = rst2html(
new_data, settings_overrides=settings_overrides, logger=self.logger, source_path=source_path, l_add_ln=add_ln, transforms=self.site.rst_transforms,
Expand Down

0 comments on commit 885776d

Please sign in to comment.