Skip to content

Commit

Permalink
Remove doctitle if not using reST docinfo metadata
Browse files Browse the repository at this point in the history
Fix #2382, Fix #3124.

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Sep 6, 2018
1 parent 49042eb commit c2b275a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Expand Up @@ -21,6 +21,8 @@ Features
Bugfixes
--------

* Do not remove first heading in document (reST document title)
if ``USE_REST_DOCINFO_METADATA`` is disabled (Issue #3124)
* Remove ``NO_DOCUTILS_TITLE_TRANSFORM`` setting,
this is now default behavior if ``USE_REST_DOCINFO_METADATA``
is disabled (Issue #2382, #3124)
Expand Down
4 changes: 3 additions & 1 deletion nikola/conf.py.in
Expand Up @@ -1139,7 +1139,9 @@ MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.c
# Should titles fetched from file metadata be unslugified (made prettier?)
# FILE_METADATA_UNSLUGIFY_TITLES = True

# If enabled, extract metadata from docinfo fields in reST documents
# If enabled, extract metadata from docinfo fields in reST documents.
# If your text files start with a level 1 heading, it will be treated as the
# document title and will be removed from the text.
# USE_REST_DOCINFO_METADATA = False

# If enabled, hide docinfo fields in reST document output
Expand Down
3 changes: 2 additions & 1 deletion nikola/plugins/compile/rest/__init__.py
Expand Up @@ -124,7 +124,8 @@ def compile_string(self, data, source_path=None, is_two_file=True, post=None, la
# warnings about it from reST.
'math_output': 'mathjax /assets/js/mathjax.js',
'template': default_template_path,
'language_code': LEGAL_VALUES['DOCUTILS_LOCALES'].get(LocaleBorg().current_lang, 'en')
'language_code': LEGAL_VALUES['DOCUTILS_LOCALES'].get(LocaleBorg().current_lang, 'en'),
'doctitle_xform': not self.site.config.get('USE_REST_DOCINFO_METADATA'),
}

from nikola import shortcodes as sc
Expand Down

0 comments on commit c2b275a

Please sign in to comment.