Improve codeblocks style
This commit is contained in:
parent
23d92d66b8
commit
214a3b14fa
3 changed files with 19 additions and 4 deletions
|
@ -60,7 +60,9 @@ class Article(models.Model):
|
||||||
return html.split("<!--more-->")[0]
|
return html.split("<!--more-->")[0]
|
||||||
|
|
||||||
def get_formatted_content(self):
|
def get_formatted_content(self):
|
||||||
md = markdown.Markdown(extensions=["extra", CodeHiliteExtension(linenums=True)])
|
md = markdown.Markdown(
|
||||||
|
extensions=["extra", CodeHiliteExtension(linenums=False)]
|
||||||
|
)
|
||||||
content = self.content
|
content = self.content
|
||||||
content = re.sub(r"(\s)#(\w+)", r"\1\#\2", content)
|
content = re.sub(r"(\s)#(\w+)", r"\1\#\2", content)
|
||||||
return md.convert(content)
|
return md.convert(content)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
--main2: #575757;
|
--main2: #575757;
|
||||||
/*--main3: #7d7d7d;*/
|
/*--main3: #7d7d7d;*/
|
||||||
--background: #ffffff;
|
--background: #ffffff;
|
||||||
/*--background2: #f7f7f7;*/
|
--background2: #f7f7f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
|
@ -79,6 +79,19 @@ a:hover, a:focus {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.codehilite {
|
||||||
|
border-radius: .5ex;
|
||||||
|
background-color: var(--background2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.codehilite pre {
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
:root {
|
:root {
|
||||||
--accent: #226997;
|
--accent: #226997;
|
||||||
|
@ -86,7 +99,7 @@ a:hover, a:focus {
|
||||||
--main2: #cecece;
|
--main2: #cecece;
|
||||||
/*--main3: #b1b1b1;*/
|
/*--main3: #b1b1b1;*/
|
||||||
--background: #111111;
|
--background: #111111;
|
||||||
/*--background2: #575656;*/
|
--background2: #282828;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>{% block title %}Home{% endblock %} | Gab's Notes</title>
|
<title>{% block title %}Home{% endblock %} | Gab's Notes</title>
|
||||||
<link rel="stylesheet" href="{% static 'style.css' %}" type="text/css">
|
|
||||||
<link rel="stylesheet" id="code-light" href="{% static 'code-light.css' %}" type="text/css">
|
<link rel="stylesheet" id="code-light" href="{% static 'code-light.css' %}" type="text/css">
|
||||||
<link rel="stylesheet" id="code-dark" href="{% static 'code-dark.css' %}" type="text/css">
|
<link rel="stylesheet" id="code-dark" href="{% static 'code-dark.css' %}" type="text/css">
|
||||||
|
<link rel="stylesheet" href="{% static 'style.css' %}" type="text/css">
|
||||||
<script src="{% static 'toggle-dark-mode.js' %}"></script>
|
<script src="{% static 'toggle-dark-mode.js' %}"></script>
|
||||||
<link rel="alternate" type="application/rss+xml" title="Gab's Notes » Feed" href="{% url 'complete-feed' %}">
|
<link rel="alternate" type="application/rss+xml" title="Gab's Notes » Feed" href="{% url 'complete-feed' %}">
|
||||||
</head>
|
</head>
|
||||||
|
|
Reference in a new issue