No more inline CSS
This commit is contained in:
parent
2fb85e138e
commit
ebdba62a06
11 changed files with 213 additions and 66 deletions
|
@ -1,3 +1,5 @@
|
|||
import base64
|
||||
import hashlib
|
||||
from functools import lru_cache
|
||||
|
||||
from bs4 import BeautifulSoup # type: ignore
|
||||
|
@ -11,6 +13,9 @@ from app.config import CODE_HIGHLIGHTING_THEME
|
|||
_FORMATTER = HtmlFormatter(style=CODE_HIGHLIGHTING_THEME)
|
||||
|
||||
HIGHLIGHT_CSS = _FORMATTER.get_style_defs()
|
||||
HIGHLIGHT_CSS_HASH = base64.b64encode(
|
||||
hashlib.sha256(HIGHLIGHT_CSS.encode()).digest()
|
||||
).decode()
|
||||
|
||||
|
||||
@lru_cache(256)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue