Skip to content

Commit

Permalink
undid auto line wrap by autopep8 which was causing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kliu57 committed Nov 16, 2023
1 parent 59fb3ed commit b4e5e3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
6 changes: 1 addition & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@

7. Run autopep8 to format the code.

`autopep8 --in-place --recursive --exclude=_version.py .`

Alternatively, install the autopep8 VS Code extension, and then run it on a file by:

`Right Click File Contents > Format Document With... > autopep8`
`autopep8 --in-place --recursive --exclude='_version.py' --ignore=E501 .`

If running into issues, try adding `python -m` in front of the command.

Expand Down
12 changes: 4 additions & 8 deletions src/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,14 @@ def load_config_file(config_file):
def get_html_before_body(filename, css_url, metadata):
"""Function returns the html of the page before and up to the <body>"""
html = '<!doctype html>\n'
html += f'<html lang="{metadata["lang"]
if "lang" in metadata else "en"}">\n'
html += f'<html lang="{metadata["lang"] if "lang" in metadata else "en"}">\n'
html += '<head>\n'
html += '\t<meta charset="utf-8">\n'
html += f'\t<title>{metadata["title"]
if "title" in metadata else filename}</title>\n'
html += f'\t<title>{metadata["title"] if "title" in metadata else filename}</title>\n'
if 'keywords' in metadata:
html += f'\t<meta name="keywords" content="{
metadata["keywords"]}" />\n'
html += f'\t<meta name="keywords" content="{metadata["keywords"]}" />\n'
if 'description' in metadata:
html += f'\t<meta name="description" content="{
metadata["description"]}" />\n'
html += f'\t<meta name="description" content="{metadata["description"]}" />\n'
html += '\t<meta name="viewport" content="width=device-width, initial-scale=1" />\n'
if css_url:
html += f'\t<link rel="stylesheet" href="{css_url}">\n'
Expand Down

0 comments on commit b4e5e3b

Please sign in to comment.