1
0

Support captions; fix code blocks

This commit is contained in:
Ryan Fox 2021-11-08 11:47:56 -08:00
parent ac039387a8
commit ba004b0464
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E
2 changed files with 22 additions and 5 deletions

View File

@ -6,7 +6,7 @@ from template import template
from pymdownx.superfences import SuperFencesCodeExtension from pymdownx.superfences import SuperFencesCodeExtension
def main(): def main():
md = markdown.Markdown(extensions = ["meta", "extra", "toc", SuperFencesCodeExtension(preserve_tabs=True)]) md = markdown.Markdown(extensions = ["meta", "extra", "toc", "markdown_captions", SuperFencesCodeExtension(preserve_tabs=True)])
with open(sys.argv[1], "r", encoding="utf-8") as file_in: with open(sys.argv[1], "r", encoding="utf-8") as file_in:
html = md.convert(file_in.read()) html = md.convert(file_in.read())
output = template(html, sys.argv[2], ".html", md.Meta) if "template" in md.Meta else html output = template(html, sys.argv[2], ".html", md.Meta) if "template" in md.Meta else html

View File

@ -38,6 +38,11 @@
font-style: normal; font-style: normal;
} }
:root {
--color-fg-faded: #555;
--color-bg-faded: #EEE;
}
body { body {
font-family: 'Fira Sans', sans-serif; font-family: 'Fira Sans', sans-serif;
font-size: 18px; font-size: 18px;
@ -211,14 +216,13 @@ div.block:first-of-type, div.block-small {
border-top: none; border-top: none;
} }
code { pre, code {
background-color: #EEEEEE; background-color: var(--color-bg-faded);
} }
pre { pre {
line-height: 1.5; line-height: 1.5;
font-size: 14px; font-size: 14px;
background-color: #EEEEEE;
padding: 6px; padding: 6px;
overflow: auto; overflow: auto;
} }
@ -272,6 +276,15 @@ p.openring {
text-align: right; text-align: right;
} }
figure {
text-align: center;
}
figure figcaption {
line-height: 1;
color: var(--color-faded);
}
@media only screen and (max-width: 950px) { @media only screen and (max-width: 950px) {
header { header {
height: 172px; height: 172px;
@ -423,6 +436,10 @@ p.openring {
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root {
--color-fg-faded: #BBB;
--color-bg-faded: #222;
}
body { body {
background-color: #111111; background-color: #111111;
color: #DDDDDD; color: #DDDDDD;
@ -441,7 +458,7 @@ p.openring {
border-left: solid 2px #444444; border-left: solid 2px #444444;
} }
div.post-head span.subtext, div.article p.extra, p.openring { p.faded, span.faded, div.post-head span.subtext, div.article p.extra, p.openring {
color: #BBBBBB; color: #BBBBBB;
} }