Skip to content

Commit 5f2e302

Browse files
committedApr 17, 2017
Drop THEME_REVEAL_CONFIG_* settings (#2485)
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent d032822 commit 5f2e302

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed
 

‎CHANGES.txt

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Math support changes
1313
Features
1414
--------
1515

16+
* Get rid of ``THEME_REVEAL_CONFIG_*`` settings, use global context
17+
instead (Issue #2485)
1618
* Add a list of template variables to documentation (Issues #2328,
1719
#2712, #2259) and update the theming reference (Issue #2259)
1820
* Add ``{post_title}`` tag for Read More links (Issue #2709)

‎docs/template-variables.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,9 @@ Name Type Descript
9999
``SLUG_TAG_PATH`` bool ``SLUG_TAG_PATH`` setting
100100
``social_buttons_code`` TranslatableSetting<str> ``SOCIAL_BUTTONS_CODE`` setting
101101
``sort_posts`` function ``utils.sort_posts`` function
102-
``subtheme`` str ``THEME_REVEAL_CONFIG_SUBTHEME`` setting
103102
``template_hooks`` dict<str, TemplateHookRegistry> Template hooks registered by plugins
104103
``theme_color`` str ``THEME_COLOR`` setting
105104
``timezone`` tzinfo Timezone object (represents the configured timezone)
106-
``transition`` str ``THEME_REVEAL_CONFIG_TRANSITION`` setting
107105
``translations`` dict<str, str> ``TRANSLATIONS`` setting
108106
``twitter_card`` dict ``TWITTER_CARD`` setting, defaults to an empty dictionary
109107
``url_replacer`` function ``Nikola.url_replacer`` function
@@ -113,6 +111,8 @@ Name Type Descript
113111
``use_cdn`` bool ``USE_CDN`` setting
114112
``use_katex`` bool ``USE_KATEX`` setting
115113
``use_open_graph`` bool ``USE_OPEN_GRAPH`` setting, defaults to True
114+
``subtheme`` str? ``THEME_REVEAL_CONFIG_SUBTHEME`` setting (only if set — deprecated)
115+
``transition`` str? ``THEME_REVEAL_CONFIG_TRANSITION`` setting (only if set — deprecated)
116116
================================== ================================== ================================================================================
117117

118118
Per-page local variables

‎nikola/conf.py.in

-9
Original file line numberDiff line numberDiff line change
@@ -777,15 +777,6 @@ IMAGE_FOLDERS = {'images': 'images'}
777777
# This list MAY be incomplete since pygments adds styles every now and then.
778778
# CODE_COLOR_SCHEME = 'default'
779779

780-
# If you use 'site-reveal' theme you can select several subthemes
781-
# THEME_REVEAL_CONFIG_SUBTHEME = 'sky'
782-
# You can also use: beige/serif/simple/night/default
783-
784-
# Again, if you use 'site-reveal' theme you can select several transitions
785-
# between the slides
786-
# THEME_REVEAL_CONFIG_TRANSITION = 'cube'
787-
# You can also use: page/concave/linear/none/default
788-
789780
# FAVICONS contains (name, file, size) tuples.
790781
# Used to create favicon link like this:
791782
# <link rel="name" href="file" sizes="size"/>

‎nikola/nikola.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,6 @@ def __init__(self, **config):
595595
'TEMPLATE_FILTERS': {},
596596
'THEME': 'bootstrap3',
597597
'THEME_COLOR': '#5670d4', # light "corporate blue"
598-
'THEME_REVEAL_CONFIG_SUBTHEME': 'sky',
599-
'THEME_REVEAL_CONFIG_TRANSITION': 'cube',
600598
'THUMBNAIL_SIZE': 180,
601599
'UNSLUGIFY_TITLES': False, # WARNING: conf.py.in overrides this with True for backwards compatibility
602600
'URL_TYPE': 'rel_path',
@@ -946,6 +944,14 @@ def __init__(self, **config):
946944
utils.LOGGER.warn('The POSTS_SECTION_ARE_INDEXES option is deprecated, use POSTS_SECTIONS_ARE_INDEXES instead.')
947945
self.config['POSTS_SECTIONS_ARE_INDEXES'] = config['POSTS_SECTION_ARE_INDEXES']
948946

947+
# TODO: remove in v8, or earlier
948+
if ('THEME_REVEAL_CONFIG_SUBTHEME' in config or 'THEME_REVEAL_CONFIG_TRANSITION' in config or
949+
(self.config['THEME'] in ('reveal', 'reveal-jinja') and
950+
('subtheme' not in config.GLOBAL_CONTEXT or 'transition' not in config.GLOBAL_CONTEXT))):
951+
utils.LOGGER.warn('The THEME_REVEAL_CONFIG_* settings are deprecated. Use `subtheme` and `transition` in GLOBAL_CONTEXT instead.')
952+
self._GLOBAL_CONTEXT['subtheme'] = config.get('THEME_REVEAL_CONFIG_SUBTHEME', 'sky')
953+
self._GLOBAL_CONTEXT['transition'] = config.get('THEME_REVEAL_CONFIG_TRANSITION', 'cube')
954+
949955
# Configure filters
950956
for actions in self.config['FILTERS'].values():
951957
for i, f in enumerate(actions):
@@ -1230,8 +1236,6 @@ def _set_global_context_from_config(self):
12301236
'MATHJAX_CONFIG')
12311237
self._GLOBAL_CONTEXT['use_katex'] = self.config.get('USE_KATEX')
12321238
self._GLOBAL_CONTEXT['katex_auto_render'] = self.config.get('KATEX_AUTO_RENDER')
1233-
self._GLOBAL_CONTEXT['subtheme'] = self.config.get('THEME_REVEAL_CONFIG_SUBTHEME')
1234-
self._GLOBAL_CONTEXT['transition'] = self.config.get('THEME_REVEAL_CONFIG_TRANSITION')
12351239
self._GLOBAL_CONTEXT['content_footer'] = self.config.get(
12361240
'CONTENT_FOOTER')
12371241
self._GLOBAL_CONTEXT['generate_atom'] = self.config.get('GENERATE_ATOM')

0 commit comments

Comments
 (0)
Please sign in to comment.