Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ def read_section(path):
if row["Notes"] != "":
out += "<hr />"
out += mdspan(row["Notes"], "notes")
out += '</div>'
out += '</div>\n'
out += '</div>'
else:
out = f"""<div class="content" markdown="block">{out}</div>"""

return out

Expand Down Expand Up @@ -113,7 +115,7 @@ def generate_command_table():
if not ent_path.endswith(".md"): continue
md_str += read_section(ent_path[:-3])

md = markdown.Markdown(extensions=['toc'])
md = markdown.Markdown(extensions=['toc', 'md_in_html'])
content = md.convert(md_str)

with open("template.html", "r") as f:
Expand Down
21 changes: 21 additions & 0 deletions out/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ body {

font-family: 'Barlow Semi Condensed', sans-serif;
font-size: 1.1em;
text-align: justify;
}

nav {
Expand Down Expand Up @@ -78,6 +79,21 @@ nav a {
display: block;
}

.title {
display: block;
max-width: 600px;
margin-left: auto;
margin-right: auto;
}

.content {
& p, & ul, & li, & h1, & h2, & h3, & h4, & h5, & h6 {
max-width: 600px;
margin-left: auto;
margin-right: auto;
}
}

main {
padding: 0 20px;
margin-top: calc(30px + 48px); /* Offset the main content to appear under the menu on mobile */
Expand Down Expand Up @@ -193,6 +209,11 @@ p, li {
margin: 1em 0 1em 0;
}

table.commands {
margin-left: auto;
margin-right: auto;
}

table.commands tbody {
display: block;

Expand Down
2 changes: 1 addition & 1 deletion template.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h2>Portal 2 Rules</h2>
{{NAV_MENU}}
</nav>
<main>
<h1>Portal 2 Rules</h1>
<h1 class="title">Portal 2 Rules</h1>
{{CONTENT}}
</main>
</body>
Expand Down