Compare commits

..

No commits in common. "afeba5f9b1ab6bccf1af32108d71461d46068542" and "2bcfdaf0de8bae23184242c39afeb25dc17ee15f" have entirely different histories.

View File

@ -46,7 +46,6 @@ STYLE_KEYS = [
'is_bold', 'is_bold',
'is_centered', 'is_centered',
'is_upper', 'is_upper',
'is_hidden',
'indent' 'indent'
] ]
HTML_OPTIONS = { HTML_OPTIONS = {
@ -224,12 +223,6 @@ HTML_OPTIONS = {
'default': True, 'default': True,
'group': 'stanza_heading' 'group': 'stanza_heading'
}, },
'stanza_heading_is_hidden': {
'description': 'Hide the stanza headings',
'type': bool,
'default': False,
'group': 'stanza_heading'
},
'verse_font': { 'verse_font': {
'description': 'The font for the verses', 'description': 'The font for the verses',
'type': str, 'type': str,
@ -278,12 +271,6 @@ HTML_OPTIONS = {
'default': True, 'default': True,
'group': 'verse_heading' 'group': 'verse_heading'
}, },
'verse_heading_is_hidden': {
'description': 'Hide the verse headings',
'type': bool,
'default': False,
'group': 'verse_heading'
},
'chorus_font': { 'chorus_font': {
'description': 'The font for the choruses', 'description': 'The font for the choruses',
'type': str, 'type': str,
@ -332,12 +319,6 @@ HTML_OPTIONS = {
'default': True, 'default': True,
'group': 'chorus_heading' 'group': 'chorus_heading'
}, },
'chorus_heading_is_hidden': {
'description': 'Hide the chorus headings',
'type': bool,
'default': False,
'group': 'chorus_heading'
},
'bridge_font': { 'bridge_font': {
'description': 'The font for the bridge', 'description': 'The font for the bridge',
'type': str, 'type': str,
@ -386,12 +367,6 @@ HTML_OPTIONS = {
'default': True, 'default': True,
'group': 'bridge_heading' 'group': 'bridge_heading'
}, },
'bridge_heading_is_hidden': {
'description': 'Hide the bridge headings',
'type': bool,
'default': False,
'group': 'bridge_heading'
},
'chord_font': { 'chord_font': {
'description': 'The font for the chord', 'description': 'The font for the chord',
'type': str, 'type': str,
@ -415,13 +390,7 @@ HTML_OPTIONS = {
'type': bool, 'type': bool,
'default': True, 'default': True,
'group': 'chord' 'group': 'chord'
}, }
'chord_is_hidden': {
'description': 'Hide all the chords',
'type': bool,
'default': False,
'group': 'chord'
},
} }
_OPTION_GROUPS = [] _OPTION_GROUPS = []
@ -442,7 +411,7 @@ def get_option_groups():
return _OPTION_GROUPS return _OPTION_GROUPS
def make_style(name, font=None, size=None, is_bold=None, is_centered=None, is_upper=None, is_hidden=False, indent=None): def make_style(name, font=None, size=None, is_bold=None, is_centered=None, is_upper=None, indent=None):
"""Build a CSS style""" """Build a CSS style"""
styles = [] styles = []
if name == 'default': if name == 'default':
@ -459,9 +428,6 @@ def make_style(name, font=None, size=None, is_bold=None, is_centered=None, is_up
styles.append(' text-align: center;') styles.append(' text-align: center;')
if is_upper: if is_upper:
styles.append(' text-transform: uppercase;') styles.append(' text-transform: uppercase;')
if is_hidden:
styles.append(' display: none !important;')
styles.append(' visibility: hidden !important;')
if indent: if indent:
styles.append(' margin-left: {indent}rem;'.format(indent=indent)) styles.append(' margin-left: {indent}rem;'.format(indent=indent))
if styles: if styles:
@ -481,9 +447,9 @@ def generate_option_styles(options):
name = '{group}_{key}'.format(group=group, key=key) name = '{group}_{key}'.format(group=group, key=key)
if name not in HTML_OPTIONS: if name not in HTML_OPTIONS:
continue continue
value = options.get(name, HTML_OPTIONS[name]['default']) option = options.get(name, HTML_OPTIONS[name]['default'])
if value is not None: if option:
kwargs[key] = value kwargs[key] = option
styles.append(make_style(group.replace('_', '-'), **kwargs)) styles.append(make_style(group.replace('_', '-'), **kwargs))
return styles return styles