Skip to content
Permalink
Browse files
Remove doctitle if not using reST docinfo metadata
Fix #2382, Fix #3124.

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Sep 6, 2018
1 parent 49042eb commit c2b275a3c3b5ac43012753601879c16f29d36817
Showing with 7 additions and 2 deletions.
  1. +2 −0 CHANGES.txt
  2. +3 −1 nikola/conf.py.in
  3. +2 −1 nikola/plugins/compile/rest/__init__.py
@@ -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)
@@ -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
@@ -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

0 comments on commit c2b275a

Please sign in to comment.