Fix some syntax and pull in html options

This commit is contained in:
Raoul Snyman 2021-08-02 14:05:33 -07:00
parent 2f7e5a222f
commit f9c2cc345e
2 changed files with 5 additions and 5 deletions

View File

@ -1,8 +1,8 @@
from argparse import ArgumentParser from argparse import ArgumentParser
from chordpro.base import Song from chordpro.base import Song
from chordpro.renderers.html import render as render_html from chordpro.renderers.html import render as html_render, get_options as html_get_options
from chordpro.renderers.text import render as render_text from chordpro.renderers.text import render as text_render
def get_args(): def get_args():
@ -31,9 +31,9 @@ def main():
song = Song(args.input) song = Song(args.input)
if args.format == 'text': if args.format == 'text':
output = render_text(song, **render_params) output = text_render(song, **render_params)
else: else:
output = render_html(song, **render_params) output = html_render(song, **render_params)
if args.output: if args.output:
with open(args.output, 'w') as html_file: with open(args.output, 'w') as html_file:
html_file.write(output) html_file.write(output)

View File

@ -345,7 +345,7 @@ HTML_OPTIONS = {
'group': 'chord' 'group': 'chord'
} }
} }
OPTION_GROUPS = set([option['group'] for option in HTML_OPTIONS]) OPTION_GROUPS = set([option['group'] for option in HTML_OPTIONS.values()])
def get_options(group=None): def get_options(group=None):