From 1f6da381cd7ecad251a8edf0c1371d6e236a422a Mon Sep 17 00:00:00 2001 From: David Hariri Date: Sun, 7 Apr 2024 19:25:48 -0400 Subject: [PATCH] Restores code hihglighting --- poetry.lock | 19 +++++++++++++++++-- pyproject.toml | 1 + static/styles.css | 27 +++++++++++++-------------- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/poetry.lock b/poetry.lock index 683fd3f..7d446a2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "annotated-types" @@ -561,6 +561,21 @@ files = [ [package.dependencies] typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" +[[package]] +name = "pygments" +version = "2.17.2" +description = "Pygments is a syntax highlighting package written in Python." +optional = false +python-versions = ">=3.7" +files = [ + {file = "pygments-2.17.2-py3-none-any.whl", hash = "sha256:b27c2826c47d0f3219f29554824c30c5e8945175d888647acd804ddd04af846c"}, + {file = "pygments-2.17.2.tar.gz", hash = "sha256:da46cec9fd2de5be3a8a784f434e4c4ab670b4ff54d605c4c2717e9d49c4c367"}, +] + +[package.extras] +plugins = ["importlib-metadata"] +windows-terminal = ["colorama (>=0.4.6)"] + [[package]] name = "pytest" version = "7.4.3" @@ -775,4 +790,4 @@ watchdog = ["watchdog (>=2.3)"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "85033a35e0e8c0adb37fe86a8217cad7ba03c356d2c103934ea6138df73ce85c" +content-hash = "30a8146a0ae216ef6d86856831572c9061a2a4ab372a00cafa432b9cacdb460e" diff --git a/pyproject.toml b/pyproject.toml index 6196904..c819a86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,7 @@ markdown = "^3.5" pydantic = "^2.4.2" python-frontmatter = "^1.0.0" python-dotenv = "^1.0.0" +pygments = "^2.17.2" [tool.poetry.group.dev.dependencies] diff --git a/static/styles.css b/static/styles.css index 22c3191..288192a 100644 --- a/static/styles.css +++ b/static/styles.css @@ -4,7 +4,6 @@ --bg-color: #faf9f4; --bg-set-in-color: #e9e8e1; --link-color: #008ed5; - --link-visited-color: #9f50d7; --inline-code-color: #e34361; --pic-frame: white; --hr-color: #e6e3d8; @@ -20,18 +19,17 @@ @media (prefers-color-scheme: dark) { :root { --text-color: #d1d0cc; - --description-color: #4d4b4a; + --description-color: #6a6766; --bg-color: #1e1e1d; --bg-set-in-color: #141413; --link-color: #3da1d4; - --link-visited-color: #b17dd5; --inline-code-color: #f56a81; --pic-frame: var(--description-color); --hr-color: var(--description-color); --code-comment: #565a5a; --code-keyword: #e3545c; - --code-primitive: #1a99e9; + --code-primitive: #90c9ed; --code-decorator: #e4a9f0; --code-interpol: #61ec81; } @@ -72,7 +70,7 @@ a { } a:visited { - color: var(--link-visited-color); + color: var(--link-color); } a:hover { @@ -156,8 +154,11 @@ blockquote.callout.note::before { } pre { - line-height: 175%; + line-height: 1.6rem; padding: 1rem; + border-radius: 0.5rem; + overflow-x: scroll; + background-color: var(--bg-set-in-color); } span.icon:before { @@ -181,7 +182,8 @@ span.icon.email:before { mask-image: url('Email.svg'); } -p code { +p code, +a code { font-family: 'Fira Code', monospace; color: var(--inline-code-color); font-size: 0.9rem; @@ -190,6 +192,10 @@ p code { padding: 0.2rem 0.4rem; } +a code { + text-decoration: underline; +} + .post_preview { margin: 0 0 2rem 0; box-shadow: 0 1px 0 var(--hr-color); @@ -199,13 +205,6 @@ p code { margin-top: 0.4rem; } - -.codehilite { - border-radius: 0.25rem; - overflow-x: scroll; - background-color: var(--bg-set-in-color); -} - .codehilite .c { color: var(--code-comment); font-style: italic } /* Comment */ .codehilite .k { color: var(--code-keyword); font-weight: bold } /* Keyword */ .codehilite .o { color: var(--code-primitive) } /* Operator */