Skip to content

Commit

Permalink
Merge pull request #106 from hughrun/highlighting
Browse files Browse the repository at this point in the history
fix syntax highlighting
  • Loading branch information
mouse-reeve authored Aug 19, 2023
2 parents f5286e3 + 18ab258 commit 1bd8b9b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,15 @@ def format_markdown(file_path):
header_block_open = not header_block_open
elif not header_block_open:
headerless.append(line)
return markdown("".join(headerless), extensions=["tables", "fenced_code"])
return markdown(
"".join(headerless),
extensions=["tables", "fenced_code", "codehilite"],
extension_configs={"codehilite": {"css_class": "highlight"}},
)
return markdown(
"".join(markdown_content.readlines()[3:]),
extensions=["tables", "fenced_code"],
extensions=["tables", "fenced_code", "codehilite"],
extension_configs={"codehilite": {"css_class": "highlight"}},
)


Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ black==22.12.0
Jinja2==3.0.1
Markdown==3.3.4
PyYAML==6.0
pygments==2.16.1
1 change: 1 addition & 0 deletions templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link type="text/css" rel="stylesheet" href="/static/css/bookwyrm.css">
<link type="text/css" rel="stylesheet" href="/static/css/icons.css">
<link type="text/css" rel="stylesheet" href="/static/css/pygment.css">
<link type="text/css" rel="stylesheet" href="/static/css/bulma.min.css">

<link rel="shortcut icon" type="image/x-icon" href="/static/images/favicon.ico">
Expand Down

0 comments on commit 1bd8b9b

Please sign in to comment.